--- a/src/wscript Wed Feb 17 23:44:33 2010 -0800
+++ b/src/wscript Thu Feb 18 15:37:51 2010 +0000
@@ -83,13 +83,14 @@
def create_ns3_module(bld, name, dependencies=()):
- module = bld.new_task_gen('cxx')
+ module = bld.new_task_gen('cxx', 'cc')
module.name = 'ns3-' + name
module.target = module.name
module.add_objects = ['ns3-' + dep for dep in dependencies]
module.module_deps = list(dependencies)
if not module.env['ENABLE_STATIC_NS3']:
module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS'])
+ module.env.append_value('CCFLAGS', module.env['shlib_CXXFLAGS'])
elif module.env['CXX_NAME'] in ['gcc', 'icc'] and \
os.uname()[4] == 'x86_64' and \
module.env['ENABLE_PYTHON_BINDINGS']:
@@ -97,8 +98,10 @@
# when gcc is present and only when we want python bindings
# (it's more efficient to not use this option if we can avoid it)
module.env.append_value('CXXFLAGS', '-mcmodel=large')
+ module.env.append_value('CCFLAGS', '-mcmodel=large')
module.env.append_value('CXXDEFINES', "NS3_MODULE_COMPILATION")
+ module.env.append_value('CCDEFINES', "NS3_MODULE_COMPILATION")
return module
def create_obj(bld, *args):
--- a/wscript Wed Feb 17 23:44:33 2010 -0800
+++ b/wscript Thu Feb 18 15:37:51 2010 +0000
@@ -112,6 +112,7 @@
def set_options(opt):
# options provided by the modules
+ opt.tool_options('compiler_cc')
opt.tool_options('compiler_cxx')
opt.tool_options('cflags')
@@ -236,6 +237,7 @@
conf.env['NS3_OPTIONAL_FEATURES'] = []
conf.env['NS3_BUILDDIR'] = conf.blddir
+ conf.check_tool('compiler_cc')
conf.check_tool('compiler_cxx')
conf.check_tool('cflags')
try:
@@ -388,6 +390,10 @@
conf.env.append_value('CXXDEFINES', "ENABLE_GSL")
conf.env.append_value('CCDEFINES', "ENABLE_GSL")
+ # for compiling C code, copy over the CXX* flags
+ conf.env.append_value('CCFLAGS', conf.env['CXXFLAGS'])
+ conf.env.append_value('CCDEFINES', conf.env['CXXDEFINES'])
+
# append user defined flags after all our ones
for (confvar, envvar) in [['CCFLAGS', 'CCFLAGS_EXTRA'],
['CXXFLAGS', 'CXXFLAGS_EXTRA'],