From patchwork Thu Oct 25 16:56:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Morey-Chaisemartin X-Patchwork-Id: 10656215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA06214DE for ; Thu, 25 Oct 2018 16:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3A182C044 for ; Thu, 25 Oct 2018 16:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B09342C066; Thu, 25 Oct 2018 16:56:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26D302C044 for ; Thu, 25 Oct 2018 16:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727755AbeJZBaZ (ORCPT ); Thu, 25 Oct 2018 21:30:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:47176 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727319AbeJZBaZ (ORCPT ); Thu, 25 Oct 2018 21:30:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 40013AF3E; Thu, 25 Oct 2018 16:56:47 +0000 (UTC) From: Nicolas Morey-Chaisemartin Subject: [PATCH rdma-core 9/9] rpm: Add flag to include static libraries in the build To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca References: <20181025155306.GB30947@ziepe.ca> Openpgp: preference=signencrypt Autocrypt: addr=nmoreychaisemartin@suse.de; prefer-encrypt=mutual; keydata= xsBNBFjZETwBCADEkoe7QWAXzd9xpSiPbQK6P2F4wKdxyTp6r0aN4I0O+4fc8xWXvmwOrCjF UsuoGZ3CxJaHgdB/3ueW/IhMO5Ldz7pylhKVlG/moUh4CBK2eRUdaG7mHID01GyJMtR3VQqu 22hJhHPYy0erpYViyr+I4MzQA9QZLoQhSxn4imjZOZPcj20JE+lRfXppNv9g7vQiRLMcXjTi KcnrqG5owOi6Cn1sZ201YfdeztGxKA+jvjWO+6absTTlorIlZNGUf85s2+caGDsqa31u2DPs hVv5UUTy1g/5aP2wacSWI3Qm4n2MWl1aCnHN2h737PCXXfBk5iGJsgBUnSQULgdgEAt1ABEB AAHNO05pY29sYXMgTW9yZXktQ2hhaXNlbWFydGluIDxuaWNvbGFzQG1vcmV5LWNoYWlzZW1h cnRpbi5jb20+wsCOBBMBCAA4FiEEQtJThcGhwCuLGxxvgBvduCWYj2QFAltPP2wCGwMFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQgBvduCWYj2QOPQgAq99w9BuzV6ahqg05g3gnl2XR bjvn3zY5DLIU6W1zda5DYNO3lL14ii92MhWYAncfpqDNoTO2idDXXO4BvGiEY6+DK2liYt7R +Q1iNJfCnv5Oeh/dmaCxzbYsBV3EYqimZvGer7jxyS+wThAvE7jzMSDOzhjd0K+KWIycNDRB V0kycGwcFf/mvsZxORI8LEHFsaKRQXJ22ilubaAU9byF/gvp7fjlfWlKaL2H2OP7d9a2asbK x2A+KHQfGSOy3lkjlXDz90IOXkKvpFm5ZQMFoFxMdL0KZIAu7Lu34LNtZ9FhWfNsKo3r3u7q 9oXP9mtJpCs9yGtK36RhSKiqf2Ud1c7ATQRY2RE8AQgAvcwMwkZU4M8jvbIlS0GMG0VIXC9U 1CVPxYjkFkE5i97g3QXOjIFQbPoafNkcD22107+FuK4IQWDynZhV70Tfo7xgy6tX9obLgkoh NXJEzMxVfrCqFkSBAtdrRKcOZ3BBRpvtZP6yUS5PXh8bqp/skYz68jfAiurSuPm+LWdrqypT 9vVxvk95f5m1EqKn46r8nimluscO5LvPRF9l6EFj/6ZvdkcVHelQ1Pb6VVv0+6j2UZdMLVJw 5ztsHj6GZr1HxK+TrIdzDb5tZshvr+BFdh4L2jU+qWtuyKba1KtOnAOnQ7CCsD7TLk4SUKfP 8bpoJeUPQPxK0KCU6wfa3JSJuwARAQABwsBfBBgBAgAJBQJY2RE8AhsMAAoJEIAb3bglmI9k MDcH/3jiKRQeu3CqFCb3JtyVnL52oGTrsmrAsMcB/WtKPYzkXKvp7CaMp0vw6Y1ChsmWoMu/ he7Aaxe18dHFxdn+QaONlzTYkAxOT/1S8L4J/etgCd6tHaeDu6ECPFIDZnbKHEITWgRxwqDm myxq4DaGw02iwXm/c2jmas/AgbgImdG1QARKYOdIQxGEx6eIwoFqWnYQLKf3goJvd03PmPnt X6rRNxZqDi8coRWunr4Z9ENYl9JAmrDGcJc7Hs6i2Y0zNSqKp+vlCB1xN0GlC8hSg9Rg4YrF 8cqJTgej9k17Mn74rWHSGdwgrSOz1Q8c5l9l5JLxM/WzLUraDKbHvagLJh0= Message-ID: <4c471c17-ecb9-d528-7e83-14c4fbc0bf5d@suse.de> Date: Thu, 25 Oct 2018 18:56:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181025155306.GB30947@ziepe.ca> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we can produce them properly, make it easy to add them. Signed-off-by: Jason Gunthorpe Signed-off-by: Nicolas Morey-Chaisemartin --- Tested both ways on centos7 and tumbleweed redhat/rdma-core.spec | 15 +++++++++++++++ suse/rdma-core.spec | 18 +++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index c281c5fa4e2c..644c3ffd01bf 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -10,6 +10,8 @@ Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core Source: rdma-core-%{version}.tgz +# Do not build static libs by default. +%define with_static %{?_with_static: 1} %{?!_with_static: 0} BuildRequires: binutils BuildRequires: cmake >= 2.8.11 @@ -73,6 +75,13 @@ Obsoletes: librdmacm-devel < %{version}-%{release} Requires: ibacm = %{version}-%{release} Provides: ibacm-devel = %{version}-%{release} Obsoletes: ibacm-devel < %{version}-%{release} +%if %{with_static} +# Since our pkg-config files include private references to these packages they +# need to have their .pc files installed too, even for dynamic linking, or +# pkg-config breaks. +BuildRequires: pkgconfig(libnl-3.0) +BuildRequires: pkgconfig(libnl-route-3.0) +%endif %description devel RDMA core development libraries and headers. @@ -233,6 +242,9 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ +%if %{with_static} + -DENABLE_STATIC=1 \ +%endif %{EXTRA_CMAKE_FLAGS} %make_jobs @@ -352,6 +364,9 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %dir %{_includedir}/rdma %{_includedir}/infiniband/* %{_includedir}/rdma/* +%if %{with_static} +%{_libdir}/lib*.a +%endif %{_libdir}/lib*.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/ibv_* diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec index 4bb4086cdc78..3eafce39afd2 100644 --- a/suse/rdma-core.spec +++ b/suse/rdma-core.spec @@ -17,6 +17,9 @@ %bcond_without systemd +# Do not build static libs by default. +%define with_static %{?_with_static: 1} %{?!_with_static: 0} + %define git_ver %{nil} Name: rdma-core Version: 21.0 @@ -143,7 +146,14 @@ Obsoletes: librdmacm-devel < %{version}-%{release} #Requires: ibacm = %%{version}-%%{release} Provides: ibacm-devel = %{version}-%{release} Obsoletes: ibacm-devel < %{version}-%{release} - +%if %{with_static} +# Since our pkg-config files include private references to these packages they +# need to have their .pc files installed too, even for dynamic linking, or +# pkg-config breaks. +BuildRequires: pkgconfig(libnl-3.0) +BuildRequires: pkgconfig(libnl-route-3.0) +%endif + %description devel RDMA core development libraries and headers. @@ -348,6 +358,9 @@ on those changes. -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \ +%if %{with_static} + -DENABLE_STATIC=1 \ +%endif %{EXTRA_CMAKE_FLAGS} %make_jobs @@ -526,6 +539,9 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %dir %{_includedir}/rdma %{_includedir}/infiniband/* %{_includedir}/rdma/* +%if %{with_static} +%{_libdir}/lib*.a +%endif %{_libdir}/lib*.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/ibv_*