build: Updating Waf 1.8.19 to 2.0.9

*) Platform was no longer recognized as a attribute of Options.  Used waf
Utils call to obtain unversioned platform name.

*) Task classes renamed from <taskname>_task to <taskname>.

Waf was not finding the classes when named with _task suffix.

*) Waf removed check option for 'type_name' check.

Added explicit embedded code snippet based on previous Waf versions to perform uint128 checks.

*) Waf source attribute is now strings, need to convert to nodes to retrieve parent node.

# Orig 1.8.19 testdir = self.source[-1].parent.path_from(self.bld.srcnode)
testdir = self.to_nodes(self.source[-1])[0].parent.path_from(self.bld.srcnode)
This commit is contained in:
Steve Smith
2018-08-24 18:02:14 -07:00
parent 36bd5763cc
commit 12a3af0e02
7 changed files with 58 additions and 35 deletions

View File

@@ -103,6 +103,7 @@ or with a string value with 'b' (bytes) or 'p' (packets) suffix, such as:
/ul> /ul>
<h2>Changes to build system:</h2> <h2>Changes to build system:</h2>
<ul> <ul>
<li>Waf upgraded from 1.8.19 to 2.0.9, and ns-3 build scripts aligned to the new API.</li>
<li>The '--no32bit-scan' argument is removed from Waf apiscan; generation of ILP32 bindings is now automated from the LP64 bindings.</li> <li>The '--no32bit-scan' argument is removed from Waf apiscan; generation of ILP32 bindings is now automated from the LP64 bindings.</li>
<li> When using on newer compilers, new warnings may trigger build failures. <li> When using on newer compilers, new warnings may trigger build failures.
The --disable-werror flag can be passed to Waf at configuration time to turn The --disable-werror flag can be passed to Waf at configuration time to turn

View File

@@ -24,14 +24,13 @@ requirements (Note: not all features available on all platforms):
- Apple LLVM version 7.0.2 or later - Apple LLVM version 7.0.2 or later
- clang-3.3 or later - clang-3.3 or later
In addition, Python 2.7 (Python 2 series) or Python 3.4-3.6 (Python 3 series) In addition, Python 2.7 (Python 2 series) or Python 3.4-3.7 (Python 3 series)
- Note: Python 3.7 is not yet supported
This release has been tested on the following platforms: This release has been tested on the following platforms:
- Ubuntu 18.04 (64 bit) with g++-7.3.0 and Python 2.7.15 - Ubuntu 18.04 (64 bit) with g++-7.3.0 and Python 2.7.15
- Ubuntu 16.04 (64 bit) with g++-5.4.0 and Python 2.7.12 - Ubuntu 16.04 (64 bit) with g++-5.4.0 and Python 2.7.12/3.5.2
- Fedora Core 28 (64 bit) with g++-8.1.1 and Python 2.7.15 - Fedora Core 28 (64 bit) with g++-8.1.1 and Python 2.7.15/3.7.0
- Fedora Core 26 (64 bit) with g++-7.3.1 and g++-7.1.1, and Python 2.7.14 - Fedora Core 26 (64 bit) with g++-7.3.1 and Python 2.7.14/3.6.5
- macOS High Sierra 10.13.5 with Xcode 9.4.1, Apple LLVM version 9.1.0, Python 2.7.10 - macOS High Sierra 10.13.5 with Xcode 9.4.1, Apple LLVM version 9.1.0, Python 2.7.10
New user-visible features New user-visible features

View File

@@ -1,7 +1,7 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import sys import sys
from waflib import Options from waflib import Options, Utils
import wutils import wutils
int64x64 = { int64x64 = {
@@ -46,10 +46,34 @@ def options(opt):
def configure(conf): def configure(conf):
int64x64_impl = Options.options.int64x64_impl int64x64_impl = Options.options.int64x64_impl
if int64x64_impl == 'default' or int64x64_impl == 'int128': if int64x64_impl == 'default' or int64x64_impl == 'int128':
have_uint128 = conf.check_nonfatal(type_name='uint128_t',
define_name='HAVE_UINT128_T') code_snip_type='''
have__uint128 = conf.check_nonfatal(type_name='__uint128_t', #include <stdint.h>
define_name='HAVE___UINT128_T')
int main(int argc, char **argv) {
(void)argc; (void)argv;
if ((uint128_t *) 0) return 0;
if (sizeof (uint128_t)) return 0;
return 1;
}
'''
have_uint128 = conf.check_nonfatal(msg='checking for uint128_t',
define_name='HAVE_UINT128_T',
code=code_snip_type)
code_snip_type='''
#include <stdint.h>
int main(int argc, char **argv) {
(void)argc; (void)argv;
if ((__uint128_t *) 0) return 0;
if (sizeof (__uint128_t)) return 0;
return 1;
}
'''
have__uint128 = conf.check_nonfatal(msg='checking for __uint128_t',
define_name='HAVE___UINT128_T',
code=code_snip_type)
if have_uint128 or have__uint128: if have_uint128 or have__uint128:
int64x64_impl = 'int128' int64x64_impl = 'int128'
else: else:
@@ -78,7 +102,7 @@ def configure(conf):
# Check for POSIX threads # Check for POSIX threads
test_env = conf.env.derive() test_env = conf.env.derive()
if Options.platform != 'darwin' and Options.platform != 'cygwin': if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
test_env.append_value('LINKFLAGS', '-pthread') test_env.append_value('LINKFLAGS', '-pthread')
test_env.append_value('CXXFLAGS', '-pthread') test_env.append_value('CXXFLAGS', '-pthread')
test_env.append_value('CCFLAGS', '-pthread') test_env.append_value('CCFLAGS', '-pthread')
@@ -102,7 +126,7 @@ int main ()
errmsg='Could not find pthread support (build/config.log for details)') errmsg='Could not find pthread support (build/config.log for details)')
if have_pthread: if have_pthread:
# darwin accepts -pthread but prints a warning saying it is ignored # darwin accepts -pthread but prints a warning saying it is ignored
if Options.platform != 'darwin' and Options.platform != 'cygwin': if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
conf.env['CXXFLAGS_PTHREAD'] = '-pthread' conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
conf.env['CCFLAGS_PTHREAD'] = '-pthread' conf.env['CCFLAGS_PTHREAD'] = '-pthread'
conf.env['LINKFLAGS_PTHREAD'] = '-pthread' conf.env['LINKFLAGS_PTHREAD'] = '-pthread'

View File

@@ -147,7 +147,7 @@ def create_ns3_module(bld, name, dependencies=(), test=False):
def apply_incpaths_ns3testlib(self): def apply_incpaths_ns3testlib(self):
if not self.source: if not self.source:
return return
testdir = self.source[-1].parent.path_from(self.bld.srcnode) testdir = self.to_nodes(self.source[-1])[0].parent.path_from(self.bld.srcnode)
self.env.append_value("DEFINES", 'NS_TEST_SOURCEDIR="%s"' % (testdir,)) self.env.append_value("DEFINES", 'NS_TEST_SOURCEDIR="%s"' % (testdir,))
@@ -287,7 +287,7 @@ def ns3_python_bindings(bld):
pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive') pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
defines = list(pymod.env['DEFINES']) defines = list(pymod.env['DEFINES'])
defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H']) defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
if Options.platform == 'win32': if Utils.unversioned_sys_platform()== 'win32':
try: try:
defines.remove('_DEBUG') # causes undefined symbols on win32 defines.remove('_DEBUG') # causes undefined symbols on win32
except ValueError: except ValueError:
@@ -330,7 +330,7 @@ def build(bld):
modheader = bld(features='ns3moduleheader') modheader = bld(features='ns3moduleheader')
modheader.module = module.split('/')[-1] modheader.module = module.split('/')[-1]
class ns3pcfile_task(Task.Task): class ns3pcfile(Task.Task):
after = 'cxx' after = 'cxx'
def __str__(self): def __str__(self):
@@ -339,7 +339,7 @@ class ns3pcfile_task(Task.Task):
return 'pcfile: %s' % (tgt_str) return 'pcfile: %s' % (tgt_str)
def runnable_status(self): def runnable_status(self):
return super(ns3pcfile_task, self).runnable_status() return super(ns3pcfile, self).runnable_status()
def _self_libs(self, env, name, libdir): def _self_libs(self, env, name, libdir):
if env['ENABLE_STATIC_NS3']: if env['ENABLE_STATIC_NS3']:
@@ -470,7 +470,7 @@ def apply_ns3header(self):
self.source = '' # tell WAF not to process these files further self.source = '' # tell WAF not to process these files further
class ns3header_task(Task.Task): class ns3header(Task.Task):
before = 'cxx gen_ns3_module_header' before = 'cxx gen_ns3_module_header'
color = 'BLUE' color = 'BLUE'
@@ -510,7 +510,7 @@ class ns3header_task(Task.Task):
else: else:
return Task.SKIP_ME return Task.SKIP_ME
else: else:
return super(ns3header_task, self).runnable_status() return super(ns3header, self).runnable_status()
def run(self): def run(self):
if self.mode == 'install': if self.mode == 'install':
@@ -561,7 +561,7 @@ def apply_ns3privateheader(self):
self.headers = set(self.to_list(self.source)) self.headers = set(self.to_list(self.source))
self.source = '' # tell WAF not to process these files further self.source = '' # tell WAF not to process these files further
class ns3privateheader_task(Task.Task): class ns3privateheader(Task.Task):
before = 'cxx gen_ns3_module_header' before = 'cxx gen_ns3_module_header'
after = 'ns3header' after = 'ns3header'
color = 'BLUE' color = 'BLUE'
@@ -602,7 +602,7 @@ class ns3privateheader_task(Task.Task):
else: else:
return Task.SKIP_ME return Task.SKIP_ME
else: else:
return super(ns3privateheader_task, self).runnable_status() return super(ns3privateheader, self).runnable_status()
def run(self): def run(self):
if self.mode == 'install': if self.mode == 'install':
@@ -631,7 +631,7 @@ class ns3privateheader_task(Task.Task):
return 0 return 0
class gen_ns3_module_header_task(Task.Task): class gen_ns3_module_header(Task.Task):
before = 'cxx' before = 'cxx'
after = 'ns3header' after = 'ns3header'
color = 'BLUE' color = 'BLUE'
@@ -643,7 +643,7 @@ class gen_ns3_module_header_task(Task.Task):
else: else:
return Task.SKIP_ME return Task.SKIP_ME
else: else:
return super(gen_ns3_module_header_task, self).runnable_status() return super(gen_ns3_module_header, self).runnable_status()
def __str__(self): def __str__(self):
"string to display to the user" "string to display to the user"

21
waf vendored

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ shellcmd.debug = debug
arg_rx = re.compile(r"(?P<dollar>\$\$)|(?P<subst>\$\{(?P<var>\w+)(?P<code>.*?)\})", re.M) arg_rx = re.compile(r"(?P<dollar>\$\$)|(?P<subst>\$\{(?P<var>\w+)(?P<code>.*?)\})", re.M)
class command_task(Task.Task): class command(Task.Task):
color = "BLUE" color = "BLUE"
def __init__(self, env, generator): def __init__(self, env, generator):
Task.Task.__init__(self, env=env, normal=1, generator=generator) Task.Task.__init__(self, env=env, normal=1, generator=generator)

View File

@@ -417,7 +417,7 @@ def configure(conf):
if libstdcxx_location: if libstdcxx_location:
conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location) conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location)
if Options.platform in ['linux']: if Utils.unversioned_sys_platform() in ['linux']:
if conf.check_compilation_flag('-Wl,--soname=foo'): if conf.check_compilation_flag('-Wl,--soname=foo'):
env['WL_SONAME_SUPPORTED'] = True env['WL_SONAME_SUPPORTED'] = True