From patchwork Wed Aug 22 20:37:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 179404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 0F6DF2C00A6 for ; Thu, 23 Aug 2012 06:37:14 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C324F10B975; Wed, 22 Aug 2012 20:37:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E68+ulaU+A7Y; Wed, 22 Aug 2012 20:37:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C0D1110B966; Wed, 22 Aug 2012 20:37:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B43768F753 for ; Wed, 22 Aug 2012 20:37:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AD1998F0E4 for ; Wed, 22 Aug 2012 20:37:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XmQbcRktV7RN for ; Wed, 22 Aug 2012 20:37:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by whitealder.osuosl.org (Postfix) with ESMTP id D2CD88F0DF for ; Wed, 22 Aug 2012 20:37:06 +0000 (UTC) Received: from treguer.bzh.lan ([90.32.252.246]) by mwinf5d17 with ME id pwd31j00B5Kjsuq03wd3uc; Wed, 22 Aug 2012 22:37:05 +0200 From: "Yann E. MORIN" To: buildroot@busybox.net Date: Wed, 22 Aug 2012 22:37:03 +0200 Message-Id: <1345667823-16633-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH] package/cURL: fix static link whith openSSL X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net When openSSL is selected, cURL is configured to use it. But in this case, the libcurl.pc file /forgets/ to require link against -ldl. This can happen, for example, when BR2_PREFER_STATIC_LIB is not set, but an executable wants to be linked statically (for various reasons which are irrelevant here). Fix that by conditionally append -ldl to the Libs.Private section of the installed libcurl.pc if openSSL is enabled. Signed-off-by: "Yann E. MORIN" --- package/libcurl/libcurl.mk | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk index 090bb4c..35c7f56 100644 --- a/package/libcurl/libcurl.mk +++ b/package/libcurl/libcurl.mk @@ -29,14 +29,20 @@ define LIBCURL_TARGET_CLEANUP rm -rf $(TARGET_DIR)/usr/bin/curl-config \ $(if $(BR2_PACKAGE_CURL),,$(TARGET_DIR)/usr/bin/curl) endef - +define LIBCURL_FIX_TARGET_PC + $(SED) '/^Libs.private:/s/[[:space:]]*$$/ -ldl/;' $(TARGET_DIR)/usr/lib/pkgconfig/libcurl.pc +endef LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP +LIBCURL_POST_INSTALL_TARGET_HOOKS += $(if $(BR2_PACKAGE_OPENSSL),LIBCURL_FIX_TARGET_PC) define LIBCURL_STAGING_FIXUP_CURL_CONFIG $(SED) "s,prefix=/usr,prefix=$(STAGING_DIR)/usr," $(STAGING_DIR)/usr/bin/curl-config endef - +define LIBCURL_FIX_STAGING_PC + $(SED) '/^Libs.private:/s/[[:space:]]*$$/ -ldl/;' $(STAGING_DIR)/usr/lib/pkgconfig/libcurl.pc +endef LIBCURL_POST_INSTALL_STAGING_HOOKS += LIBCURL_STAGING_FIXUP_CURL_CONFIG +LIBCURL_POST_INSTALL_STAGING_HOOKS += $(if $(BR2_PACKAGE_OPENSSL),LIBCURL_FIX_STAGING_PC) $(eval $(autotools-package))