[med-svn] [cnrun] 02/10: deboostification (part 1/2)

andrei zavada hmmr-guest at alioth.debian.org
Sun Sep 22 17:19:13 UTC 2013


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

hmmr-guest pushed a commit to branch master
in repository cnrun.

commit cd25fd88c5247e249635d781e9ffadbc8adf67f4
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Mon Sep 16 20:34:46 2013 +0300

    deboostification (part 1/2)
---
 upstream/autogen.sh                 |    3 ++-
 upstream/configure.ac               |   19 +++---------------
 upstream/src/Makefile.am            |   12 ++++++++---
 upstream/src/libcn/Makefile.am      |   10 ++++-----
 upstream/src/libcn/model-nmlio.cc   |    2 --
 upstream/src/libstilton/Makefile.am |    8 +++++---
 upstream/src/runner-interpreter.cc  |   38 +++++++++++++++++------------------
 7 files changed, 42 insertions(+), 50 deletions(-)

diff --git a/upstream/autogen.sh b/upstream/autogen.sh
index 402acef..2415c4e 100755
--- a/upstream/autogen.sh
+++ b/upstream/autogen.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-test -d /usr/share/autoconf-archive && AUTOCONF_ARCHIVE="-I /usr/share/autoconf-archive"
+test -d /usr/share/autoconf-archive && AUTOCONF_ARCHIVE=" -I /usr/share/autoconf-archive"
+test -d /usr/share/aclocal/ac-archive && AUTOCONF_ARCHIVE=$AUTOCONF_ARCHIVE" -I /usr/share/aclocal/ac-archive"
 libtoolize --force --copy
 aclocal $AUTOCONF_ARCHIVE
 autoheader
diff --git a/upstream/configure.ac b/upstream/configure.ac
index 7a32637..aac8789 100644
--- a/upstream/configure.ac
+++ b/upstream/configure.ac
@@ -46,15 +46,12 @@ ac_cv_cxx_cpp0x_features,
 ])
 AC_CXX_STDCPP0X_FEATURES()
 test $ac_cv_cxx_cpp0x_features = no && \
-   AC_MSG_ERROR([g++ version >= 4.6.2 is required to build $PACKAGE as we must use -std=c++0x your g++ doesn't seem to support (first of all, range-based for)], 1)
+   AC_MSG_ERROR([g++ version >= 4.6.2 is required to build $PACKAGE as we use -std=c++0x your g++ doesn't seem to support], 1)
 
 AC_OPENMP()
 
-AX_BOOST_BASE([1.33])
-AX_BOOST_REGEX([1.33])
-
-AX_LIB_READLINE
-if test x"$ax_cv_lib_readline" = x"no"; then
+AC_LIB_READLINE
+if test x"$ac_cv_lib_readline" = x"no"; then
    echo "Required library readline not found"
    AC_MSG_ERROR( [Missing readline], 2)
 fi
@@ -71,16 +68,6 @@ if test x"$do_tools" != xyes; then
    do_tools=no
 fi
 
-dnl AC_ARG_ENABLE( more-neurons,
-dnl 	       AS_HELP_STRING( [--enable-more-neurons], [enable some exotic neurons (default = yes)]),
-dnl 	       [WANT_MORE_NEURONS=$enableval], [want_more_neurons=yes])
-dnl if test x"$want_more_neurons" = xyes; then
-dnl    AC_DEFINE([CN_WANT_MORE_NEURONS], [1], [More exotic neurons])
-dnl else
-dnl    want_more_neurons=no
-dnl fi
-
-
 AC_ARG_ENABLE(
 	[pch],
 	[AS_HELP_STRING( [--enable-pch], [precompile headers (default = no)])],
diff --git a/upstream/src/Makefile.am b/upstream/src/Makefile.am
index c19fc8b..d206f3e 100644
--- a/upstream/src/Makefile.am
+++ b/upstream/src/Makefile.am
@@ -1,7 +1,7 @@
 SUBDIRS = libstilton libcn
 
-AM_CXXFLAGS = -Wall -std=c++0x \
-	$(BOOST_CPPFLAGS) $(LIBCN_CFLAGS) \
+AM_CXXFLAGS = -Wall -std=c++0x -fno-rtti \
+	$(LIBCN_CFLAGS) \
 	-DBUILT_BY=\"@user@\"
 
 bin_PROGRAMS = \
@@ -11,7 +11,9 @@ cnrun_SOURCES = \
 cnrun_LDADD = \
 	libcn/libcn.la \
 	libstilton/libstilton.la \
-	$(LIBCN_LIBS) $(BOOST_REGEX_LIB)
+	$(LIBCN_LIBS)
+cnrun_LDFLAAGS = \
+	-shared
 
 if DO_TOOLS
 bin_PROGRAMS += \
@@ -22,6 +24,8 @@ spike2sdf_SOURCES = \
 
 varfold_SOURCES = \
 	varfold.cc
+varfold_LDFLAAGS = \
+	-shared
 varfold_LDADD = \
 	$(LIBCN_LIBS)
 
@@ -29,6 +33,8 @@ hh_latency_estimator_SOURCES = \
 	hh-latency-estimator.cc
 hh_latency_estimator_LDADD = \
 	${cnrun_LDADD}
+hh_latency_estimator_LDFLAAGS = \
+	-shared
 endif
 
 
diff --git a/upstream/src/libcn/Makefile.am b/upstream/src/libcn/Makefile.am
index 8440aec..4321325 100644
--- a/upstream/src/libcn/Makefile.am
+++ b/upstream/src/libcn/Makefile.am
@@ -1,7 +1,6 @@
-AM_CXXFLAGS = \
-	-Wall -std=c++0x \
-	$(LIBCN_CFLAGS) $(BOOST_CPPFLAGS) \
-	$(OPENMP_CXXFLAGS)
+AM_CXXFLAGS = -Wall -fno-rtti -shared -std=c++0x \
+	$(LIBCN_CFLAGS) $(OPENMP_CXXFLAGS) \
+	-I$(top_srcdir)/src
 
 pkglib_LTLIBRARIES = libcn.la
 
@@ -28,7 +27,8 @@ libcn_la_SOURCES = \
 
 libcn_la_LDFLAGS = \
 	-avoid-version \
-	-rpath $(libdir)/$(PACKAGE)
+	-rpath $(libdir)/$(PACKAGE) \
+	-shared -module
 
 
 if DO_PCH
diff --git a/upstream/src/libcn/model-nmlio.cc b/upstream/src/libcn/model-nmlio.cc
index e7075b5..be1f74b 100644
--- a/upstream/src/libcn/model-nmlio.cc
+++ b/upstream/src/libcn/model-nmlio.cc
@@ -11,8 +11,6 @@
 #include <string>
 #include <iostream>
 
-#include <boost/regex.hpp>
-
 #include "model.hh"
 
 #include "config.h"
diff --git a/upstream/src/libstilton/Makefile.am b/upstream/src/libstilton/Makefile.am
index 9c1eafc..afe5e9c 100644
--- a/upstream/src/libstilton/Makefile.am
+++ b/upstream/src/libstilton/Makefile.am
@@ -1,5 +1,6 @@
-AM_CXXFLAGS = -Wall -std=c++0x \
-	$(LIBCN_CFLAGS) $(BOOST_CPPFLAGS)
+AM_CXXFLAGS = -Wall -fno-rtti -shared -std=c++0x \
+	$(LIBCN_CFLAGS) \
+	-I$(top_srcdir)/src
 
 pkglib_LTLIBRARIES = libstilton.la
 
@@ -14,7 +15,8 @@ libstilton_la_SOURCES = \
 
 libstilton_la_LDFLAGS = \
 	-avoid-version \
-	-rpath $(libdir)/$(PACKAGE)
+	-rpath $(libdir)/$(PACKAGE) \
+	-shared -module
 
 if DO_PCH
 BUILT_SOURCES = \
diff --git a/upstream/src/runner-interpreter.cc b/upstream/src/runner-interpreter.cc
index d25e534..ee4b895 100644
--- a/upstream/src/runner-interpreter.cc
+++ b/upstream/src/runner-interpreter.cc
@@ -10,8 +10,10 @@
 
 
 #include <sys/stat.h>
-
 #include <stdio.h>
+#include <unistd.h>
+#include <cassert>
+#include <regex.h>
 #include <list>
 #include <initializer_list>
 
@@ -29,8 +31,6 @@
 #  include <history.h>
 #  endif
 
-#include "boost/regex.hpp"
-
 #include "runner.hh"
 #include "libstilton/exprparser.hh"
 #include "libcn/integrate-rk65.hh"
@@ -86,7 +86,7 @@ list<SVariable> *current_shell_variables;
 
 
 
-inline namespace {
+namespace {
 
 void
 LOG( const char *fname, int lineno, int vrb, const char* fmt, ...)
@@ -280,13 +280,13 @@ do_single_cmd( const char* raw,
 		CHECK_MODEL;
 		if ( !operand )
 			operand = const_cast<char*>(".*");
-		boost::regex pattern( operand);
-		boost::cmatch found;
+        regex_t RE;
+        regcomp( &RE, operand, REG_EXTENDED | REG_NOSUB);
 		size_t cnt = 0;
 		for_model_units (Model,U)
-			if ( boost::regex_match( (*U)->label(), found, pattern) ) {
+			if ( regexec( &RE, (*U)->label(), 0, 0, 0) == 0 ) {
 				(*U) -> reset_state();
-				cnt++;
+				++cnt;
 			}
 		if ( cnt )
 			Log->msg( 0, nullptr, "Reset %zd unit(s)", cnt);
@@ -686,11 +686,11 @@ do_single_cmd( const char* raw,
 		if ( !operand )
 			operand = const_cast<char*>(".*");
 
-		boost::regex pattern( operand);
-		boost::cmatch found;
+        regex_t RE;
+        regcomp( &RE, operand, REG_EXTENDED | REG_NOSUB);
 		size_t cnt = 0;
 		for_model_units (Model,U)
-			if ( boost::regex_match( (*U)->label(), found, pattern) ) {
+			if ( regexec( &RE, (*U)->label(), 0, 0, 0) == 0 ) {
 				(*U) -> dump( true);
 				cnt++;
 			}
@@ -724,16 +724,16 @@ do_single_cmd( const char* raw,
 	} else if ( strcmp( cmd, cnrun_cmd[CNCMD_show_vars]) == 0 ) {
 		if ( !operand )
 			operand = const_cast<char*>(".*");
-		boost::regex pattern( operand);
-		boost::cmatch found;
+        regex_t RE;
+        regcomp( &RE, operand, REG_EXTENDED | REG_NOSUB);
 		size_t	cnt = 0;
 		size_t	longest_id = 0;
 		for ( list<SVariable>::iterator V = varlist.begin(); V != varlist.end(); V++ )
-			if ( boost::regex_match( V->name, found, pattern) )
+            if ( regexec( &RE, V->name, 0, 0, 0) == 0 )
 				if ( longest_id < strlen( V->name) )
 					longest_id = strlen( V->name);
 		for ( list<SVariable>::iterator V = varlist.begin(); V != varlist.end(); V++ )
-			if ( boost::regex_match( V->name, found, pattern) ) {
+            if ( regexec( &RE, V->name, 0, 0, 0) == 0 ) {
 				Log->msg( 0, nullptr, "  %*s = %g", longest_id, V->name, V->value);
 				cnt++;
 			}
@@ -745,10 +745,10 @@ do_single_cmd( const char* raw,
 		if ( !operand )
 			varlist.clear();
 		else {
-			boost::regex pattern( operand);
-			boost::cmatch found;
+            regex_t RE;
+            regcomp( &RE, operand, REG_EXTENDED | REG_NOSUB);
 			for ( list<SVariable>::iterator V = varlist.begin(); V != varlist.end(); V++ )
-				if ( boost::regex_match( V->name, found, pattern) ) {
+                if ( regexec( &RE, V->name, 0, 0, 0) == 0 ) {
 					varlist.erase( V);
 					break;
 				}
@@ -911,5 +911,3 @@ interpreter_run( const char *script_fname, int level, int howstrict,
 	return retval;
 }
 
-
-// EOF

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/cnrun.git



More information about the debian-med-commit mailing list