Help waf to guess release versions of nsc and pybindgen
authorTom Henderson <tomh@tomh.org>
Fri, 20 Aug 2010 12:17:19 -0700
changeset 6626 9c325569fb01
parent 6625 a1ed37e031bc
child 6627 fa5cf8df4d8f
Help waf to guess release versions of nsc and pybindgen
bindings/python/wscript
src/internet-stack/wscript
--- a/bindings/python/wscript	Fri Aug 20 08:24:29 2010 -0700
+++ b/bindings/python/wscript	Fri Aug 20 12:17:19 2010 -0700
@@ -107,11 +107,18 @@
             conf.check_message("pybindgen location", '', True, ("%s (given)" % Options.options.with_pybindgen))
             conf.env['WITH_PYBINDGEN'] = os.path.abspath(Options.options.with_pybindgen)
     else:
+        # ns-3-dev uses ../pybindgen, while ns-3 releases use ../REQUIRED_PYBINDGEN_VERSION
         pybindgen_dir = os.path.join('..', "pybindgen")
+        pybindgen_release_str = "pybindgen-" + '.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION])
+        pybindgen_release_dir = os.path.join('..', pybindgen_release_str)
         if os.path.isdir(pybindgen_dir):
             conf.check_message("pybindgen location", '', True, ("%s (guessed)" % pybindgen_dir))
             conf.env['WITH_PYBINDGEN'] = os.path.abspath(pybindgen_dir)
+        elif os.path.isdir(pybindgen_release_dir):
+            conf.check_message("pybindgen location", '', True, ("%s (guessed)" % pybindgen_release_dir))
+            conf.env['WITH_PYBINDGEN'] = os.path.abspath(pybindgen_release_dir)
         del pybindgen_dir
+        del pybindgen_release_dir
     if not conf.env['WITH_PYBINDGEN']:
         conf.check_message("pybindgen location", '', False)
 
--- a/src/internet-stack/wscript	Fri Aug 20 08:24:29 2010 -0700
+++ b/src/internet-stack/wscript	Fri Aug 20 12:17:19 2010 -0700
@@ -35,11 +35,17 @@
             conf.check_message("NSC location", '', True, ("%s (given)" % Options.options.with_nsc))
             conf.env['WITH_NSC'] = os.path.abspath(Options.options.with_nsc)
     else:
+        # ns-3-dev uses ../nsc, while ns-3 releases use ../NSC_RELEASE_NAME
         nsc_dir = os.path.join('..', "nsc")
+        nsc_release_dir = os.path.join('..', NSC_RELEASE_NAME)
         if os.path.isdir(nsc_dir):
             conf.check_message("NSC location", '', True, ("%s (guessed)" % nsc_dir))
             conf.env['WITH_NSC'] = os.path.abspath(nsc_dir)
+        elif os.path.isdir(nsc_release_dir):
+            conf.check_message("NSC location", '', True, ("%s (guessed)" % nsc_release_dir))
+            conf.env['WITH_NSC'] = os.path.abspath(nsc_release_dir)
         del nsc_dir
+        del nsc_release_dir
     if not conf.env['WITH_NSC']:
         conf.check_message("NSC location", '', False)
         conf.report_optional_feature("nsc", "Network Simulation Cradle", False,