- ) % ({
- 'ns3_version': self.get("ns3Version"),
- 'pybindgen_version': self.get("pybindgenVersion"),
- 'pygccxml_version': self.pygccxml_version,
- 'copy_ns3_cmd': copy_ns3_cmd,
- })
+ ") "
+ " && "
+ "( "
+ " %(clone_dce_cmd)s "
+ ") "
+ ) % {
+ "ns3_src": self.ns3_src_location,
+ "pybindgen_version": self.get("pybindgenVersion"),
+ "pygccxml_version": self.pygccxml_version,
+ "clone_ns3_cmd": clone_ns3_cmd,
+ "clone_dce_cmd": clone_dce_cmd,
+ }
+
+ return ns3_build_cmd
+
+ @property
+ def _install_dce_command(self):
+ install_dce_cmd = " echo 'DCE will not be installed'"
+
+ if self.enable_dce:
+ install_dce_cmd = (
+ " ( "
+ " ((test -d %(ns3_build)s/bin_dce ) && "
+ " echo 'dce binaries found, nothing to do' )"
+ " ) "
+ " ||"
+ " ( "
+ # If not, copy build to dce
+ " cd %(dce_src)s && "
+ " rm -rf %(dce_src)s/build && "
+ " ./waf configure %(enable_opt)s --with-pybindgen=${SRC}/pybindgen/%(pybindgen_version)s "
+ " --prefix=%(ns3_build)s --with-ns3=%(ns3_build)s && "
+ " ./waf build && "
+ " ./waf install && "
+ " [ ! -e %(ns3_build)s/lib/python/site-packages/ns/dce.so ] && "
+ " mv %(ns3_build)s/lib*/python*/site-packages/ns/dce.so %(ns3_build)s/lib/python/site-packages/ns/ "
+ " )"
+ ) % {
+ "pybindgen_version": self.get("pybindgenVersion"),
+ "enable_opt": "--enable-opt" if self.get("buildMode") == "optimized" else "",
+ "ns3_build": self.ns3_build_location,
+ "dce_src": self.dce_src_location,
+ }
+
+ return install_dce_cmd