add boost check and update doc default tip
authorJosh Pelkey <jpelkey@gatech.edu>
Fri, 11 Mar 2011 11:47:59 -0500
changeset 6884 2bde215aefc8
parent 6883 0a484ae7fcf7
add boost check and update doc
src/openflow/doc/openflow-switch.h
src/openflow/wscript
--- a/src/openflow/doc/openflow-switch.h	Thu Mar 10 13:49:41 2011 -0500
+++ b/src/openflow/doc/openflow-switch.h	Fri Mar 11 11:47:59 2011 -0500
@@ -115,15 +115,16 @@
  * To do this:
  *
  * #1 Obtain the OFSID code. An ns-3 specific OFSID branch is provided 
- *    to ensure operation with ns-3. Use mercurial to download this 
- *    branch and waf to build the library:
+ *    to ensure operation with ns-3. The OFSID has several dependencies 
+ *    include libxml2, libdl, and the boost libraries. Use mercurial to 
+ *    download this branch and waf to build the library:
  *
  * $ hg clone http://code.nsnam.org/bhurd/openflow
  * $ cd openflow
  * $ ./waf configure
  * $ ./waf build
  *
- * #2 Your OFSID is now built into a libopenflow.so library! To
+ * #2 Your OFSID is now built into a libopenflow.a library! To
  * link to an ns-3 build with this switch module, run from the ns-3-dev
  * (or whatever you have named your distribution):
  *
--- a/src/openflow/wscript	Thu Mar 10 13:49:41 2011 -0500
+++ b/src/openflow/wscript	Fri Mar 11 11:47:59 2011 -0500
@@ -6,21 +6,32 @@
 def set_options(opt):
     opt.add_option('--with-openflow',
 		   help=('Path to OFSID source for NS-3 OpenFlow Integration support'),
-		   dest='with_openflow', default=None) 
+		   default='', dest='with_openflow') 
 
 def configure(conf):
+    conf.check_tool('boost')
+    conf.env['BOOST'] = conf.check_boost(lib = 'signals filesystem',
+                                         kind = 'STATIC_BOTH',
+                                         score_version = (-1000, 1000),
+                                         tag_minscore = 1000,)
+
+    if not conf.env['BOOST']:
+	conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False,
+				     "Required boost libraries not found")
+	return 
+
     if Options.options.with_openflow:
 	if os.path.isdir(Options.options.with_openflow):
-	    conf.check_message("libopenflow.a location", '', True, ("%s (given)" % Options.options.with_openflow))
+	    conf.check_message("OpenFlow location", '', True, ("%s (given)" % Options.options.with_openflow))
 	    conf.env['WITH_OPENFLOW'] = os.path.abspath(Options.options.with_openflow)
-	else:
-	    openflow_dir = os.path.join('..','openflow')
-	    if os.path.isdir(openflow_dir):
-		conf.check_message("openflow location", '', True, ("%s (guessed)" % openflow_dir))
-		conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_dir)
-	    del openflow_dir
+    else:
+        openflow_dir = os.path.join('..','openflow')
+        if os.path.isdir(openflow_dir):
+            conf.check_message("OpenFlow location", '', True, ("%s (guessed)" % openflow_dir))
+	    conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_dir)
+	del openflow_dir
     if not conf.env['WITH_OPENFLOW']:
-	conf.check_message("openflow location", '', False)
+	conf.check_message("OpenFlow location", '', False)
 	conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False,
 				     "OpenFlow not enabled (see option --with-openflow)")
 	return 
@@ -89,6 +100,7 @@
     conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration",
     conf.env['OPENFLOW'], "openflow library not found")
     if conf.env['OPENFLOW']:
+        conf.env['ENABLE_OPENFLOW'] = True
 	conf.env.append_value('CXXDEFINES', 'NS3_OPENFLOW')
 	conf.env.append_value('CPPPATH', conf.env['CPPPATH_OPENFLOW']) 
 
@@ -96,10 +108,6 @@
     # Build the Switch module
     obj = bld.create_ns3_module('openflow', ['internet'])
     obj.source = [
-	'model/openflow-interface.cc',
-        'model/openflow-switch-net-device.cc',
-	'helper/openflow-switch-helper.cc',
-	'test/openflow-switch-test-suite.cc',
         ]
 
     if bld.env['OPENFLOW'] and bld.env['DL'] and bld.env['XML2']:
@@ -108,10 +116,16 @@
     headers = bld.new_task_gen('ns3header')
     headers.module = 'openflow'
     headers.source = [
-	'model/openflow-interface.h',
-        'model/openflow-switch-net-device.h',
-	'helper/openflow-switch-helper.h',
         ]
 
-    if bld.env['ENABLE_EXAMPLES'] and bld.env['OPENFLOW']:
+    if bld.env['ENABLE_OPENFLOW']:
+	obj.source.append('model/openflow-interface.cc')
+        obj.source.append('model/openflow-switch-net-device.cc')
+	obj.source.append('helper/openflow-switch-helper.cc')
+	obj.source.append('test/openflow-switch-test-suite.cc')
+	headers.source.append('model/openflow-interface.h')
+        headers.source.append('model/openflow-switch-net-device.h')
+	headers.source.append('helper/openflow-switch-helper.h')
+
+    if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_OPENFLOW']:
         bld.add_subdirs('examples')