[libixion] 01/02: add patch from upstream master adding a --disable-threads option

Rene Engelhard rene at moszumanska.debian.org
Sat Sep 17 16:32:51 UTC 2016


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

rene pushed a commit to branch experimental
in repository libixion.

commit 7594c28cacf9bc24aefbf588b31af7679c80c45d
Author: Rene Engelhard <rene at debian.org>
Date:   Sat Sep 17 15:27:06 2016 +0200

    add patch from upstream master adding a --disable-threads option
---
 debian/patches/disable-threads.diff | 105 ++++++++++++++++++++++++++++++++++++
 debian/patches/series               |   1 +
 2 files changed, 106 insertions(+)

diff --git a/debian/patches/disable-threads.diff b/debian/patches/disable-threads.diff
new file mode 100644
index 0000000..e9e9a5f
--- /dev/null
+++ b/debian/patches/disable-threads.diff
@@ -0,0 +1,105 @@
+diff --git a/configure.ac b/configure.ac
+index 95fd0ee..980fec6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,6 +42,12 @@ AC_ARG_ENABLE([python],
+     [enable_python=yes]
+ )
+ 
++AC_ARG_ENABLE([threads],
++    [AS_HELP_STRING([--disable-threads], [Disable threaded calculations])],
++    [enable_threads="$enableval"],
++    [enable_threads=yes]
++)
++
+ IXION_VERSION=ixion_version
+ IXION_API_VERSION=ixion_api_version
+ IXION_MAJOR_VERSION=ixion_major_version
+@@ -107,7 +113,15 @@ AS_IF([test "x$enable_python" != "xno"], [
+     AM_PATH_PYTHON(3)
+     PKG_CHECK_MODULES([PYTHON], [python3 >= 3.4])
+ ])
++
++AS_IF([test "x$enable_threads" != "xno"], [
++        CXXFLAGS="$CXXFLAGS -DIXION_THREADS=1"
++], [
++        CXXFLAGS="$CXXFLAGS -DIXION_THREADS=0"
++])
++
+ AM_CONDITIONAL([BUILD_PYTHON], [test "x$enable_python" != "xno"])
++AM_CONDITIONAL([IXION_THREADS], [test "x$enable_threads" != "xno"])
+ AM_CONDITIONAL([OSX], [test "x$_os" = "xDarwin"])
+ 
+ BOOST_PROGRAM_OPTIONS
+@@ -130,5 +144,6 @@ AC_MSG_NOTICE([
+ Build configuration:
+         host os:              $host_os
+         python:               $enable_python
++        threads:              $enable_threads
+ ==============================================================================
+ ])
+diff --git a/src/libixion/Makefile.am b/src/libixion/Makefile.am
+index 35b5b39..44a03f6 100644
+--- a/src/libixion/Makefile.am
++++ b/src/libixion/Makefile.am
+@@ -6,8 +6,6 @@ lib_LTLIBRARIES = libixion- at IXION_API_VERSION@.la
+ libixion_ at IXION_API_VERSION@_la_SOURCES = \
+ 	address.cpp \
+ 	cell.cpp \
+-	cell_queue_manager.hpp \
+-	cell_queue_manager.cpp \
+ 	concrete_formula_tokens.hpp \
+ 	concrete_formula_tokens.cpp \
+ 	config.cpp \
+@@ -45,6 +43,13 @@ libixion_ at IXION_API_VERSION@_la_SOURCES = \
+ 	workbook.cpp \
+ 	interface.cpp
+ 
++if IXION_THREADS
++
++libixion_ at IXION_API_VERSION@_la_SOURCES += \
++	cell_queue_manager.hpp \
++	cell_queue_manager.cpp
++
++endif
+ 
+ libixion_ at IXION_API_VERSION@_la_LDFLAGS = -no-undefined
+ libixion_ at IXION_API_VERSION@_la_LIBADD =
+diff --git a/src/libixion/depends_tracker.cpp b/src/libixion/depends_tracker.cpp
+index e428934..0249eeb 100644
+--- a/src/libixion/depends_tracker.cpp
++++ b/src/libixion/depends_tracker.cpp
+@@ -6,7 +6,10 @@
+  */
+ 
+ #include "depends_tracker.hpp"
++
++#if IXION_THREADS
+ #include "cell_queue_manager.hpp"
++#endif
+ 
+ #include "ixion/global.hpp"
+ #include "ixion/cell.hpp"
+@@ -47,6 +50,10 @@ void dependency_tracker::insert_depend(const abs_address_t& origin_cell, const a
+ 
+ void dependency_tracker::interpret_all_cells(size_t thread_count)
+ {
++#if IXION_THREADS == 0
++    thread_count = 0;  // threads are disabled thus not to be used.
++#endif
++
+     vector<abs_address_t> sorted_cells;
+     topo_sort_cells(sorted_cells);
+ 
+@@ -82,9 +89,11 @@ void dependency_tracker::interpret_all_cells(size_t thread_count)
+         return;
+     }
+ 
++#if IXION_THREADS
+     // Interpret cells in topological order using threads.
+     formula_cell_queue queue(m_context, std::move(sorted_cells), thread_count);
+     queue.run();
++#endif
+ }
+ 
+ void dependency_tracker::topo_sort_cells(vector<abs_address_t>& sorted_cells) const
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..cdd96d0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+disable-threads.diff

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



More information about the Pkg-openoffice-commits mailing list