From: Allen Martin <amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Thomas Petazzoni
<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [tegrarcm PATCH] Don't assume cryptopp is system-wide installed
Date: Tue, 19 Apr 2016 16:57:45 -0700 [thread overview]
Message-ID: <20160419235745.GA28796@nvidia.com> (raw)
In-Reply-To: <5716B20E.8050607-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On Tue, Apr 19, 2016 at 04:32:46PM -0600, Stephen Warren wrote:
> On 04/19/2016 02:25 PM, Thomas Petazzoni wrote:
> >The current build system adds "-isystem /usr/include/$(CRYPTOLIB)" to
> >AM_CPPFLAGS, but this is wrong because cryptopp might not be installed
> >in this location. Instead, the build system should simply include
> ><cryptopp/...> or <crypto++/...> and rely on the compiler include
> >path.
> >
> >The tricky part is that it can be <cryptopp/...> or <crypto++/...>. To
> >solve this, we use a solution similar to the one used in
> >https://github.com/bingmann/crypto-speedtest/blob/master/m4/cryptopp.m4
> >and
> >https://github.com/bingmann/crypto-speedtest/blob/master/src/speedtest_cryptopp.cpp:
> >the configure script fills in a variable called
> >CRYPTOLIB_HEADER_PREFIX, and we use that in the C++ code to include
> >the right header file.
> >
> >It is worth mentioning that doing #include
> ><CRYPTOLIB_HEADER_PREFIX/foobar.h> doesn't work, and we have to use an
> >intermediate #define'd constant to overcome this C preprocessor
> >limitation.
>
> I think this looks conceptually OK. CC += Allen to double-check
> since he wrote the original cryptopp autoconf support.
What about the following as an alternative?
--
diff --git a/src/Makefile.am b/src/Makefile.am
index 3dad0e6d5e72..22410b3f81bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,6 @@
AM_CFLAGS = -Wall -std=c99
-AM_CPPFLAGS = -isystem /usr/include/$(CRYPTOLIB) $(LIBUSB_CFLAGS)
+CRYPTO_PREFIX = $(shell pkg-config --variable=includedir libcrypto++)
+AM_CPPFLAGS = -isystem $(CRYPTO_PREFIX)/$(CRYPTOLIB) $(LIBUSB_CFLAGS)
bin_PROGRAMS = tegrarcm
tegrarcm_SOURCES = \
next prev parent reply other threads:[~2016-04-19 23:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 20:25 [tegrarcm PATCH] Don't assume cryptopp is system-wide installed Thomas Petazzoni
[not found] ` <1461097517-21626-1-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-19 22:32 ` Stephen Warren
[not found] ` <5716B20E.8050607-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-04-19 22:50 ` Allen Martin
2016-04-19 23:57 ` Allen Martin [this message]
[not found] ` <20160419235745.GA28796-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-20 9:27 ` Thomas Petazzoni
[not found] ` <20160420112735.16eca48a-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-04-21 18:13 ` Allen Martin
[not found] ` <20160421181359.GA17433-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-21 19:24 ` Thomas Petazzoni
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=20160419235745.GA28796@nvidia.com \
--to=amartin-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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 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.