Build as c++11, statically linking in libstdc++ and libgcc into

mod_pagespeed.so unless 'use system libs' flag is set. This cl does not
include flag tweaks for clang.
This commit is contained in:
Maks Orlovich
2015-12-14 13:31:12 -05:00
parent 0e8b7d05d4
commit 1369628d8a
+15 -23
View File
@@ -67,6 +67,10 @@
'pagespeed_overrides.gypi',
],
'target_defaults': {
'variables': {
# Make this available here as well.
'use_system_libs%': 0,
},
'conditions': [
['support_posix_shared_mem == 1', {
'defines': [ 'PAGESPEED_SUPPORT_POSIX_SHARED_MEM', ],
@@ -80,26 +84,8 @@
'<(gcc_version) != <(gcc_devel_version2)', {
'cflags!': ['-Werror']
}],
# Newer Chromium common.gypi adds -Wno-unused-but-set-variable
# (unconditionally). This is wrong for gcc < 4.6, since the flag
# was added in 4.6, but very much needed for >= 4.6 since
# otherwise ICU headers don't build with -Werror.
#
# At the moment, we need to support both building with gcc < 4.6
# and building with old Chromium --- so we remove the flag for
# < 4.6 gcc, and add it for newer versions.
# TODO(morlovich): Upstream, but how high?
['<(gcc_version) < 46', {
'cflags!': ['-Wno-unused-but-set-variable']
}, {
'cflags+': ['-Wno-unused-but-set-variable']
}],
# Similarly, there is no -Wno-unused-result for gcc < 4.5
['<(gcc_version) < 45', {
'cflags!': ['-Wno-unused-result']
}],
['<(gcc_version) == 46', {
'cflags+': ['-Wno-sign-compare']
['<(gcc_version) < 48 and (clang == 0)', {
'cflags+': '<!(echo gcc \< 4.8 is too old and no longer supported; false)'
}],
],
'cflags': [
@@ -110,6 +96,8 @@
'-fasynchronous-unwind-tables',
# We'd like to add '-Wtype-limits', but this does not work on
# earlier versions of g++ on supported operating systems.
'-Wno-unused-but-set-variable',
],
'cflags_cc!': [
# Newer Chromium build adds -Wsign-compare which we have some
@@ -151,15 +139,19 @@
'OTHER_CFLAGS': ['-funsigned-char', '-Wno-error'],
},
}],
['use_system_libs == 0', {
'ldflags+': [
'-static-libstdc++',
'-static-libgcc',
]
}],
],
'defines': [ 'CHROMIUM_REVISION=<(chromium_revision)',
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
'_GLIBCXX_USE_CXX11_ABI=0' ],
# We don't want -std=gnu++0x (enabled by some versions of libpagespeed)
# since it can cause binary compatibility problems; see issue 453.
'cflags!': [
'cflags_cc+': [
'-std=gnu++0x'
],