* [PATCH rdma-core] build: Pass extra cmake flags
@ 2018-02-01 10:32 Leon Romanovsky
[not found] ` <20180201103206.26356-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2018-02-01 10:32 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Alaa Hleihel, RDMA mailing list, Benjamin Drung,
Nicolas Morey-Chaisemartin
From: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Add ability to provide extra cmake flags when building library
and when creating RPMs or DEBs using EXTRA_CMAKE_FLAGS.
Set an environment variable prior execution to provide
this information to build scripts:
export EXTRA_CMAKE_FLAGS="<flags>"
Cc: Benjamin Drung <benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Cc: Nicolas Morey-Chaisemartin <nmoreychaisemartin-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
build.sh | 4 ++--
debian/rules | 3 ++-
redhat/rdma-core.spec | 5 ++++-
suse/rdma-core.spec | 5 ++++-
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/build.sh b/build.sh
index 17dc4408..a6b1e8f0 100755
--- a/build.sh
+++ b/build.sh
@@ -23,9 +23,9 @@ fi
cd "$BUILDDIR"
if [ "x$NINJA" == "x" ]; then
- $CMAKE -DIN_PLACE=1 ..
+ $CMAKE -DIN_PLACE=1 ${EXTRA_CMAKE_FLAGS:-} ..
make
else
- $CMAKE -DIN_PLACE=1 -GNinja ..
+ $CMAKE -DIN_PLACE=1 -GNinja ${EXTRA_CMAKE_FLAGS:-} ..
$NINJA
fi
diff --git a/debian/rules b/debian/rules
index 87d02104..46d9a2be 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,7 +32,8 @@ override_dh_auto_configure:
-DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/lib \
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/var/lib \
-DCMAKE_INSTALL_RUNDIR:PATH=/run \
- -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d
+ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d \
+ $(EXTRA_CMAKE_FLAGS)
override_dh_auto_build:
ninja -C build-deb -v
diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
index 434d5679..fd9a95ee 100644
--- a/redhat/rdma-core.spec
+++ b/redhat/rdma-core.spec
@@ -205,6 +205,8 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand.
%define _rundir /var/run
%endif
+%{!?EXTRA_CMAKE_FLAGS: %define EXTRA_CMAKE_FLAGS %{nil}}
+
# Pass all of the rpm paths directly to GNUInstallDirs and our other defines.
%cmake %{CMAKE_FLAGS} \
-DCMAKE_BUILD_TYPE=Release \
@@ -222,7 +224,8 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand.
-DCMAKE_INSTALL_INITDDIR:PATH=%{_initrddir} \
-DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
-DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \
- -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir}
+ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \
+ %{EXTRA_CMAKE_FLAGS}
%make_jobs
%install
diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec
index cb6ffb36..698c1536 100644
--- a/suse/rdma-core.spec
+++ b/suse/rdma-core.spec
@@ -319,6 +319,8 @@ on those changes.
%define _rundir /var/run
%endif
+%{!?EXTRA_CMAKE_FLAGS: %define EXTRA_CMAKE_FLAGS %{nil}}
+
# Pass all of the rpm paths directly to GNUInstallDirs and our other defines.
%cmake %{CMAKE_FLAGS} \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" \
@@ -338,7 +340,8 @@ on those changes.
-DCMAKE_INSTALL_INITDDIR:PATH=%{_initddir} \
-DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
-DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \
- -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir}
+ -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \
+ %{EXTRA_CMAKE_FLAGS}
%make_jobs
%install
--
2.16.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] build: Pass extra cmake flags
[not found] ` <20180201103206.26356-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2018-02-05 1:40 ` Doug Ledford
[not found] ` <1517794847.3936.52.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Doug Ledford @ 2018-02-05 1:40 UTC (permalink / raw)
To: Leon Romanovsky, Jason Gunthorpe
Cc: Alaa Hleihel, RDMA mailing list, Benjamin Drung,
Nicolas Morey-Chaisemartin
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
On Thu, 2018-02-01 at 12:32 +0200, Leon Romanovsky wrote:
> From: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> Add ability to provide extra cmake flags when building library
> and when creating RPMs or DEBs using EXTRA_CMAKE_FLAGS.
>
> Set an environment variable prior execution to provide
> this information to build scripts:
> export EXTRA_CMAKE_FLAGS="<flags>"
>
> Cc: Benjamin Drung <benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
> Cc: Nicolas Morey-Chaisemartin <nmoreychaisemartin-l3A5Bk7waGM@public.gmane.org>
> Signed-off-by: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Tested as best I could locally then applied, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] build: Pass extra cmake flags
[not found] ` <1517794847.3936.52.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2018-02-05 12:53 ` Leon Romanovsky
0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2018-02-05 12:53 UTC (permalink / raw)
To: Doug Ledford
Cc: Jason Gunthorpe, Alaa Hleihel, RDMA mailing list, Benjamin Drung,
Nicolas Morey-Chaisemartin
[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]
On Sun, Feb 04, 2018 at 08:40:47PM -0500, Doug Ledford wrote:
> On Thu, 2018-02-01 at 12:32 +0200, Leon Romanovsky wrote:
> > From: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> > Add ability to provide extra cmake flags when building library
> > and when creating RPMs or DEBs using EXTRA_CMAKE_FLAGS.
> >
> > Set an environment variable prior execution to provide
> > this information to build scripts:
> > export EXTRA_CMAKE_FLAGS="<flags>"
> >
> > Cc: Benjamin Drung <benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
> > Cc: Nicolas Morey-Chaisemartin <nmoreychaisemartin-l3A5Bk7waGM@public.gmane.org>
> > Signed-off-by: Alaa Hleihel <alaa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>
> Tested as best I could locally then applied, thanks.
Thanks,
We are running this option internally, so I'm pretty confident in it.
>
> --
> Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> GPG KeyID: B826A3330E572FDD
> Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-05 12:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 10:32 [PATCH rdma-core] build: Pass extra cmake flags Leon Romanovsky
[not found] ` <20180201103206.26356-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-02-05 1:40 ` Doug Ledford
[not found] ` <1517794847.3936.52.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-02-05 12:53 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).