Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Put preprocessor defines into CPPFLAGS not compile flags...
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Oct 1, 2010
1 parent 1165878 commit 55aa7b1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions wscript
Expand Up @@ -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',
Expand All @@ -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. " +
Expand Down Expand Up @@ -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?
Expand All @@ -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()
Expand All @@ -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")




Expand Down

0 comments on commit 55aa7b1

Please sign in to comment.