From patchwork Tue Apr 19 23:57:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Martin X-Patchwork-Id: 612419 X-Patchwork-Delegate: swarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qqMS05B9Hz9t3f for ; Wed, 20 Apr 2016 09:59:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbcDSX7J (ORCPT ); Tue, 19 Apr 2016 19:59:09 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:2015 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692AbcDSX7J (ORCPT ); Tue, 19 Apr 2016 19:59:09 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Tue, 19 Apr 2016 16:59:07 -0700 Received: from HQHUB102.nvidia.com ([172.20.187.25]) by hqnvupgp08.nvidia.com (PGP Universal service); Tue, 19 Apr 2016 16:59:02 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Tue, 19 Apr 2016 16:59:02 -0700 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQHUB102.nvidia.com (172.20.187.25) with Microsoft SMTP Server (TLS) id 8.3.406.0; Tue, 19 Apr 2016 16:59:07 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 19 Apr 2016 23:59:07 +0000 Received: from nvidia.com (172.20.13.39) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1130.7 via Frontend Transport; Tue, 19 Apr 2016 23:59:07 +0000 Date: Tue, 19 Apr 2016 16:57:45 -0700 From: Allen Martin To: Stephen Warren CC: Thomas Petazzoni , Subject: Re: [tegrarcm PATCH] Don't assume cryptopp is system-wide installed Message-ID: <20160419235745.GA28796@nvidia.com> References: <1461097517-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> <5716B20E.8050607@wwwdotorg.org> MIME-Version: 1.0 In-Reply-To: <5716B20E.8050607@wwwdotorg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Disposition: inline Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.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 > > or and rely on the compiler include > >path. > > > >The tricky part is that it can be or . 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 > > 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? --- -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 = \