Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp327663pxb; Wed, 13 Jan 2021 04:52:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx30kV73fY7E8+1AKkdW5axjcV+uIUdsEpiNRbG8e9YlKdpxhMJWa4IrU+qn1KBUwNmC1PN X-Received: by 2002:a17:907:11ca:: with SMTP id va10mr1400694ejb.78.1610542366902; Wed, 13 Jan 2021 04:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610542366; cv=none; d=google.com; s=arc-20160816; b=B13UcAGH7+M4ws9x1kVc/ALx3x+Len4nX5EMCMhsTUp7e7QIYqdDoIquzNIhx0HRap 5nqFZEGDIoRckbGpuN9XIFPcxhULr6utFSmTeYDQoUjePXq8MXfOCt8GLw+5PHPwfnsl IP3DbLJ6HPYQFpdDSm9pfjIUEwtMQaIy8a514+68FFclJNtNyeHgvcOBWo/UH3dIBRQw P6XzbJgNB8Ii2ubrNYrnmRe1qgLqmOCPaUQqpgg8oXcnjgduzQnQo7Cvd42xwBslIwrn H/uvt/uhXBUTgl0MA8A0erDNnSd6vIM+hUrUsBcl8vgxv2KCpf3Ox2UTliwX8GZZIMtK QOoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from; bh=is3+yZJAIfTxpZmH5Gm3NHD9tvB/wJXytFSQmLBmwMY=; b=B2L2gLNri98cikSfRQyneFaE00C4RppeLBTLQZGu6i0d9MX3jPMW9L8QGb2ibLI+NR JcQozYYAVXtFJ0lsLIf0psboyLxpcgDl16GaZDeiGuLz+27isUhBbV+I2YPPIdG57hdA iNgCOgOtjeWn80x6xrLiUpz1oalovD3kA8zQfR7Ol1RPHr/8l/cqMnCD7dlq50xEGsLx fJXgjrGtnlPApDJCLdNb7LN/cEkYIuRL2e76hSRqr7XHc9RvORbstt+5M/Il58otYAjS GYl9KXWSCQSTrJy28GyfQBrpVGgx1mJNkEUL4InZKy3loVPJg+VmXrs187gGNHG3oAF9 1GNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si914509eds.206.2021.01.13.04.51.56; Wed, 13 Jan 2021 04:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbhAMMt4 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 13 Jan 2021 07:49:56 -0500 Received: from mx1.emlix.com ([136.243.223.33]:34712 "EHLO mx1.emlix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbhAMMtz (ORCPT ); Wed, 13 Jan 2021 07:49:55 -0500 Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 5386F5FA09; Wed, 13 Jan 2021 13:49:13 +0100 (CET) From: Rolf Eike Beer To: David Woodhouse Cc: Linux Kernel Developers List , David Howells , keyrings@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v5] scripts: use pkg-config to locate libcrypto Date: Wed, 13 Jan 2021 13:49:12 +0100 Message-ID: <3394639.6NgGvCfkNl@devpool47> Organization: emlix GmbH In-Reply-To: <2278760.8Yd83Mgoko@devpool35> References: <20538915.Wj2CyUsUYa@devpool35> <2278760.8Yd83Mgoko@devpool35> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" 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 # 5.6.x --- scripts/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) This has been sent multiple times since more than 2 year, please pick it up through whatever tree. I need to patch every new stable kernel version to make them build in our chrooted environment. diff --git a/scripts/Makefile b/scripts/Makefile index b5418ec587fb..7553692d241f 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -3,6 +3,11 @@ # scripts contains sources for various helper programs used throughout # the kernel for the build process. +PKG_CONFIG ?= pkg-config + +CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) +CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null) + hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount @@ -14,8 +19,9 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert HOSTCFLAGS_sorttable.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) ifdef CONFIG_UNWINDER_ORC ifeq ($(ARCH),x86_64) -- 2.29.2 -- 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