From patchwork Tue May 12 20:59:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 471562 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 94568140A99 for ; Wed, 13 May 2015 07:00:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 143E24B635; Tue, 12 May 2015 23:00:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UwBFnP-lhh8n; Tue, 12 May 2015 23:00:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30B8D4B617; Tue, 12 May 2015 23:00:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 426AB4B617 for ; Tue, 12 May 2015 23:00:05 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y5TW21p8jrnd for ; Tue, 12 May 2015 23:00:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by theia.denx.de (Postfix) with ESMTP id 0C2974B616 for ; Tue, 12 May 2015 23:00:02 +0200 (CEST) Received: by mail.free-electrons.com (Postfix, from userid 106) id B034ACA9; Tue, 12 May 2015 23:00:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AToulouse-657-1-14-234.w83-193.abo.wanadoo.fr [83.193.197.234]) by mail.free-electrons.com (Postfix) with ESMTPSA id 719721F4; Tue, 12 May 2015 23:00:02 +0200 (CEST) From: Thomas Petazzoni To: u-boot@lists.denx.de Date: Tue, 12 May 2015 22:59:58 +0200 Message-Id: <1431464398-15602-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.1.0 Cc: Thomas Petazzoni Subject: [U-Boot] [PATCH] tools: use pkg-config when available to get SSL flags X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Instead of hardcoding -lssl -lcrypto as the flags needed to build mkimage with FIT signature enabled, use pkg-config when available. This allows to properly support cases where static linking is used, which requires linking with -lz, since OpenSSL uses zlib internally. We gracefully fallback on the previous behavior of hardcoding -lssl -lcrypto if pkg-config is not available or fails with an error. Signed-off-by: Thomas Petazzoni --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 4bbb153..e1bcd59 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -122,7 +122,8 @@ endif # MXSImage needs LibSSL ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),) -HOSTLOADLIBES_mkimage += -lssl -lcrypto +HOSTLOADLIBES_mkimage += \ + $(shell pkg-config --libs libssl 2> /dev/null || echo "-lssl -lcrypto") endif HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)