Put preprocessor defines into CPPFLAGS not compile flags...
This commit is contained in:
parent
3a64c22cc1
commit
fe060916ec
34
wscript
34
wscript
@ -169,7 +169,7 @@ def configure(conf):
|
|||||||
args='--cflags --libs',
|
args='--cflags --libs',
|
||||||
uselib_store='OPENSSL'):
|
uselib_store='OPENSSL'):
|
||||||
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
|
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
|
||||||
conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
|
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
|
||||||
else:
|
else:
|
||||||
libssl = conf.check_cc(lib='ssl',
|
libssl = conf.check_cc(lib='ssl',
|
||||||
header_name='openssl/ssl.h',
|
header_name='openssl/ssl.h',
|
||||||
@ -181,7 +181,7 @@ def configure(conf):
|
|||||||
uselib_store='OPENSSL')
|
uselib_store='OPENSSL')
|
||||||
if libcrypto and libssl:
|
if libcrypto and libssl:
|
||||||
conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
|
conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
|
||||||
conf.env.append_value("CXXFLAGS", "-DHAVE_OPENSSL=1")
|
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
|
||||||
else:
|
else:
|
||||||
conf.fatal("Could not autodetect OpenSSL support. " +
|
conf.fatal("Could not autodetect OpenSSL support. " +
|
||||||
"Make sure OpenSSL development packages are installed. " +
|
"Make sure OpenSSL development packages are installed. " +
|
||||||
@ -266,13 +266,11 @@ def configure(conf):
|
|||||||
# used by platform_darwin_*.cc
|
# used by platform_darwin_*.cc
|
||||||
conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
|
conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
|
||||||
|
|
||||||
conf.env.append_value("CCFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
|
# Needed for getaddrinfo in libeio
|
||||||
|
conf.env.append_value("CPPFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
|
||||||
# LFS
|
# LFS
|
||||||
conf.env.append_value('CCFLAGS', '-D_LARGEFILE_SOURCE')
|
conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
|
||||||
conf.env.append_value('CXXFLAGS', '-D_LARGEFILE_SOURCE')
|
conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
|
||||||
conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
|
|
||||||
conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
|
|
||||||
|
|
||||||
## needed for node_file.cc fdatasync
|
## needed for node_file.cc fdatasync
|
||||||
## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
|
## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
|
||||||
@ -286,14 +284,12 @@ def configure(conf):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
|
if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
|
||||||
conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=1')
|
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=1')
|
||||||
else:
|
else:
|
||||||
conf.env.append_value('CXXFLAGS', '-DHAVE_FDATASYNC=0')
|
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
|
||||||
|
|
||||||
# platform
|
# platform
|
||||||
platform_def = '-DPLATFORM="' + conf.env['DEST_OS'] + '"'
|
conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
|
||||||
conf.env.append_value('CCFLAGS', platform_def)
|
|
||||||
conf.env.append_value('CXXFLAGS', platform_def)
|
|
||||||
|
|
||||||
# Split off debug variant before adding variant specific defines
|
# Split off debug variant before adding variant specific defines
|
||||||
debug_env = conf.env.copy()
|
debug_env = conf.env.copy()
|
||||||
@ -302,14 +298,18 @@ def configure(conf):
|
|||||||
# Configure debug variant
|
# Configure debug variant
|
||||||
conf.setenv('debug')
|
conf.setenv('debug')
|
||||||
debug_env.set_variant('debug')
|
debug_env.set_variant('debug')
|
||||||
debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
|
debug_env.append_value('CPPFLAGS', '-DDEBUG')
|
||||||
debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
|
debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
|
||||||
|
debug_env.append_value('CCFLAGS', debug_compile_flags)
|
||||||
|
debug_env.append_value('CXXFLAGS', debug_compile_flags)
|
||||||
conf.write_config_header("config.h")
|
conf.write_config_header("config.h")
|
||||||
|
|
||||||
# Configure default variant
|
# Configure default variant
|
||||||
conf.setenv('default')
|
conf.setenv('default')
|
||||||
conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-g', '-O3'])
|
conf.env.append_value('CPPFLAGS', '-DNDEBUG')
|
||||||
conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-g', '-O3'])
|
default_compile_flags = ['-g', '-O3']
|
||||||
|
conf.env.append_value('CCFLAGS', default_compile_flags)
|
||||||
|
conf.env.append_value('CXXFLAGS', default_compile_flags)
|
||||||
conf.write_config_header("config.h")
|
conf.write_config_header("config.h")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user