[Pkg-ofed-commits] [mstflint] 23/25: Use system libraries

Benjamin Drung bdrung at moszumanska.debian.org
Tue Jan 3 11:58:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

bdrung pushed a commit to branch master
in repository mstflint.

commit 0aedd4f97e966c89c004206dea1a397b6bb5c744
Author: Benjamin Drung <benjamin.drung at profitbricks.com>
Date:   Tue Jan 3 11:42:25 2017 +0100

    Use system libraries
    
    Change the build system to allow building against the system libraries
    of muparser and sqlite3, because distributions like Debian only want to
    support one version of each library and discourage shipping local
    copies.
---
 debian/control                       |   8 ++-
 debian/patches/series                |   1 +
 debian/patches/use-system-libs.patch | 111 +++++++++++++++++++++++++++++++++++
 3 files changed, 119 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 49888ec..f1c51d3 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,13 @@ Section: net
 Priority: extra
 Maintainer: OFED and Debian Developement and Discussion <pkg-ofed-devel at lists.alioth.debian.org>
 Uploaders: Ana Beatriz Guerrero Lopez <ana at debian.org>
-Build-Depends: debhelper (>= 9), dh-autoreconf, libibmad-dev, zlib1g-dev
+Build-Depends: debhelper (>= 9),
+               dh-autoreconf,
+               libibmad-dev,
+               libmuparser-dev,
+               libsqlite3-dev,
+               pkg-config,
+               zlib1g-dev
 Standards-Version: 3.9.8
 Vcs-Git: https://anonscm.debian.org/git/pkg-ofed/mstflint.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ofed/mstflint.git
diff --git a/debian/patches/series b/debian/patches/series
index bd8296c..66add38 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ Fix-typo-recieved-received.patch
 0007-Pass-foreign-to-automake.patch
 Fix-compilation-on-unknown-architectures.patch
 disable-werror.patch
+use-system-libs.patch
diff --git a/debian/patches/use-system-libs.patch b/debian/patches/use-system-libs.patch
new file mode 100644
index 0000000..6be2b9a
--- /dev/null
+++ b/debian/patches/use-system-libs.patch
@@ -0,0 +1,111 @@
+Description: Use system libraries
+ Change the build system to allow building against the system libraries
+ of muparser and sqlite3, because distributions like Debian only want to
+ support one version of each library and discourage shipping local
+ copies.
+Author: Benjamin Drung <bdrung at debian.org>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,6 +98,20 @@
+   LDFLAGS="$LDFLAGS -Wl,--dynamic-linker=/lib64/ld64.so.2"
+ ])
+ 
++PKG_CHECK_MODULES([MUPARSER], [muparser], [MUPARSER_SYSTEM_AVAILABLE="yes"],[
++    MUPARSER_SYSTEM_AVAILABLE="no"
++    MUPARSER_CFLAGS='-I$(top_srcdir)/ext_libs/muparser'
++    MUPARSER_LIBS='$(top_builddir)/ext_libs/muparser/libmuparser.a'
++])
++AM_CONDITIONAL([USE_LOCAL_MUPARSER], [test "$MUPARSER_SYSTEM_AVAILABLE" = no])
++
++PKG_CHECK_MODULES([SQLITE], [sqlite3], [SQLITE_SYSTEM_AVAILABLE="yes"],[
++    SQLITE_SYSTEM_AVAILABLE="no"
++    SQLITE_CFLAGS='-I$(top_srcdir)/ext_libs/sqlite'
++    SQLITE_LIBS='$(top_builddir)/ext_libs/sqlite/libsqlite3.a'
++])
++AM_CONDITIONAL([USE_LOCAL_SQLITE], [test "$SQLITE_SYSTEM_AVAILABLE" = no])
++
+ CFLAGS="$CFLAGS -DMST_UL"
+ CXXFLAGS="$CXXFLAGS -DMST_UL"
+ 
+--- a/mlxconfig/mlxcfg_db_manager.cpp
++++ b/mlxconfig/mlxcfg_db_manager.cpp
+@@ -42,7 +42,7 @@
+ //#define NDEBUG //uncomment in order to enable asserts
+ #include <assert.h>
+ 
+-#include <ext_libs/sqlite/sqlite3.h>
++#include <sqlite3.h>
+ #include "mlxcfg_db_manager.h"
+ #include "mlxcfg_utils.h"
+ 
+--- a/mlxconfig/mlxcfg_db_manager.h
++++ b/mlxconfig/mlxcfg_db_manager.h
+@@ -44,7 +44,7 @@
+ 
+ #include "mlxcfg_tlv.h"
+ #include "mlxcfg_param.h"
+-#include <ext_libs/sqlite/sqlite3.h>
++#include <sqlite3.h>
+ 
+ class MlxcfgDBManager {
+ 
+--- a/mlxconfig/mlxcfg_tlv.cpp
++++ b/mlxconfig/mlxcfg_tlv.cpp
+@@ -47,7 +47,7 @@
+ #include "../tools_layouts/tools_open_layouts.h"
+ #include "mlxcfg_tlv.h"
+ 
+-#include "ext_libs/muparser/muParser.h"
++#include <muParser.h>
+ 
+ using namespace mu;
+ 
+--- a/ext_libs/Makefile.am
++++ b/ext_libs/Makefile.am
+@@ -32,6 +32,12 @@
+ 
+ # Makefile.am -- Process this file with automake to produce Makefile.in
+ 
+-SUBDIRS = muparser sqlite
++SUBDIRS =
+ 
++if USE_LOCAL_MUPARSER
++SUBDIRS += muparser
++endif
+ 
++if USE_LOCAL_SQLITE
++SUBDIRS += sqlite
++endif
+--- a/mlxconfig/Makefile.am
++++ b/mlxconfig/Makefile.am
+@@ -40,25 +40,24 @@
+ LAYOUTS_LIB = $(LAYOUTS_DIR)/libtools_layouts.a
+ UTILS_LIB = $(USER_DIR)/mft_utils/libmftutils.a
+ CMDIF_DIR = $(USER_DIR)/cmdif
+-EXT_LIB_DIR = $(USER_DIR)/ext_libs
+ 
+ SUBDIRS = mlxconfig_dbs
+ 
+-AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
+-           -I $(LAYOUTS_DIR) -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
++mstconfig_CPPFLAGS = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I$(COMMON_DIR) $(WIN64_INC)\
++           -I $(LAYOUTS_DIR) -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR) $(MUPARSER_CFLAGS) $(SQLITE_CFLAGS)
+ 
+ 
+ AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe  -Wno-deprecated-declarations -DDATA_PATH=\"$(pkgdatadir)\"
+ bin_PROGRAMS = mstconfig
+ 
+-mstconfig_LDADD = $(UTILS_LIB) $(EXT_LIB_DIR)/sqlite/libsqlite3.a $(EXT_LIB_DIR)/muparser/libmuparser.a\
++mstconfig_LDADD = $(UTILS_LIB) $(MUPARSER_LIBS) $(SQLITE_LIBS) \
+ 								$(CMDIF_DIR)/libcmdif.a ../reg_access/libreg_access.a $(LAYOUTS_LIB) $(MTCR_DIR)/libmtcr_ul.a\
+ 								$(DEV_MGT_DIR)/libdev_mgt.a $(MLNXOS_PPC_LIBS) $(LIBSTD_CPP) -ldl
+ 
+ if DISABLE_XML2
+ AM_CXXFLAGS += -DDISABLE_XML2
+ else
+-AM_CPPFLAGS += -I$(XML2_INC_DIR)
++mstconfig_CPPFLAGS += -I$(XML2_INC_DIR)
+ mstconfig_LDADD += -lxml2
+ endif
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/mstflint.git



More information about the Pkg-ofed-commits mailing list