Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3008036imu; Fri, 23 Nov 2018 19:14:24 -0800 (PST) X-Google-Smtp-Source: AJdET5cAuUC5mrVFTpycJsgIJRLbc/Q0x9h1I/mVILe+w/SQa1TOqm+tIrLNqookExOmUUUAfe7r X-Received: by 2002:a62:401:: with SMTP id 1-v6mr18335136pfe.156.1543029264151; Fri, 23 Nov 2018 19:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543029264; cv=none; d=google.com; s=arc-20160816; b=oxRj24yQb3n/xvCkl1WGB3xaJw9ZUU4NyyQghifpNzKMgE2lckJYi5kJTWJG81TnFy 3JtDUA0jhslYS2YEfkOTkYIhVnt8BTJp3kkMvXtrzMVDBVQgLJTFGnvLWmY9Hkj8ciOD gIRgZw3uPis8LuYku9cny13akgxyUpb/roxjaLTBys9nT38KRH7J3gU2t6jzKQRNMYtK ucsDHJ/2jRsSc7gasE6ghLjUVO/Eu/433kvIJoN5lQYSpX+ruBQtIR8+0J6TivKcBoYc YapfW3Jg9bIJiqBKrr+EFANm1cc2NXG6LjOZcW7qI01Sz+9G9ATc7B96E3x2kyWzGNw/ NBBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=53PRYLNfYHtdJiDb4EW03zMBlBvlDBVjEwRLUUYL2bc=; b=dm+19u1KU+At8zqUv/pWXu8yGjE0njsn4j9PhFanckGC10qWNE8rGnJtYhSLNPIyHr bCx0iPMYkk6UYMMPPQ6v02/ijDyQ8U0uqPCSoGmULAKHrkMxjXRxOUVtC/gzWcN+Ac2P jC5HrUrL93Q4PwN/DO+suDiAOUGeOu3XIlSyLD0z+yyU/PhGj9NJvCFInRwn3nHEjul8 30136Jd0c3Te1uLEFIHys9qdRrV76CUqzy999US4J+8vh4mvPopqN570LhLJ4V6KzC29 +KoHeSaiQR46PlYAoYr2ro1PWkPgdrHNIZQU/zaQ3MXyGfk6XS6HqfPp2kAXg4N7dNSW e+eA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si8213762pgk.249.2018.11.23.19.14.10; Fri, 23 Nov 2018 19:14:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388654AbeKWDXB convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Nov 2018 22:23:01 -0500 Received: from mx1.emlix.com ([46.4.235.150]:43864 "EHLO mx1.emlix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728450AbeKWDXB (ORCPT ); Thu, 22 Nov 2018 22:23:01 -0500 Received: from mailer.emlix.com (unknown [81.20.119.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 846C825F629; Thu, 22 Nov 2018 17:42:50 +0100 (CET) From: Rolf Eike Beer To: David Woodhouse Cc: Linux Kernel Developers List , David Howells , keyrings@vger.kernel.org Subject: [PATCH v2] scripts: use pkg-config to locate libcrypto Date: Thu, 22 Nov 2018 17:42:50 +0100 Message-ID: <2429714.x0fLlpPdDl@devpool21> Organization: emlix GmbH In-Reply-To: References: <3861016.XCek94Sdvs@devpool21> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise build fails if the headers are not in the default location. While at it also ask pkg-config for the libs, with fallback to the existing value. Signed-off-by: Rolf Eike Beer Cc: stable@vger.kernel.org --- scripts/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index ece52ff20171..769fa6b7b685 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -8,7 +8,11 @@ # conmakehash: Create chartable # conmakehash: Create arrays for initializing the kernel console tables +PKG_CONFIG?= pkg-config + HOST_EXTRACFLAGS += -I$(srctree)/tools/include +CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || -lcrypto) +CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null) hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c hostprogs-$(CONFIG_KALLSYMS) += kallsyms @@ -23,8 +27,9 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include -HOSTLDLIBS_sign-file = -lcrypto -HOSTLDLIBS_extract-cert = -lcrypto +HOSTLDLIBS_sign-file = $(CRYPTO_LIBS) +HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) +HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) always := $(hostprogs-y) $(hostprogs-m) -- 2.19.1 -- Rolf Eike Beer, emlix GmbH, http://www.emlix.com Fon +49 551 30664-0, Fax +49 551 30664-11 Gothaer Platz 3, 37083 Göttingen, Germany Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160 Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055 emlix - smart embedded open source