Skip to content

Commit fe06091

Browse files
committed
Put preprocessor defines into CPPFLAGS not compile flags...
1 parent 3a64c22 commit fe06091

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

wscript

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def configure(conf):
169169
args='--cflags --libs',
170170
uselib_store='OPENSSL'):
171171
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
172-
conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
172+
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
173173
else:
174174
libssl = conf.check_cc(lib='ssl',
175175
header_name='openssl/ssl.h',
@@ -181,7 +181,7 @@ def configure(conf):
181181
uselib_store='OPENSSL')
182182
if libcrypto and libssl:
183183
conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
184-
conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
184+
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
185185
else:
186186
conf.fatal("Could not autodetect OpenSSL support. " +
187187
"Make sure OpenSSL development packages are installed. " +
@@ -266,13 +266,11 @@ def configure(conf):
266266
# used by platform_darwin_*.cc
267267
conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
268268

269-
conf.env.append_value("CCFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
270-
269+
# Needed for getaddrinfo in libeio
270+
conf.env.append_value("CPPFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
271271
# LFS
272-
conf.env.append_value('CCFLAGS', '-D_LARGEFILE_SOURCE')
273-
conf.env.append_value('CXXFLAGS', '-D_LARGEFILE_SOURCE')
274-
conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
275-
conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
272+
conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
273+
conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
276274

277275
## needed for node_file.cc fdatasync
278276
## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
@@ -286,14 +284,12 @@ def configure(conf):
286284
}
287285
"""
288286
if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
289-
conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=1')
287+
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=1')
290288
else:
291-
conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=0')
289+
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
292290

293291
# platform
294-
platform_def = '-DPLATFORM="' + conf.env['DEST_OS'] + '"'
295-
conf.env.append_value('CCFLAGS', platform_def)
296-
conf.env.append_value('CXXFLAGS', platform_def)
292+
conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
297293

298294
# Split off debug variant before adding variant specific defines
299295
debug_env = conf.env.copy()
@@ -302,14 +298,18 @@ def configure(conf):
302298
# Configure debug variant
303299
conf.setenv('debug')
304300
debug_env.set_variant('debug')
305-
debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
306-
debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
301+
debug_env.append_value('CPPFLAGS', '-DDEBUG')
302+
debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
303+
debug_env.append_value('CCFLAGS', debug_compile_flags)
304+
debug_env.append_value('CXXFLAGS', debug_compile_flags)
307305
conf.write_config_header("config.h")
308306

309307
# Configure default variant
310308
conf.setenv('default')
311-
conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-g', '-O3'])
312-
conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-g', '-O3'])
309+
conf.env.append_value('CPPFLAGS', '-DNDEBUG')
310+
default_compile_flags = ['-g', '-O3']
311+
conf.env.append_value('CCFLAGS', default_compile_flags)
312+
conf.env.append_value('CXXFLAGS', default_compile_flags)
313313
conf.write_config_header("config.h")
314314

315315

0 commit comments

Comments
 (0)