rdma-core: add debug build option 67/18767/2
authorBenoît Ganne <bganne@cisco.com>
Tue, 9 Apr 2019 07:00:42 +0000 (09:00 +0200)
committerDamjan Marion <dmarion@me.com>
Tue, 9 Apr 2019 23:46:41 +0000 (23:46 +0000)
Add option RDMA_CORE_DEBUG=[yn] build option. rdma-core package is built
in Release (-O2) mode by default, but Debug (-O0 -g) mode can be
selected by eg.
 make install-ext-deps RDMA_CORE_DEBUG=y

Change-Id: Id4db5ef1e7b13c44d478755a0bfbdbe56cfc13df
Signed-off-by: Benoît Ganne <bganne@cisco.com>
build/external/packages/rdma-core.mk

index 9961c80..09f826c 100644 (file)
@@ -11,6 +11,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+RDMA_CORE_DEBUG?=n
+
 rdma-core_version             := 23
 rdma-core_tarball             := rdma-core-$(rdma-core_version).tar.gz
 rdma-core_tarball_md5sum_22.1 := dde4d30e3db20893408ae51041117034
@@ -19,6 +21,11 @@ rdma-core_tarball_md5sum      := $(rdma-core_tarball_md5sum_$(rdma-core_version)
 rdma-core_tarball_strip_dirs  := 1
 rdma-core_url                 := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)
 
+RDMA_BUILD_TYPE:=Release
+ifeq ($(RDMA_CORE_DEBUG),y)
+RDMA_BUILD_TYPE:=Debug
+endif
+
 RDMA_FILES := include/infiniband/verbs.h \
              include/infiniband/verbs_api.h \
              include/infiniband/ib_user_ioctl_verbs.h \
@@ -30,7 +37,7 @@ define  rdma-core_config_cmds
        cd $(rdma-core_build_dir) && \
          $(CMAKE) -G Ninja $(rdma-core_src_dir) \
            -DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0 \
-           -DCMAKE_BUILD_TYPE=Release \
+           -DCMAKE_BUILD_TYPE=$(RDMA_BUILD_TYPE) \
            -DCMAKE_C_FLAGS='-fPIC -fvisibility=hidden' > $(rdma-core_config_log)
 endef