[ofa-general] [PATCH] opensm: move vendor specific compilation flags to config.h

Sasha Khapyorsky sashak at voltaire.com
Tue Sep 2 07:24:00 PDT 2008


From: Ira Weiny <weiny2 at llnl.gov>

Move vendor specific compilation flags VENDOR_RMPP_SUPPORT,
DUAL_SIDED_RMPP, and OSM_VENDOR_INTF_* to config.h.

Signed-off-by: Ira Weiny <weiny2 at llnl.gov>
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/config/osmvsel.m4                |   11 ++++++-----
 opensm/libvendor/Makefile.am            |    6 +-----
 opensm/opensm/Makefile.am               |   12 ++----------
 opensm/opensm/osm_sa_multipath_record.c |    4 ++--
 opensm/osmtest/Makefile.am              |    6 +-----
 5 files changed, 12 insertions(+), 27 deletions(-)

diff --git a/opensm/config/osmvsel.m4 b/opensm/config/osmvsel.m4
index 96208b2..74d5f79 100644
--- a/opensm/config/osmvsel.m4
+++ b/opensm/config/osmvsel.m4
@@ -65,7 +65,7 @@ with_sim="/usr")
 
 dnl based on the with_osmv we can try the vendor flag
 if test $with_osmv = "openib"; then
-   OSMV_CFLAGS="-DOSM_VENDOR_INTF_OPENIB"
+   AC_DEFINE(OSM_VENDOR_INTF_OPENIB, 1, [Define as 1 for OpenIB vendor])
    OSMV_INCLUDES="-I\$(srcdir)/../include -I\$(srcdir)/../../libibcommon/include -I\$(srcdir)/../../libibumad/include -I\$(includedir)"
    OSMV_LDADD="-L\$(abs_srcdir)/../../libibumad/.libs -L\$(abs_srcdir)/../../libibcommon/.libs -L\$(libdir) -libumad -libcommon"
 
@@ -76,12 +76,13 @@ if test $with_osmv = "openib"; then
    if test "x$with_umad_includes" != "x"; then
      OSMV_INCLUDES="-I$with_umad_includes $OSMV_INCLUDES"
    fi
+   AC_DEFINE(DUAL_SIDED_RMPP, 1, [Define as 1 if you want Dual Sided RMPP Support])
 elif test $with_osmv = "sim" ; then
-   OSMV_CFLAGS="-DOSM_VENDOR_INTF_SIM"
+   AC_DEFINE(OSM_VENDOR_INTF_SIM, 1, [Define as 1 for sim vendor])
    OSMV_INCLUDES="-I$with_sim/include -I\$(srcdir)/../include"
    OSMV_LDADD="-L$with_sim/lib -libmscli"
 elif test $with_osmv = "gen1"; then
-   OSMV_CFLAGS="-DOSM_VENDOR_INTF_TS"
+   AC_DEFINE(OSM_VENDOR_INTF_TS, 1, [Define as 1 for ts vendor])
 
    if test -z $MTHOME; then
       MTHOME=/usr/local/ibgd/driver/infinihost
@@ -111,7 +112,7 @@ elif test $with_osmv = "gen1"; then
    fi
    OSMV_LDADD="-L/usr/local/ibgd/driver/infinihost/lib -lvapi -lmosal -lmtl_common -lmpga"
 elif test $with_osmv = "vapi"; then
-   OSMV_CFLAGS="-DOSM_VENDOR_INTF_MTL"
+   AC_DEFINE(OSM_VENDOR_INTF_MTL, 1, [Define as 1 for vapi vendor])
    OSMV_INCLUDES="-I/usr/mellanox/include -I/usr/include -I\$(srcdir)/../include"
    OSMV_LDADD="-L/usr/lib -L/usr/mellanox/lib -lib_mgt -lvapi -lmosal -lmtl_common -lmpga"
 else
@@ -122,9 +123,9 @@ AM_CONDITIONAL(OSMV_VAPI, test $with_osmv = "vapi")
 AM_CONDITIONAL(OSMV_GEN1, test $with_osmv = "gen1")
 AM_CONDITIONAL(OSMV_SIM, test $with_osmv = "sim")
 AM_CONDITIONAL(OSMV_OPENIB, test $with_osmv = "openib")
+AC_DEFINE(VENDOR_RMPP_SUPPORT, 1, [Define as 1 if you want Vendor RMPP Support])
 
 AC_SUBST(with_osmv)
-AC_SUBST(OSMV_CFLAGS)
 AC_SUBST(OSMV_LDADD)
 AC_SUBST(OSMV_INCLUDES)
 
diff --git a/opensm/libvendor/Makefile.am b/opensm/libvendor/Makefile.am
index f72dbbe..f359dac 100644
--- a/opensm/libvendor/Makefile.am
+++ b/opensm/libvendor/Makefile.am
@@ -11,11 +11,7 @@ INCLUDES = $(OSMV_INCLUDES)
 
 lib_LTLIBRARIES = libosmvendor.la
 
-if OSMV_OPENIB
-libosmvendor_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS)
-else
-libosmvendor_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
-endif
+libosmvendor_la_CFLAGS = -Wall $(OSMV_CFLAGS) $(DBGFLAGS)
 
 if HAVE_LD_VERSION_SCRIPT
     libosmvendor_version_script = -Wl,--version-script=$(srcdir)/libosmvendor.map
diff --git a/opensm/opensm/Makefile.am b/opensm/opensm/Makefile.am
index f94842c..522977c 100644
--- a/opensm/opensm/Makefile.am
+++ b/opensm/opensm/Makefile.am
@@ -9,11 +9,7 @@ else
 DBGFLAGS = -g
 endif
 
-if OSMV_OPENIB
-libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
-else
-libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
-endif
+libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
 
 if HAVE_LD_VERSION_SCRIPT
 libopensm_version_script = -Wl,--version-script=$(srcdir)/libopensm.map
@@ -63,11 +59,7 @@ opensm_SOURCES = main.c osm_console_io.c osm_console.c osm_db_files.c \
 
 AM_YFLAGS:= -d
 
-if OSMV_OPENIB
-opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
-else
-opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
-endif
+opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
 
 # we need to be able to load libraries from local build subtree before make install
 # we always give precedence to local tree libs and then use the pre-installed ones.
diff --git a/opensm/opensm/osm_sa_multipath_record.c b/opensm/opensm/osm_sa_multipath_record.c
index 2b8e00a..c0a4904 100644
--- a/opensm/opensm/osm_sa_multipath_record.c
+++ b/opensm/opensm/osm_sa_multipath_record.c
@@ -40,12 +40,12 @@
  *	This object is part of the opensm family of objects.
  */
 
-#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
-
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif				/* HAVE_CONFIG_H */
 
+#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
+
 #include <string.h>
 #include <iba/ib_types.h>
 #include <complib/cl_qmap.h>
diff --git a/opensm/osmtest/Makefile.am b/opensm/osmtest/Makefile.am
index 236cdcf..785f1af 100644
--- a/opensm/osmtest/Makefile.am
+++ b/opensm/osmtest/Makefile.am
@@ -13,11 +13,7 @@ osmtest_SOURCES = main.c osmtest.c osmt_service.c osmt_slvl_vl_arb.c \
 if OSMV_VAPI
 osmtest_SOURCES += osmt_mtl_regular_qp.c
 endif
-if OSMV_OPENIB
-osmtest_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS)
-else
-osmtest_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
-endif
+osmtest_CFLAGS = -Wall $(OSMV_CFLAGS) $(DBGFLAGS)
 osmtest_LDADD = -L../complib -losmcomp -L../libvendor -losmvendor -L../opensm -lopensm $(OSMV_LDADD)
 
 EXTRA_DIST = $(srcdir)/include/osmt_inform.h \
-- 
1.5.4.rc2.60.gb2e62




More information about the general mailing list