This does not disable any other use of boost, but I think
it means that the users of pre-compiled xorp binaries
will no longer have to have boost installed on their system.

Folks wanting to compile xorp will still need at least
the template header files.

Passed build and 'scons check' on x86-64, Fedora 11.

It seems I'm the only one who really wants to get rid of the
boost dependency entirely, so we can go ahead and release
1.7 with the boost compile-time dependencies if no one
objects to this patch.

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

diff --git a/trunk/xorp/SConstruct b/trunk/xorp/SConstruct
index 0d469bc..09997df 100644
--- a/trunk/xorp/SConstruct
+++ b/trunk/xorp/SConstruct
@@ -379,7 +379,7 @@ if not env.GetOption('clean') and \
     # Additional Boost libraries
     #conf.CheckBoostLibrary('filesystem')
     #conf.CheckBoostLibrary('program_options')
-    conf.CheckBoostLibrary('regex')
+    #conf.CheckBoostLibrary('regex')
     #conf.CheckBoostLibrary('signals')
     #conf.CheckBoostLibrary('thread')
 
diff --git a/trunk/xorp/cli/SConscript b/trunk/xorp/cli/SConscript
index a854216..9deeb82 100644
--- a/trunk/xorp/cli/SConscript
+++ b/trunk/xorp/cli/SConscript
@@ -58,9 +58,9 @@ env.AppendUnique(LIBS = [
     ])
 
 # External libraries.
-env.AppendUnique(LIBS = [
-    'boost_regex'
-])
+#env.AppendUnique(LIBS = [
+#    'boost_regex'
+#])
 
 env.Replace(RPATH = [
     env.Literal(env['xorp_tool_rpath'])
diff --git a/trunk/xorp/cli/cli_command_pipe.hh 
b/trunk/xorp/cli/cli_command_pipe.hh
index d172213..6bbbb14 100644
--- a/trunk/xorp/cli/cli_command_pipe.hh
+++ b/trunk/xorp/cli/cli_command_pipe.hh
@@ -34,7 +34,16 @@
 #include <string>
 #include <list>
 
-#include <boost/regex.h>
+#ifdef HAVE_REGEX_H
+#  include <regex.h>
+#else // ! HAVE_REGEX_H
+#  ifdef HAVE_PCRE_H
+#    include <pcre.h>
+#  endif
+#  ifdef HAVE_PCREPOSIX_H
+#    include <pcreposix.h>
+#  endif
+#endif // ! HAVE_REGEX_H
 
 #include "cli_command.hh"
 
diff --git a/trunk/xorp/policy/backend/instruction.hh 
b/trunk/xorp/policy/backend/instruction.hh
index b185b82..20c4341 100644
--- a/trunk/xorp/policy/backend/instruction.hh
+++ b/trunk/xorp/policy/backend/instruction.hh
@@ -25,7 +25,16 @@
 
 #include "libxorp/xorp.h"
 
-#include <boost/cregex.hpp>
+#ifdef HAVE_REGEX_H
+#  include <regex.h>
+#else // ! HAVE_REGEX_H
+#  ifdef HAVE_PCRE_H
+#    include <pcre.h>
+#  endif
+#  ifdef HAVE_PCREPOSIX_H
+#    include <pcreposix.h>
+#  endif
+#endif // ! HAVE_REGEX_H
 
 #include "policy/common/element_base.hh"
 #include "policy/common/operator_base.hh"
diff --git a/trunk/xorp/policy/common/SConscript 
b/trunk/xorp/policy/common/SConscript
index 02558a9..2d9340a 100644
--- a/trunk/xorp/policy/common/SConscript
+++ b/trunk/xorp/policy/common/SConscript
@@ -39,9 +39,9 @@ libpcmsrcs = [
     ]
 
 # External libraries
-env.AppendUnique(LIBS = [
-    'boost_regex'
-])
+#env.AppendUnique(LIBS = [
+#    'boost_regex'
+#])
 
 is_shared = env.has_key('SHAREDLIBS')
 
diff --git a/trunk/xorp/policy/common/policy_utils.cc 
b/trunk/xorp/policy/common/policy_utils.cc
index 7a45091..2aa23ed 100644
--- a/trunk/xorp/policy/common/policy_utils.cc
+++ b/trunk/xorp/policy/common/policy_utils.cc
@@ -22,7 +22,16 @@
 
 #include "libxorp/xorp.h"
 
-#include <boost/regex.h>
+#ifdef HAVE_REGEX_H
+#  include <regex.h>
+#else // ! HAVE_REGEX_H
+#  ifdef HAVE_PCRE_H
+#    include <pcre.h>
+#  endif
+#  ifdef HAVE_PCREPOSIX_H
+#    include <pcreposix.h>
+#  endif
+#endif // ! HAVE_REGEX_H
 
 #include "policy_utils.hh"
 
diff --git a/trunk/xorp/site_scons/config/allconfig.py 
b/trunk/xorp/site_scons/config/allconfig.py
index 917e640..0725bda 100644
--- a/trunk/xorp/site_scons/config/allconfig.py
+++ b/trunk/xorp/site_scons/config/allconfig.py
@@ -83,10 +83,10 @@ def DoAllConfig(env, conf, host_os):
     has_pwd_h = conf.CheckHeader('pwd.h')
     has_mqueue_h = conf.CheckHeader('mqueue.h')
 
-    #prereq_regex_h = []
-    #if has_sys_types_h:
-    #  prereq_regex_h.append('sys/types.h')
-    #has_regex_h = conf.CheckHeader(prereq_regex_h + ['regex.h'])
+    prereq_regex_h = []
+    if has_sys_types_h:
+       prereq_regex_h.append('sys/types.h')
+    has_regex_h = conf.CheckHeader(prereq_regex_h + ['regex.h'])
 
     has_syslog_h = conf.CheckHeader('syslog.h')
     has_termios_h = conf.CheckHeader('termios.h')
@@ -660,10 +660,10 @@ def DoAllConfig(env, conf, host_os):
     ##########
     # pcre posix regexp emulation
     # used by policy for regexps.
-    #has_pcre_h = conf.CheckHeader('pcre.h')
-    #has_pcreposix_h = conf.CheckHeader('pcreposix.h')
-    #has_libpcre = conf.CheckLib('pcre')
-    #has_libpcreposix = conf.CheckLib('pcreposix')
+    has_pcre_h = conf.CheckHeader('pcre.h')
+    has_pcreposix_h = conf.CheckHeader('pcreposix.h')
+    has_libpcre = conf.CheckLib('pcre')
+    has_libpcreposix = conf.CheckLib('pcreposix')
     
     ##########
     # openssl for md5
_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers

Reply via email to