Re: [tegrarcm PATCH] Don't assume cryptopp is system-wide installed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 = \

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux