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

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

 



Hello,

On Tue, 19 Apr 2016 16:57:45 -0700, Allen Martin wrote:

> 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++)

Using pkg-config is indeed a much better option. However, there are
several gotchas:

 - First, calling pkg-config like this is not the correct way of using
   pkg-config in autoconf/automake based packages. Instead, you should
   use the PKG_CHECK_MODULES() autoconf macro, which will fill in for
   you the <foo>_CFLAGS and <foo>_LIBS variables. Look at your
   configure.ac, it is already used for the detection of libusb!

 - Second, your logic assumes that libcrypto is called libcrypto++
   while the crux of the matter is that on some platforms it is named
   libcryptopp, on others it's called libcrypto++. Of course, this can
   be solved in the configure.ac by calling PKG_CHECK_MODULES() for
   both.

 - Third, the upstream version of libcrypto++ does *not* install a
   pkg-config file. The Debian packagers have added one, so you
   probably have one on your Debian system, but if you build
   libcrypto++ from source and simply "make install" it, you won't have
   a .pc file that describes it for pkg-config.

The last point is the very reason why my patch didn't switch to simply
use pkg-config.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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