diff options
author | Ben Murdoch <benm@google.com> | 2010-07-29 17:14:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-04 14:29:45 +0100 |
commit | c407dc5cd9bdc5668497f21b26b09d988ab439de (patch) | |
tree | 7eaf8707c0309516bdb042ad976feedaf72b0bb1 /build | |
parent | 0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff) | |
download | external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2 |
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'build')
69 files changed, 8522 insertions, 3 deletions
diff --git a/build/All.scons b/build/All.scons new file mode 100644 index 0000000..dc7e7db --- /dev/null +++ b/build/All.scons @@ -0,0 +1,898 @@ +# This file is generated; do not edit. + +import os + +Import("env") + +env = env.Clone(COMPONENT_NAME='all', + TARGET_NAME='All') + +configurations = { + 'Release' : { + 'Append' : dict( + CCFLAGS = [ + '-pthread', + '-fno-exceptions', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-pthread', + '-D_REENTRANT', + '-I/usr/include/gtk-2.0', + '-I/usr/lib/gtk-2.0/include', + '-I/usr/include/atk-1.0', + '-I/usr/include/cairo', + '-I/usr/include/pango-1.0', + '-I/usr/include/gio-unix-2.0/', + '-I/usr/include/glib-2.0', + '-I/usr/lib/glib-2.0/include', + '-I/usr/include/pixman-1', + '-I/usr/include/freetype2', + '-I/usr/include/directfb', + '-I/usr/include/libpng12', + '-I/usr/include/libpng12', + '-O2', + '-fno-ident', + '-fdata-sections', + '-ffunction-sections', + '-fno-asynchronous-unwind-tables' + ], + CPPDEFINES = [ + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'GLEW_STATIC', + 'GL_GLEXT_PROTOTYPES', + 'PERF_TEST', + 'GOOGLE_PROTOBUF_NO_RTTI', + 'CLD_WINDOWS', + '__OMX_EXPORTS', + 'UNIT_TEST', + 'GTEST_HAS_RTTI=0', + 'USE_SYSTEM_LIBBZ2', + 'COMPILER_GCC', + '__STDC_CONSTANT_MACROS', + 'U_STATIC_IMPLEMENTATION', + 'USE_SYSTEM_LIBJPEG', + 'USE_SYSTEM_LIBPNG', + 'LIBXML_STATIC', + 'LIBXSLT_STATIC', + '_LZMA_IN_CB', + 'USE_SYSTEM_ZLIB', + 'ENABLE_3D_CANVAS=1', + 'ENABLE_CHANNEL_MESSAGING=1', + 'ENABLE_DATABASE=1', + 'ENABLE_DATAGRID=0', + 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', + 'ENABLE_DASHBOARD_SUPPORT=0', + 'ENABLE_DOM_STORAGE=1', + 'ENABLE_INDEXED_DATABASE=1', + 'ENABLE_FILTERS=1', + 'ENABLE_GEOLOCATION=1', + 'ENABLE_JAVASCRIPT_DEBUGGER=0', + 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_ICONDATABASE=0', + 'ENABLE_NOTIFICATIONS=1', + 'ENABLE_OPENTYPE_SANITIZER=1', + 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_XSLT=1', + 'ENABLE_XPATH=1', + 'ENABLE_SHARED_WORKERS=1', + 'ENABLE_SVG=1', + 'ENABLE_SVG_ANIMATION=1', + 'ENABLE_SVG_AS_IMAGE=1', + 'ENABLE_SVG_USE=1', + 'ENABLE_SVG_FOREIGN_OBJECT=1', + 'ENABLE_SVG_FONTS=1', + 'ENABLE_VIDEO=1', + 'ENABLE_WEB_SOCKETS=1', + 'ENABLE_WORKERS=1', + 'BUILDING_CHROMIUM__=1', + 'USE_SYSTEM_MALLOC=1', + 'WTF_USE_PTHREADS=1', + 'NDEBUG', + 'NVALGRIND' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/../third_party/icu/public/i18n'), + env.Dir('$SRC_DIR/build/..'), + env.Dir('$SRC_DIR/build/../gpu/command_buffer/common'), + env.Dir('$SRC_DIR/build/../third_party/glew/include'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_locale_settings'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_strings'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_resources'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/chrome'), + env.Dir('$SRC_DIR/build/../third_party/protobuf2'), + env.Dir('$SRC_DIR/build/../third_party/protobuf2/src/src'), + env.Dir('$SRC_DIR/build/../third_party/openmax/il'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/net'), + env.Dir('$SRC_DIR/build/../sdch/open-vcdiff/src'), + env.Dir('$SRC_DIR/build/../skia/config'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/config'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/core'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/effects'), + env.Dir('$SRC_DIR/build/../skia/ext'), + env.Dir('$SRC_DIR/build/../third_party/harfbuzz/src'), + env.Dir('$SRC_DIR/build/../third_party/harfbuzz/contrib'), + env.Dir('$SRC_DIR/build/../testing/gmock/include'), + env.Dir('$SRC_DIR/build/../testing/gtest/include'), + env.Dir('$SRC_DIR/build/../third_party/ffmpeg/include'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/ffmpeg'), + env.Dir('$SRC_DIR/build/../third_party/libxml/linux/include'), + env.Dir('$SRC_DIR/build/../third_party/libxml/include'), + env.Dir('$SRC_DIR/build/../third_party/libxslt'), + env.Dir('$SRC_DIR/build/../third_party/lzma_sdk'), + env.Dir('$SRC_DIR/build/../third_party/npapi'), + env.Dir('$SRC_DIR/build/../third_party/npapi/bindings'), + env.Dir('$SRC_DIR/build/../third_party/ots/include'), + env.Dir('$SRC_DIR/build/../third_party/sqlite/preprocessed'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/accessibility'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/accessibility/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/generic'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8/custom'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8/specialization'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bridge'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/css'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/dom'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/dom/default'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/editing'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/history'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/html'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/html/canvas'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/inspector'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/appcache'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/archive'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/icon'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/notifications'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/filters'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/opentype'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/transforms'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/bmp'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/gif'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/ico'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/jpeg'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/png'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/xbm'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-encoders/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/mock'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/network'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/network/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/sql'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/text'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/plugins'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/plugins/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/rendering'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/rendering/style'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/storage'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/storage/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/graphics'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/graphics/filters'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/websockets'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/workers'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/xml'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/webkit'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/webkit/bindings'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/JavaScriptCore'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/JavaScriptCore/wtf'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/test_shell'), + env.Dir('$SRC_DIR/build/../v8/include') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-L$TOP_BUILDDIR', + '-Wl,--gc-sections' + ], + LIBS = [ + '-lX11', + 'libapp_base', + 'libbase_i18n', + 'libtest_support_base', + 'libtest_support_perf', + 'libbase', + 'liblinux_versioninfo', + 'libsymbolize', + 'libxdg_mime', + 'libdebugger', + 'libplugin', + 'libutility', + 'libprofile_import', + 'libchrome_gpu', + 'libworker', + 'libsyncapi', + 'libnotifier', + 'libsync', + 'libbrowser', + 'libcommon', + 'librenderer', + 'libtest_support_common', + 'libtest_support_ui', + 'libtest_support_unit', + 'libcommon_constants', + 'libnacl', + 'libconvert_dict', + 'libipc', + 'libmedia', + 'libomx_wrapper', + 'libnet_base', + 'libnet', + 'libnet_test_support', + 'libprinting', + 'libsdch', + 'libskia', + 'libskia_opts', + 'libgmock', + 'libgmockmain', + 'libgtest', + 'libgtestmain', + 'libcld', + 'libffmpeg', + 'libffmpegsumo', + 'libicudata', + 'libicui18n', + 'libicuuc', + 'libxml2', + 'libxslt', + 'liblzma_sdk', + 'libmodp_b64', + 'libots', + 'libsqlite3', + 'libwebkit', + 'libzlib', + 'libpepper_test_plugin', + 'libtest_shell_common', + 'libappcache', + 'libdatabase', + 'libglue', + 'libgoogleurl', + 'libv8_snapshot', + 'libv8_nosnapshot', + 'libv8_base', + 'libgenperf_libs', + 'libbreakpad_client', + 'libcourgette_lib', + 'libsandbox', + 'libssl', + 'libevent' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, + 'Debug' : { + 'Append' : dict( + CCFLAGS = [ + '-pthread', + '-fno-exceptions', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-pthread', + '-D_REENTRANT', + '-I/usr/include/gtk-2.0', + '-I/usr/lib/gtk-2.0/include', + '-I/usr/include/atk-1.0', + '-I/usr/include/cairo', + '-I/usr/include/pango-1.0', + '-I/usr/include/gio-unix-2.0/', + '-I/usr/include/glib-2.0', + '-I/usr/lib/glib-2.0/include', + '-I/usr/include/pixman-1', + '-I/usr/include/freetype2', + '-I/usr/include/directfb', + '-I/usr/include/libpng12', + '-I/usr/include/libpng12', + '-O0', + '-g' + ], + CPPDEFINES = [ + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'GLEW_STATIC', + 'GL_GLEXT_PROTOTYPES', + 'PERF_TEST', + 'GOOGLE_PROTOBUF_NO_RTTI', + 'CLD_WINDOWS', + '__OMX_EXPORTS', + 'UNIT_TEST', + 'GTEST_HAS_RTTI=0', + 'USE_SYSTEM_LIBBZ2', + 'COMPILER_GCC', + '__STDC_CONSTANT_MACROS', + 'U_STATIC_IMPLEMENTATION', + 'USE_SYSTEM_LIBJPEG', + 'USE_SYSTEM_LIBPNG', + 'LIBXML_STATIC', + 'LIBXSLT_STATIC', + '_LZMA_IN_CB', + 'USE_SYSTEM_ZLIB', + 'ENABLE_3D_CANVAS=1', + 'ENABLE_CHANNEL_MESSAGING=1', + 'ENABLE_DATABASE=1', + 'ENABLE_DATAGRID=0', + 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', + 'ENABLE_DASHBOARD_SUPPORT=0', + 'ENABLE_DOM_STORAGE=1', + 'ENABLE_INDEXED_DATABASE=1', + 'ENABLE_FILTERS=1', + 'ENABLE_GEOLOCATION=1', + 'ENABLE_JAVASCRIPT_DEBUGGER=0', + 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_ICONDATABASE=0', + 'ENABLE_NOTIFICATIONS=1', + 'ENABLE_OPENTYPE_SANITIZER=1', + 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_XSLT=1', + 'ENABLE_XPATH=1', + 'ENABLE_SHARED_WORKERS=1', + 'ENABLE_SVG=1', + 'ENABLE_SVG_ANIMATION=1', + 'ENABLE_SVG_AS_IMAGE=1', + 'ENABLE_SVG_USE=1', + 'ENABLE_SVG_FOREIGN_OBJECT=1', + 'ENABLE_SVG_FONTS=1', + 'ENABLE_VIDEO=1', + 'ENABLE_WEB_SOCKETS=1', + 'ENABLE_WORKERS=1', + 'BUILDING_CHROMIUM__=1', + 'USE_SYSTEM_MALLOC=1', + 'WTF_USE_PTHREADS=1', + '_DEBUG' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/../third_party/icu/public/i18n'), + env.Dir('$SRC_DIR/build/..'), + env.Dir('$SRC_DIR/build/../gpu/command_buffer/common'), + env.Dir('$SRC_DIR/build/../third_party/glew/include'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_locale_settings'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_strings'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/app/app_resources'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/chrome'), + env.Dir('$SRC_DIR/build/../third_party/protobuf2'), + env.Dir('$SRC_DIR/build/../third_party/protobuf2/src/src'), + env.Dir('$SRC_DIR/build/../third_party/openmax/il'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/net'), + env.Dir('$SRC_DIR/build/../sdch/open-vcdiff/src'), + env.Dir('$SRC_DIR/build/../skia/config'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/config'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/core'), + env.Dir('$SRC_DIR/build/../third_party/skia/include/effects'), + env.Dir('$SRC_DIR/build/../skia/ext'), + env.Dir('$SRC_DIR/build/../third_party/harfbuzz/src'), + env.Dir('$SRC_DIR/build/../third_party/harfbuzz/contrib'), + env.Dir('$SRC_DIR/build/../testing/gmock/include'), + env.Dir('$SRC_DIR/build/../testing/gtest/include'), + env.Dir('$SRC_DIR/build/../third_party/ffmpeg/include'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/ffmpeg'), + env.Dir('$SRC_DIR/build/../third_party/libxml/linux/include'), + env.Dir('$SRC_DIR/build/../third_party/libxml/include'), + env.Dir('$SRC_DIR/build/../third_party/libxslt'), + env.Dir('$SRC_DIR/build/../third_party/lzma_sdk'), + env.Dir('$SRC_DIR/build/../third_party/npapi'), + env.Dir('$SRC_DIR/build/../third_party/npapi/bindings'), + env.Dir('$SRC_DIR/build/../third_party/ots/include'), + env.Dir('$SRC_DIR/build/../third_party/sqlite/preprocessed'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/accessibility'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/accessibility/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/generic'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8/custom'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bindings/v8/specialization'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/bridge'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/css'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/dom'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/dom/default'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/editing'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/history'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/html'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/html/canvas'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/inspector'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/appcache'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/archive'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/loader/icon'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/notifications'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/page/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/filters'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/opentype'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/graphics/transforms'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/bmp'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/gif'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/ico'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/jpeg'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/png'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-decoders/xbm'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/image-encoders/skia'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/mock'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/network'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/network/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/sql'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/platform/text'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/plugins'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/plugins/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/rendering'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/rendering/style'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/storage'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/storage/chromium'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/animation'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/graphics'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/svg/graphics/filters'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/websockets'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/workers'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/WebCore/xml'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/webkit'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/webkit/bindings'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/JavaScriptCore'), + env.Dir('$SRC_DIR/build/../third_party/WebKit/JavaScriptCore/wtf'), + env.Dir('${SHARED_INTERMEDIATE_DIR}/test_shell'), + env.Dir('$SRC_DIR/build/../v8/include') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-L$TOP_BUILDDIR', + '-rdynamic' + ], + LIBS = [ + '-lX11', + 'libapp_base', + 'libbase_i18n', + 'libtest_support_base', + 'libtest_support_perf', + 'libbase', + 'liblinux_versioninfo', + 'libsymbolize', + 'libxdg_mime', + 'libdebugger', + 'libplugin', + 'libutility', + 'libprofile_import', + 'libchrome_gpu', + 'libworker', + 'libsyncapi', + 'libnotifier', + 'libsync', + 'libbrowser', + 'libcommon', + 'librenderer', + 'libtest_support_common', + 'libtest_support_ui', + 'libtest_support_unit', + 'libcommon_constants', + 'libnacl', + 'libconvert_dict', + 'libipc', + 'libmedia', + 'libomx_wrapper', + 'libnet_base', + 'libnet', + 'libnet_test_support', + 'libprinting', + 'libsdch', + 'libskia', + 'libskia_opts', + 'libgmock', + 'libgmockmain', + 'libgtest', + 'libgtestmain', + 'libcld', + 'libffmpeg', + 'libffmpegsumo', + 'libicudata', + 'libicui18n', + 'libicuuc', + 'libxml2', + 'libxslt', + 'liblzma_sdk', + 'libmodp_b64', + 'libots', + 'libsqlite3', + 'libwebkit', + 'libzlib', + 'libpepper_test_plugin', + 'libtest_shell_common', + 'libappcache', + 'libdatabase', + 'libglue', + 'libgoogleurl', + 'libv8_snapshot', + 'libv8_nosnapshot', + 'libv8_base', + 'libgenperf_libs', + 'libbreakpad_client', + 'libcourgette_lib', + 'libsandbox', + 'libssl', + 'libevent' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, +} + +config = configurations[env['CONFIG_NAME']] +env.Append(**config['Append']) +env.FilterOut(**config['FilterOut']) +env.Replace(**config['Replace']) + +# Scons forces -fPIC for SHCCFLAGS on some platforms. +# Disable that so we can control it from cflags in gyp. +# Note that Scons itself is inconsistent with its -fPIC +# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not. +# This will make SHCCFLAGS consistent with SHCFLAGS. +env['SHCCFLAGS'] = ['$CCFLAGS'] + +for _var in config['ImportExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env[_var] = os.environ[_var] +for _var in config['PropagateExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env['ENV'][_var] = os.environ[_var] + +env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR') + +if ARGUMENTS.get('COVERAGE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-fprofile-arcs', + '-ftest-coverage' + ], + LINKFLAGS = [ + '-fprofile-arcs' + ], + ) + +if ARGUMENTS.get('PROFILE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-pg', + '-g' + ], + LINKFLAGS = [ + '-pg' + ], + ) + +if ARGUMENTS.get('SYMBOLS') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-g' + ], + ) + +input_files = [] + +target_files = [] +prerequisites = [] + +target_files.extend(input_files) + +gyp_target = env.Alias('All', target_files) +dependencies = [ + Alias('app_unittests'), + Alias('app_strings'), + Alias('app_resources'), + Alias('app_base'), + Alias('base_i18n'), + Alias('base_unittests'), + Alias('test_support_base'), + Alias('test_support_perf'), + Alias('base'), + Alias('linux_versioninfo'), + Alias('symbolize'), + Alias('xdg_mime'), + Alias('chrome_resources'), + Alias('chrome_strings'), + Alias('theme_resources'), + Alias('platform_locale_settings'), + Alias('default_extensions'), + Alias('debugger'), + Alias('plugin'), + Alias('utility'), + Alias('profile_import'), + Alias('chrome_gpu'), + Alias('worker'), + Alias('syncapi'), + Alias('sync_proto'), + Alias('notifier'), + Alias('sync'), + Alias('browser'), + Alias('common'), + Alias('chrome'), + Alias('renderer'), + Alias('test_support_common'), + Alias('test_support_ui'), + Alias('test_support_unit'), + Alias('automated_ui_tests'), + Alias('ui_tests'), + Alias('nacl_ui_tests'), + Alias('unit_tests'), + Alias('browser_tests'), + Alias('startup_tests'), + Alias('reliability_tests'), + Alias('page_cycler_tests'), + Alias('tab_switching_test'), + Alias('memory_test'), + Alias('url_fetch_test'), + Alias('sync_unit_tests'), + Alias('sync_integration_tests'), + Alias('common_constants'), + Alias('nacl'), + Alias('convert_dict'), + Alias('convert_dict_lib'), + Alias('flush_cache'), + Alias('linux_symbols'), + Alias('packed_resources'), + Alias('perf_tests'), + Alias('interactive_ui_tests'), + Alias('ipc_tests'), + Alias('ipc'), + Alias('media'), + Alias('media_unittests'), + Alias('media_bench'), + Alias('wav_ola_test'), + Alias('qt_faststart'), + Alias('omx_test'), + Alias('omx_unittests'), + Alias('omx_wrapper'), + Alias('player_x11'), + Alias('net_base'), + Alias('net'), + Alias('net_unittests'), + Alias('net_perftests'), + Alias('stress_cache'), + Alias('tld_cleanup'), + Alias('crash_cache'), + Alias('net_test_support'), + Alias('net_resources'), + Alias('fetch_client'), + Alias('fetch_server'), + Alias('hresolv'), + Alias('printing'), + Alias('printing_unittests'), + Alias('sdch'), + Alias('skia'), + Alias('skia_opts'), + Alias('gmock'), + Alias('gmockmain'), + Alias('gtest'), + Alias('gtestmain'), + Alias('bzip2'), + Alias('cld'), + Alias('codesighs'), + Alias('maptsvdifftool'), + Alias('nm2tsv'), + Alias('ffmpeg'), + Alias('ffmpeg_binaries'), + Alias('ffmpegsumo'), + Alias('assemble_ffmpeg_asm'), + Alias('make_ffmpeg_asm_lib'), + Alias('ffmpegsumo_nolink'), + Alias('icudata'), + Alias('icui18n'), + Alias('icuuc'), + Alias('libjpeg'), + Alias('libpng'), + Alias('libxml'), + Alias('libxslt'), + Alias('lzma_sdk'), + Alias('modp_b64'), + Alias('npapi'), + Alias('ots'), + Alias('sqlite'), + Alias('sqlite_shell'), + Alias('webkit'), + Alias('webkit_unit_tests'), + Alias('zlib'), + Alias('pepper_test_plugin'), + Alias('test_shell_common'), + Alias('test_shell_pak'), + Alias('test_shell'), + Alias('test_shell_tests'), + Alias('npapi_layout_test_plugin'), + Alias('test_shell_resources'), + Alias('pull_in_test_shell'), + Alias('pull_in_webkit_unit_tests'), + Alias('webkit_resources'), + Alias('webkit_strings'), + Alias('appcache'), + Alias('database'), + Alias('glue'), + Alias('inspector_resources'), + Alias('devtools_html'), + Alias('concatenated_devtools_js'), + Alias('lastchange'), + Alias('googleurl'), + Alias('googleurl_unittests'), + Alias('v8'), + Alias('v8_snapshot'), + Alias('v8_nosnapshot'), + Alias('v8_base'), + Alias('js2c'), + Alias('mksnapshot'), + Alias('v8_shell'), + Alias('yasm'), + Alias('config_sources'), + Alias('generate_files'), + Alias('genperf_libs'), + Alias('genstring'), + Alias('genperf'), + Alias('genmacro'), + Alias('genversion'), + Alias('re2c'), + Alias('genmodule'), + Alias('breakpad_client'), + Alias('breakpad_unittests'), + Alias('generate_test_dump'), + Alias('courgette_lib'), + Alias('courgette'), + Alias('courgette_minimal_tool'), + Alias('courgette_unittests'), + Alias('courgette_fuzz'), + Alias('chrome_sandbox'), + Alias('sandbox'), + Alias('gtk_clipboard_dump'), + Alias('xdisplaycheck'), + Alias('ssl'), + Alias('libevent') +] +env.Requires(target_files, dependencies) +env.Requires(gyp_target, dependencies) +for prerequisite in prerequisites: + env.Requires(prerequisite, dependencies) +env.Requires(gyp_target, prerequisites) +Return("gyp_target") diff --git a/build/All.target.mk b/build/All.target.mk new file mode 100644 index 0000000..e826557 --- /dev/null +++ b/build/All.target.mk @@ -0,0 +1,18 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := All +### Rules for final target. +$(obj).target/build/All.stamp: TOOLSET := $(TOOLSET) +$(obj).target/build/All.stamp: app_unittests $(obj).target/app/app_strings.stamp $(obj).target/app/app_resources.stamp $(obj).target/app/libapp_base.a $(obj).target/app/app_unittest_strings.stamp $(obj).target/base/libbase_i18n.a base_unittests $(obj).target/base/libtest_support_base.a $(obj).target/base/libtest_support_perf.a $(obj).target/base/libbase.a $(obj).target/base/libsymbolize.a $(obj).target/base/libxdg_mime.a sync_listen_notifications $(obj).target/chrome/chrome_resources.stamp $(obj).target/chrome/chrome_strings.stamp $(obj).target/chrome/theme_resources.stamp $(obj).target/chrome/platform_locale_settings.stamp $(obj).target/chrome/chrome_extra_resources.stamp $(obj).target/chrome/default_extensions.stamp $(obj).target/chrome/libdebugger.a $(obj).target/chrome/libplugin.a $(obj).target/chrome/libutility.a $(obj).target/chrome/libprofile_import.a $(obj).target/chrome/libchrome_gpu.a $(obj).target/chrome/libworker.a $(obj).target/chrome/libsyncapi.a $(obj).target/chrome/libsync.a $(obj).target/chrome/libsync_notifier.a $(obj).target/chrome/libservice.a $(obj).target/chrome/libbrowser.a $(obj).target/chrome/component_extensions.stamp $(obj).target/chrome/userfeedback_proto.stamp $(obj).target/chrome/libcommon.a $(obj).target/chrome/libcommon_net.a chrome $(obj).target/chrome/libchrome_version_info.a $(obj).target/chrome/librenderer.a interactive_ui_tests $(obj).target/chrome/libtest_support_common.a $(obj).target/chrome/libtest_support_ui.a $(obj).target/chrome/libtest_support_unit.a automated_ui_tests ui_tests libnacl_security_tests.so nacl_sandbox_tests nacl_ui_tests unit_tests browser_tests startup_tests reliability_tests page_cycler_tests tab_switching_test memory_test url_fetch_test sync_unit_tests sync_integration_tests plugin_tests $(obj).target/chrome/libcommon_constants.a $(obj).target/chrome/libnacl.a convert_dict $(obj).target/chrome/libconvert_dict.a flush_cache $(obj).target/chrome/packed_extra_resources.stamp $(obj).target/chrome/linux_symbols.stamp $(obj).target/chrome/packed_resources.stamp $(obj).target/chrome/libinstaller_util.a perf_tests gfx_unittests $(obj).target/gfx/libgfx.a $(obj).target/gpu/libcommand_buffer_common.a $(obj).target/gpu/libgles2_cmd_helper.a $(obj).target/gpu/libgles2_implementation.a $(obj).target/gpu/libgles2_lib.a $(obj).target/gpu/libgles2_c_lib.a $(obj).target/gpu/libcommand_buffer_client.a $(obj).target/gpu/libcommand_buffer_service.a $(obj).target/gpu/libgpu_plugin.a gpu_unittests $(obj).target/gpu/libgles2_demo_lib.a $(obj).target/gpu/libpgl.a $(obj).target/gpu/demos/libgpu_demo_framework.a $(obj).target/gpu/demos/libgpu_demo_framework_exe.a hello_triangle_exe mip_map_2d_exe simple_texture_2d_exe simple_texture_cubemap_exe simple_vertex_shader_exe stencil_test_exe texture_wrap_exe ipc_tests $(obj).target/ipc/libipc.a $(obj).target/jingle/libnotifier.a notifier_unit_tests $(obj).target/media/libmedia.a media_unittests media_bench scaler_bench ffmpeg_tests wav_ola_test qt_faststart omx_test omx_unittests $(obj).target/media/libomx_wrapper.a player_x11 $(obj).target/net/libnet_base.a $(obj).target/net/libnet.a net_unittests net_perftests stress_cache tld_cleanup crash_cache run_testserver $(obj).target/net/libnet_test_support.a $(obj).target/net/net_resources.stamp fetch_client fetch_server $(obj).target/net/libhttp_listen_socket.a hresolv $(obj).target/net/third_party/nss/libssl.a $(obj).target/printing/libprinting.a printing_unittests $(obj).target/sdch/libsdch.a $(obj).target/skia/libskia.a $(obj).target/skia/libskia_opts.a $(obj).target/testing/libgmock.a $(obj).target/testing/libgmockmain.a $(obj).target/testing/libgtest.a $(obj).target/testing/libgtestmain.a $(obj).target/third_party/cacheinvalidation/cacheinvalidation_proto.stamp $(obj).target/third_party/cacheinvalidation/libcacheinvalidation.a cacheinvalidation_unittests $(obj).target/third_party/cld/libcld.a codesighs maptsvdifftool nm2tsv $(obj).target/third_party/ffmpeg/libffmpeg.a libffmpegsumo.so $(obj).target/third_party/ffmpeg/assemble_ffmpeg_asm.stamp $(obj).target/third_party/ffmpeg/make_ffmpeg_asm_lib.stamp ffmpegsumo_nolink $(obj).target/third_party/icu/libicudata.a $(obj).target/third_party/icu/libicui18n.a $(obj).target/third_party/icu/libicuuc.a $(obj).target/third_party/libxml/libxml2.a $(obj).target/third_party/libxslt/libxslt.a $(obj).target/third_party/lzma_sdk/liblzma_sdk.a $(obj).target/third_party/mesa/libmesa.a libosmesa.so $(obj).target/third_party/modp_b64/libmodp_b64.a $(obj).target/third_party/npapi/npapi.stamp $(obj).target/third_party/ppapi/ppapi_c.stamp $(obj).target/third_party/ppapi/libppapi_cpp_objects.a $(obj).target/third_party/ppapi/libppapi_cpp.a libppapi_example.so libppapi_tests.so $(obj).target/third_party/ots/libots.a $(obj).target/third_party/sqlite/libsqlite3.a sqlite_shell $(obj).target/third_party/WebKit/WebKit/chromium/libwebkit.a $(obj).target/third_party/WebKit/WebKit/chromium/inspector_resources.stamp $(obj).target/third_party/WebKit/WebKit/chromium/devtools_html.stamp $(obj).target/third_party/WebKit/WebKit/chromium/concatenated_devtools_js.stamp webkit_unit_tests ImageDiff DumpRenderTree $(obj).target/third_party/zlib/libzlib.a $(obj).target/webkit/support/libappcache.a $(obj).target/webkit/support/libdatabase.a $(obj).target/webkit/support/webkit_resources.stamp $(obj).target/webkit/support/webkit_strings.stamp $(obj).target/webkit/support/libglue.a libnpapi_layout_test_plugin.so $(obj).target/webkit/support/copy_npapi_layout_test_plugin.stamp $(obj).target/webkit/support/libwebkit_support.a $(obj).target/webkit/pull_in_webkit_unit_tests.stamp $(obj).target/webkit/pull_in_DumpRenderTree.stamp $(obj).target/webkit/libtest_shell_common.a $(obj).target/webkit/test_shell_pak.stamp test_shell test_shell_tests $(obj).target/webkit/test_shell_resources.stamp $(obj).target/build/util/lastchange.stamp $(obj).target/build/temp_gyp/libgoogleurl.a googleurl_unittests $(obj).target/v8/tools/gyp/v8.stamp $(obj).target/v8/tools/gyp/libv8_snapshot.a $(obj).target/v8/tools/gyp/libv8_nosnapshot.a $(obj).target/v8/tools/gyp/libv8_base.a v8_shell yasm $(obj).host/third_party/yasm/config_sources.stamp $(obj).host/third_party/yasm/generate_files.stamp $(obj).host/third_party/yasm/libgenperf_libs.a genstring genperf genmacro genversion re2c genmodule $(obj).target/breakpad/libbreakpad_client.a breakpad_unittests generate_test_dump $(obj).target/courgette/libcourgette_lib.a courgette courgette_minimal_tool courgette_unittests courgette_fuzz chrome_sandbox $(obj).target/sandbox/libsandbox.a gtk_clipboard_dump xdisplaycheck $(obj).target/third_party/libevent/libevent.a $(obj).target/remoting/libchromoting_plugin.a $(obj).target/remoting/libchromoting_base.a $(obj).target/remoting/libchromoting_host.a $(obj).target/remoting/libchromoting_client.a chromoting_simple_host chromoting_host_keygen $(obj).target/remoting/libchromoting_jingle_glue.a chromoting_jingle_test_client remoting_unittests chromoting_client_test_webserver chromoting_x11_client $(obj).target/chrome/libnacl_security_tests.so $(obj).target/third_party/ffmpeg/libffmpegsumo.so $(obj).target/third_party/ppapi/libppapi_example.so FORCE_DO_CMD + $(call do_cmd,touch) + +all_deps += $(obj).target/build/All.stamp +# Add target alias +.PHONY: All +All: $(obj).target/build/All.stamp + +# Add target alias to "all" target. +.PHONY: all +all: All + diff --git a/build/README.chromium b/build/README.chromium new file mode 100644 index 0000000..012df35 --- /dev/null +++ b/build/README.chromium @@ -0,0 +1,15 @@ +List of property sheets to be included by projects: + common.vsprops + Not used anymore. No-op. Kept for compatibility with current projects. + + debug.vsprops + Enables debug settings. Must be included directly in Debug configuration. Includes internal\essential.vsprops. + + external_code.vsprops + Contains settings made to simplify usage of external (non-Google) code. It relaxes the warning levels. Should be included after debug.vsprops or release.vsprops to override their settings. + + output_dll_copy.rules + Run to enable automatic copy of DLL when they are as an input file in a vcproj project. + + release.vsprops + Enables release settings. Must be included directly in Release configuration. Includes internal\essential.vsprops. Also includes "internal\release_impl$(CHROME_BUILD_TYPE).vsprops". So the behavior is dependant on the CHROME_BUILD_TYPE environment variable. diff --git a/build/SConstruct b/build/SConstruct new file mode 100644 index 0000000..87375e1 --- /dev/null +++ b/build/SConstruct @@ -0,0 +1,2 @@ +# This file is generated; do not edit. +SConscript('all_main.scons') diff --git a/build/all.Makefile b/build/all.Makefile new file mode 100644 index 0000000..f74a5f1 --- /dev/null +++ b/build/all.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= /usr/local/google/src/chromium-merge/src/build/out +.PHONY: all +all: + $(MAKE) -C .. All diff --git a/build/all.gyp b/build/all.gyp new file mode 100644 index 0000000..e762965 --- /dev/null +++ b/build/all.gyp @@ -0,0 +1,340 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'All', + 'type': 'none', + 'xcode_create_dependents_test_runner': 1, + 'dependencies': [ + '../app/app.gyp:*', + '../base/base.gyp:*', + '../chrome/browser/sync/tools/sync_tools.gyp:*', + '../chrome/chrome.gyp:*', + '../gfx/gfx.gyp:*', + '../gpu/gpu.gyp:*', + '../gpu/demos/demos.gyp:*', + '../ipc/ipc.gyp:*', + '../jingle/jingle.gyp:*', + '../media/media.gyp:*', + '../net/net.gyp:*', + '../net/third_party/nss/ssl.gyp:*', + '../printing/printing.gyp:*', + '../sdch/sdch.gyp:*', + '../skia/skia.gyp:*', + '../testing/gmock.gyp:*', + '../testing/gtest.gyp:*', + '../third_party/bzip2/bzip2.gyp:*', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:*', + '../third_party/cld/cld.gyp:*', + '../third_party/codesighs/codesighs.gyp:*', + '../third_party/ffmpeg/ffmpeg.gyp:*', + '../third_party/icu/icu.gyp:*', + '../third_party/libjpeg/libjpeg.gyp:*', + '../third_party/libpng/libpng.gyp:*', + '../third_party/libxml/libxml.gyp:*', + '../third_party/libxslt/libxslt.gyp:*', + '../third_party/lzma_sdk/lzma_sdk.gyp:*', + '../third_party/mesa/mesa.gyp:*', + '../third_party/modp_b64/modp_b64.gyp:*', + '../third_party/npapi/npapi.gyp:*', + '../third_party/ppapi/ppapi.gyp:*', + '../third_party/ots/ots.gyp:*', + '../third_party/sqlite/sqlite.gyp:*', + '../third_party/WebKit/WebKit/chromium/WebKit.gyp:*', + '../third_party/zlib/zlib.gyp:*', + '../webkit/support/webkit_support.gyp:*', + '../webkit/webkit.gyp:*', + 'util/build_util.gyp:*', + 'temp_gyp/googleurl.gyp:*', + ], + 'conditions': [ + ['javascript_engine=="v8"', { + 'dependencies': [ + '../v8/tools/gyp/v8.gyp:*', + ], + }], + ['OS=="mac" or OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + 'dependencies': [ + '../third_party/yasm/yasm.gyp:*#host', + ], + }], + ['OS=="mac" or OS=="win"', { + 'dependencies': [ + '../third_party/nss/nss.gyp:*', + ], + }], + ['OS=="mac"', { + 'dependencies': [ + '../third_party/ocmock/ocmock.gyp:*', + ], + }], + ['OS=="linux"', { + 'dependencies': [ + '../breakpad/breakpad.gyp:*', + '../courgette/courgette.gyp:*', + '../sandbox/sandbox.gyp:*', + ], + 'conditions': [ + ['branding=="Chrome"', { + 'dependencies': [ + '../chrome/chrome.gyp:linux_packages_<(channel)', + ], + }], + ], + }], + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + 'dependencies': [ + '../tools/gtk_clipboard_dump/gtk_clipboard_dump.gyp:*', + '../tools/xdisplaycheck/xdisplaycheck.gyp:*', + ], + }], + ['OS=="win"', { + 'conditions': [ + ['win_use_allocator_shim==1', { + 'dependencies': [ + '../base/allocator/allocator.gyp:*', + ], + }], + ], + 'dependencies': [ + '../breakpad/breakpad.gyp:*', + '../chrome/app/locales/locales.gyp:*', + '../chrome_frame/chrome_frame.gyp:*', + '../courgette/courgette.gyp:*', + '../gears/gears.gyp:*', + '../rlz/rlz.gyp:*', + '../sandbox/sandbox.gyp:*', + '../third_party/bsdiff/bsdiff.gyp:*', + '../third_party/bspatch/bspatch.gyp:*', + '../third_party/gles2_book/gles2_book.gyp:*', + '../tools/memory_watcher/memory_watcher.gyp:*', + ], + }, { + 'dependencies': [ + '../third_party/libevent/libevent.gyp:*', + ], + }], + ['toolkit_views==1', { + 'dependencies': [ + '../views/views.gyp:*', + ], + }], + ['chromeos==1', { + 'dependencies': [ + '../chrome/browser/chromeos/input_method/candidate_window.gyp:*', + ], + }], + ['remoting==1', { + 'dependencies': [ + '../remoting/remoting.gyp:*', + ], + }], + ], + }, + ], + 'conditions': [ + ['OS=="mac"', { + 'targets': [ + { + # Target to build everything plus the dmg. We don't put the dmg + # in the All target because developers really don't need it. + 'target_name': 'all_and_dmg', + 'type': 'none', + 'dependencies': [ + 'All', + '../chrome/chrome.gyp:build_app_dmg', + ], + }, + # These targets are here so the build bots can use them to build + # subsets of a full tree for faster cycle times. + { + 'target_name': 'chromium_builder_dbg', + 'type': 'none', + 'dependencies': [ + '../app/app.gyp:app_unittests', + '../chrome/chrome.gyp:browser_tests', + '../chrome/chrome.gyp:nacl_ui_tests', + '../chrome/chrome.gyp:sync_unit_tests', + '../chrome/chrome.gyp:ui_tests', + '../chrome/chrome.gyp:unit_tests', + '../gfx/gfx.gyp:gfx_unittests', + '../gpu/gpu.gyp:gpu_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:media_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + ], + }, + { + 'target_name': 'chromium_builder_rel', + 'type': 'none', + 'dependencies': [ + '../app/app.gyp:app_unittests', + '../chrome/chrome.gyp:browser_tests', + '../chrome/chrome.gyp:memory_test', + '../chrome/chrome.gyp:nacl_ui_tests', + '../chrome/chrome.gyp:page_cycler_tests', + '../chrome/chrome.gyp:plugin_tests', + '../chrome/chrome.gyp:startup_tests', + '../chrome/chrome.gyp:sync_unit_tests', + '../chrome/chrome.gyp:tab_switching_test', + '../chrome/chrome.gyp:ui_tests', + '../chrome/chrome.gyp:unit_tests', + '../chrome/chrome.gyp:url_fetch_test', + '../gfx/gfx.gyp:gfx_unittests', + '../gpu/gpu.gyp:gpu_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:media_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + ], + }, + { + 'target_name': 'chromium_builder_dbg_tsan_mac', + 'type': 'none', + 'dependencies': [ + '../base/base.gyp:base_unittests', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + '../net/net.gyp:net_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:media_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + ], + }, + ], # targets + }], # OS="mac" + ['OS=="win"', { + 'targets': [ + # These targets are here so the build bots can use them to build + # subsets of a full tree for faster cycle times. + { + 'target_name': 'chromium_builder', + 'type': 'none', + 'dependencies': [ + '../app/app.gyp:app_unittests', + '../chrome/chrome.gyp:browser_tests', + '../chrome/chrome.gyp:installer_util_unittests', + '../chrome/chrome.gyp:interactive_ui_tests', + '../chrome/chrome.gyp:memory_test', + '../chrome/chrome.gyp:mini_installer_test', + '../chrome/chrome.gyp:nacl_ui_tests', + '../chrome/chrome.gyp:page_cycler_tests', + '../chrome/chrome.gyp:plugin_tests', + '../chrome/chrome.gyp:selenium_tests', + '../chrome/chrome.gyp:startup_tests', + '../chrome/chrome.gyp:sync_unit_tests', + '../chrome/chrome.gyp:tab_switching_test', + '../chrome/chrome.gyp:ui_tests', + '../chrome/chrome.gyp:unit_tests', + '../chrome/chrome.gyp:url_fetch_test', + # mini_installer_tests depends on mini_installer. This should be + # defined in installer.gyp. + '../chrome/installer/mini_installer.gyp:mini_installer', + '../courgette/courgette.gyp:courgette_unittests', + '../gfx/gfx.gyp:gfx_unittests', + '../gpu/gpu.gyp:gpu_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:media_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../webkit/support/webkit_support.gyp:npapi_layout_test_plugin', + # TODO(nsylvain) ui_tests.exe depends on test_shell_common. + # This should: + # 1) not be the case. OR. + # 2) be expressed in the ui tests dependencies. + '../webkit/webkit.gyp:test_shell_common', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', + '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', + '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', + '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', + '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', + '../chrome_frame/chrome_frame.gyp:npchrome_frame', + '../third_party/angle/src/build_angle.gyp:*', + ], + }, + { + 'target_name': 'chromium_builder_dbg_tsan_win', + 'type': 'none', + 'dependencies': [ + '../app/app.gyp:app_unittests', + # TODO(bradnelson): app_unittests should depend on locales. + # However, we can't add dependencies on chrome/ to app/ + # See http://crbug.com/43603 + '../base/base.gyp:base_unittests', + '../chrome/app/locales/locales.gyp:*', + '../chrome/chrome.gyp:sync_unit_tests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:media_unittests', + '../net/net.gyp:net_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + ], + }, + ], # targets + }], # OS="win" + ['chromeos==1', { + 'targets': [ + { + 'target_name': 'chromeos_builder', + 'type': 'none', + 'sources': [ + # TODO(bradnelson): This is here to work around gyp issue 137. + # Remove this sources list when that issue has been fixed. + 'all.gyp', + ], + 'dependencies': [ + '../app/app.gyp:app_unittests', + '../base/base.gyp:base_unittests', + '../chrome/chrome.gyp:browser_tests', + '../chrome/chrome.gyp:chrome', + '../chrome/chrome.gyp:interactive_ui_tests', + '../chrome/chrome.gyp:memory_test', + '../chrome/chrome.gyp:page_cycler_tests', + '../chrome/chrome.gyp:startup_tests', + '../chrome/chrome.gyp:sync_unit_tests', + '../chrome/chrome.gyp:tab_switching_test', + '../chrome/chrome.gyp:ui_tests', + '../chrome/chrome.gyp:unit_tests', + '../chrome/chrome.gyp:url_fetch_test', + '../gfx/gfx.gyp:gfx_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../jingle/jingle.gyp:notifier_unit_tests', + '../media/media.gyp:ffmpeg_tests', + '../media/media.gyp:media_unittests', + '../media/media.gyp:omx_test', + '../net/net.gyp:net_unittests', + '../printing/printing.gyp:printing_unittests', + '../remoting/remoting.gyp:remoting_unittests', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + 'temp_gyp/googleurl.gyp:googleurl_unittests', + '../chrome/browser/chromeos/input_method/candidate_window.gyp:candidate_window', + ], + }, + ], # targets + }], # "chromeos==1" + ], # conditions +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/all_main.scons b/build/all_main.scons new file mode 100644 index 0000000..b1a9251 --- /dev/null +++ b/build/all_main.scons @@ -0,0 +1,529 @@ +# This file is generated; do not edit. + +__doc__ = ''' +Wrapper configuration for building this entire "solution," +including all the specific targets in various *.scons files. +''' + +import os +import sys + +import SCons.Environment +import SCons.Util + +def GetProcessorCount(): + ''' + Detects the number of CPUs on the system. Adapted form: + http://codeliberates.blogspot.com/2008/05/detecting-cpuscores-in-python.html + ''' + # Linux, Unix and Mac OS X: + if hasattr(os, 'sysconf'): + if os.sysconf_names.has_key('SC_NPROCESSORS_ONLN'): + # Linux and Unix or Mac OS X with python >= 2.5: + return os.sysconf('SC_NPROCESSORS_ONLN') + else: # Mac OS X with Python < 2.5: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + # Windows: + if os.environ.has_key('NUMBER_OF_PROCESSORS'): + return max(int(os.environ.get('NUMBER_OF_PROCESSORS', '1')), 1) + return 1 # Default + +# Support PROGRESS= to show progress in different ways. +p = ARGUMENTS.get('PROGRESS') +if p == 'spinner': + Progress(['/\r', '|\r', '\\\r', '-\r'], + interval=5, + file=open('/dev/tty', 'w')) +elif p == 'name': + Progress('$TARGET\r', overwrite=True, file=open('/dev/tty', 'w')) + +# Set the default -j value based on the number of processors. +SetOption('num_jobs', GetProcessorCount() + 1) + +# Have SCons use its cached dependency information. +SetOption('implicit_cache', 1) + +# Only re-calculate MD5 checksums if a timestamp has changed. +Decider('MD5-timestamp') + +# Since we set the -j value by default, suppress SCons warnings about being +# unable to support parallel build on versions of Python with no threading. +default_warnings = ['no-no-parallel-support'] +SetOption('warn', default_warnings + GetOption('warn')) + +AddOption('--mode', nargs=1, dest='conf_list', default=[], + action='append', help='Configuration to build.') + +AddOption('--verbose', dest='verbose', default=False, + action='store_true', help='Verbose command-line output.') + + +# +sconscript_file_map = dict( + All = 'All.scons', + app_base = '../app/app_base.scons', + app_resources = '../app/app_resources.scons', + app_strings = '../app/app_strings.scons', + app_unittests = '../app/app_unittests.scons', + appcache = '../webkit/appcache.scons', + assemble_ffmpeg_asm = '../third_party/ffmpeg/assemble_ffmpeg_asm.scons', + automated_ui_tests = '../chrome/automated_ui_tests.scons', + base = '../base/base.scons', + base_i18n = '../base/base_i18n.scons', + base_unittests = '../base/base_unittests.scons', + breakpad_client = '../breakpad/breakpad_client.scons', + breakpad_unittests = '../breakpad/breakpad_unittests.scons', + browser = '../chrome/browser.scons', + browser_tests = '../chrome/browser_tests.scons', + chrome = '../chrome/chrome.scons', + chrome_gpu = '../chrome/chrome_gpu.scons', + chrome_resources = '../chrome/chrome_resources.scons', + chrome_sandbox = '../sandbox/chrome_sandbox.scons', + chrome_strings = '../chrome/chrome_strings.scons', + cld = '../third_party/cld/cld.scons', + codesighs = '../third_party/codesighs/codesighs.scons', + command_buffer_common = '../gpu/command_buffer_common.scons', + command_buffer_service = '../gpu/command_buffer_service.scons', + command_buffer_service_impl = '../gpu/command_buffer_service_impl.scons', + common = '../chrome/common.scons', + common_constants = '../chrome/common_constants.scons', + concatenated_devtools_js = '../webkit/concatenated_devtools_js.scons', + config_sources = '../third_party/yasm/config_sources.scons', + convert_dict = '../chrome/convert_dict.scons', + convert_dict_lib = '../chrome/convert_dict_lib.scons', + courgette = '../courgette/courgette.scons', + courgette_fuzz = '../courgette/courgette_fuzz.scons', + courgette_lib = '../courgette/courgette_lib.scons', + courgette_minimal_tool = '../courgette/courgette_minimal_tool.scons', + courgette_unittests = '../courgette/courgette_unittests.scons', + crash_cache = '../net/crash_cache.scons', + database = '../webkit/database.scons', + debugger = '../chrome/debugger.scons', + default_extensions = '../chrome/default_extensions.scons', + devtools_html = '../webkit/devtools_html.scons', + expiration = '../native_client/src/trusted/service_runtime/expiration.scons', + fetch_client = '../net/fetch_client.scons', + fetch_server = '../net/fetch_server.scons', + ffmpeg = '../third_party/ffmpeg/ffmpeg.scons', + ffmpeg_binaries = '../third_party/ffmpeg/ffmpeg_binaries.scons', + ffmpegsumo = '../third_party/ffmpeg/ffmpegsumo.scons', + ffmpegsumo_nolink = '../third_party/ffmpeg/ffmpegsumo_nolink.scons', + flush_cache = '../chrome/flush_cache.scons', + generate_files = '../third_party/yasm/generate_files.scons', + generate_test_dump = '../breakpad/generate_test_dump.scons', + genmacro = '../third_party/yasm/genmacro.scons', + genmodule = '../third_party/yasm/genmodule.scons', + genperf = '../third_party/yasm/genperf.scons', + genperf_libs = '../third_party/yasm/genperf_libs.scons', + genstring = '../third_party/yasm/genstring.scons', + genversion = '../third_party/yasm/genversion.scons', + gio = '../native_client/src/trusted/gio/gio.scons', + gl_libs = '../gpu/gl_libs.scons', + glue = '../webkit/glue.scons', + gmock = '../testing/gmock.scons', + gmockmain = '../testing/gmockmain.scons', + google_nacl_npruntime = '../native_client/src/shared/npruntime/google_nacl_npruntime.scons', + googleurl = 'temp_gyp/googleurl.scons', + googleurl_unittests = 'temp_gyp/googleurl_unittests.scons', + gpu_plugin = '../gpu/gpu_plugin.scons', + gtest = '../testing/gtest.scons', + gtestmain = '../testing/gtestmain.scons', + gtk_clipboard_dump = '../tools/gtk_clipboard_dump/gtk_clipboard_dump.scons', + harfbuzz = '../third_party/harfbuzz/harfbuzz.scons', + harfbuzz_interface = '../third_party/harfbuzz/harfbuzz_interface.scons', + hresolv = '../net/hresolv.scons', + hunspell = '../third_party/hunspell/hunspell.scons', + icudata = '../third_party/icu/icudata.scons', + icui18n = '../third_party/icu/icui18n.scons', + icuuc = '../third_party/icu/icuuc.scons', + il = '../third_party/openmax/il.scons', + image_diff = '../tools/imagediff/image_diff.scons', + inspector_resources = '../webkit/inspector_resources.scons', + interactive_ui_tests = '../chrome/interactive_ui_tests.scons', + ipc = '../ipc/ipc.scons', + ipc_tests = '../ipc/ipc_tests.scons', + js2c = '../v8/tools/gyp/js2c.scons', + lastchange = 'util/lastchange.scons', + libevent = '../third_party/libevent/libevent.scons', + libgoogle_nacl_imc_c = '../native_client/src/shared/imc/libgoogle_nacl_imc_c.scons', + libjingle = '../third_party/libjingle/libjingle.scons', + libxml = '../third_party/libxml/libxml.scons', + libxslt = '../third_party/libxslt/libxslt.scons', + linux_symbols = '../chrome/linux_symbols.scons', + linux_versioninfo = '../base/linux_versioninfo.scons', + lzma_sdk = '../third_party/lzma_sdk/lzma_sdk.scons', + make_ffmpeg_asm_lib = '../third_party/ffmpeg/make_ffmpeg_asm_lib.scons', + maptsvdifftool = '../third_party/codesighs/maptsvdifftool.scons', + media = '../media/media.scons', + media_bench = '../media/media_bench.scons', + media_unittests = '../media/media_unittests.scons', + memory_test = '../chrome/memory_test.scons', + mksnapshot = '../v8/tools/gyp/mksnapshot.scons', + modp_b64 = '../third_party/modp_b64/modp_b64.scons', + nacl = '../chrome/nacl.scons', + nacl_ui_tests = '../chrome/nacl_ui_tests.scons', + ncdecode_table = '../native_client/src/trusted/validator_x86/ncdecode_table.scons', + ncdecode_tablegen = '../native_client/src/trusted/validator_x86/ncdecode_tablegen.scons', + ncopcode_utils = '../native_client/src/trusted/validator_x86/ncopcode_utils.scons', + ncopcode_utils_gen = '../native_client/src/trusted/validator_x86/ncopcode_utils_gen.scons', + ncvalidate = '../native_client/src/trusted/validator_x86/ncvalidate.scons', + net = '../net/net.scons', + net_base = '../net/net_base.scons', + net_perftests = '../net/net_perftests.scons', + net_resources = '../net/net_resources.scons', + net_test_support = '../net/net_test_support.scons', + net_unittests = '../net/net_unittests.scons', + nm2tsv = '../third_party/codesighs/nm2tsv.scons', + nonnacl_srpc = '../native_client/src/shared/srpc/nonnacl_srpc.scons', + nonnacl_util_chrome = '../native_client/src/trusted/nonnacl_util/nonnacl_util_chrome.scons', + nonnacl_util_linux = '../native_client/src/trusted/nonnacl_util/linux/nonnacl_util_linux.scons', + notifier = '../chrome/notifier.scons', + npGoogleNaClPluginChrome = '../native_client/src/trusted/plugin/npGoogleNaClPluginChrome.scons', + npapi = '../third_party/npapi/npapi.scons', + npapi_layout_test_plugin = '../webkit/tools/test_shell/npapi_layout_test_plugin.scons', + nrd_xfer = '../native_client/src/trusted/desc/nrd_xfer.scons', + omx_test = '../media/omx_test.scons', + omx_unittests = '../media/omx_unittests.scons', + omx_wrapper = '../media/omx_wrapper.scons', + ots = '../third_party/ots/ots.scons', + packed_resources = '../chrome/packed_resources.scons', + page_cycler_tests = '../chrome/page_cycler_tests.scons', + pcre = '../third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/pcre.scons', + pepper_test_plugin = '../webkit/tools/pepper_test_plugin/pepper_test_plugin.scons', + perf_tests = '../chrome/perf_tests.scons', + platform = '../native_client/src/shared/platform/platform.scons', + platform_locale_settings = '../chrome/platform_locale_settings.scons', + platform_qual_lib = '../native_client/src/trusted/platform_qualify/platform_qual_lib.scons', + player_x11 = '../media/player_x11.scons', + plugin = '../chrome/plugin.scons', + printing = '../printing/printing.scons', + printing_unittests = '../printing/printing_unittests.scons', + profile_import = '../chrome/profile_import.scons', + protobuf = '../third_party/protobuf2/protobuf.scons', + protobuf_lite = '../third_party/protobuf2/protobuf_lite.scons', + protoc = '../third_party/protobuf2/protoc.scons', + pull_in_test_shell = '../webkit/pull_in_test_shell.scons', + pull_in_webkit_unit_tests = '../webkit/pull_in_webkit_unit_tests.scons', + qt_faststart = '../media/qt_faststart.scons', + re2c = '../third_party/yasm/re2c.scons', + reliability_tests = '../chrome/reliability_tests.scons', + renderer = '../chrome/renderer.scons', + sandbox = '../sandbox/sandbox.scons', + sdch = '../sdch/sdch.scons', + sel = '../native_client/src/trusted/service_runtime/sel.scons', + sel_ldr_launcher = '../native_client/src/trusted/nonnacl_util/sel_ldr_launcher.scons', + service_runtime_x86 = '../native_client/src/trusted/service_runtime/arch/x86/service_runtime_x86.scons', + service_runtime_x86_64 = '../native_client/src/trusted/service_runtime/arch/x86_64/service_runtime_x86_64.scons', + skia = '../skia/skia.scons', + skia_opts = '../skia/skia_opts.scons', + sqlite = '../third_party/sqlite/sqlite.scons', + sqlite_shell = '../third_party/sqlite/sqlite_shell.scons', + ssl = '../net/third_party/nss/ssl.scons', + startup_tests = '../chrome/startup_tests.scons', + stress_cache = '../net/stress_cache.scons', + symbolize = '../base/symbolize.scons', + sync = '../chrome/sync.scons', + sync_integration_tests = '../chrome/sync_integration_tests.scons', + sync_proto = '../chrome/sync_proto.scons', + sync_unit_tests = '../chrome/sync_unit_tests.scons', + syncapi = '../chrome/syncapi.scons', + tab_switching_test = '../chrome/tab_switching_test.scons', + test_shell = '../webkit/tools/test_shell/test_shell.scons', + test_shell_common = '../webkit/tools/test_shell/test_shell_common.scons', + test_shell_pak = '../webkit/tools/test_shell/test_shell_pak.scons', + test_shell_resources = '../webkit/tools/test_shell/test_shell_resources.scons', + test_shell_tests = '../webkit/tools/test_shell/test_shell_tests.scons', + test_support_base = '../base/test_support_base.scons', + test_support_common = '../chrome/test_support_common.scons', + test_support_perf = '../base/test_support_perf.scons', + test_support_ui = '../chrome/test_support_ui.scons', + test_support_unit = '../chrome/test_support_unit.scons', + theme_resources = '../chrome/theme_resources.scons', + tld_cleanup = '../net/tld_cleanup.scons', + ui_tests = '../chrome/ui_tests.scons', + unit_tests = '../chrome/unit_tests.scons', + url_fetch_test = '../chrome/url_fetch_test.scons', + utility = '../chrome/utility.scons', + v8 = '../v8/tools/gyp/v8.scons', + v8_base = '../v8/tools/gyp/v8_base.scons', + v8_nosnapshot = '../v8/tools/gyp/v8_nosnapshot.scons', + v8_shell = '../v8/tools/gyp/v8_shell.scons', + v8_snapshot = '../v8/tools/gyp/v8_snapshot.scons', + wav_ola_test = '../media/wav_ola_test.scons', + webcore = '../third_party/WebKit/WebCore/WebCore.gyp/webcore.scons', + webcore_bindings = '../third_party/WebKit/WebCore/WebCore.gyp/webcore_bindings.scons', + webcore_bindings_sources = '../third_party/WebKit/WebCore/WebCore.gyp/webcore_bindings_sources.scons', + webkit = '../third_party/WebKit/WebKit/chromium/webkit.scons', + webkit_resources = '../webkit/webkit_resources.scons', + webkit_strings = '../webkit/webkit_strings.scons', + webkit_unit_tests = '../third_party/WebKit/WebKit/chromium/webkit_unit_tests.scons', + worker = '../chrome/worker.scons', + wtf = '../third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/wtf.scons', + wtf_config = '../third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/wtf_config.scons', + xdg_mime = '../base/xdg_mime.scons', + xdisplaycheck = '../tools/xdisplaycheck/xdisplaycheck.scons', + yasm = '../third_party/yasm/yasm.scons', + zlib = '../third_party/zlib/zlib.scons', +) + +class LoadTarget: + ''' + Class for deciding if a given target sconscript is to be included + based on a list of included target names, optionally prefixed with '-' + to exclude a target name. + ''' + def __init__(self, load): + ''' + Initialize a class with a list of names for possible loading. + + Arguments: + load: list of elements in the LOAD= specification + ''' + self.included = set([c for c in load if not c.startswith('-')]) + self.excluded = set([c[1:] for c in load if c.startswith('-')]) + + if not self.included: + self.included = set(['all']) + + def __call__(self, target): + ''' + Returns True if the specified target's sconscript file should be + loaded, based on the initialized included and excluded lists. + ''' + return (target in self.included or + ('all' in self.included and not target in self.excluded)) + +if 'LOAD' in ARGUMENTS: + load = ARGUMENTS['LOAD'].split(',') +else: + load = [] +load_target = LoadTarget(load) + +sconscript_files = [] +for target, sconscript in sconscript_file_map.iteritems(): + if load_target(target): + sconscript_files.append(sconscript) + + +target_alias_list= [] + +conf_list = GetOption('conf_list') +if conf_list: + # In case the same --mode= value was specified multiple times. + conf_list = list(set(conf_list)) +else: + conf_list = ['Debug'] + +sconsbuild_dir = Dir('../sconsbuild') + + +def FilterOut(self, **kw): + kw = SCons.Environment.copy_non_reserved_keywords(kw) + for key, val in kw.items(): + envval = self.get(key, None) + if envval is None: + # No existing variable in the environment, so nothing to delete. + continue + + for vremove in val: + # Use while not if, so we can handle duplicates. + while vremove in envval: + envval.remove(vremove) + + self[key] = envval + + # TODO(sgk): SCons.Environment.Append() has much more logic to deal + # with various types of values. We should handle all those cases in here + # too. (If variable is a dict, etc.) + + +non_compilable_suffixes = { + 'LINUX' : set([ + '.bdic', + '.css', + '.dat', + '.fragment', + '.gperf', + '.h', + '.hh', + '.hpp', + '.html', + '.hxx', + '.idl', + '.in', + '.in0', + '.in1', + '.js', + '.mk', + '.rc', + '.sigs', + '', + ]), + 'WINDOWS' : set([ + '.h', + '.hh', + '.hpp', + '.dat', + '.idl', + '.in', + '.in0', + '.in1', + ]), +} + +def compilable(env, file): + base, ext = os.path.splitext(str(file)) + if ext in non_compilable_suffixes[env['TARGET_PLATFORM']]: + return False + return True + +def compilable_files(env, sources): + return [x for x in sources if compilable(env, x)] + +def GypProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def GypTestProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(*result) + return result + +def GypLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Library(target, source, *args, **kw) + return result + +def GypLoadableModule(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.LoadableModule(target, source, *args, **kw) + return result + +def GypStaticLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.StaticLibrary(target, source, *args, **kw) + return result + +def GypSharedLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.SharedLibrary(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def add_gyp_methods(env): + env.AddMethod(GypProgram) + env.AddMethod(GypTestProgram) + env.AddMethod(GypLibrary) + env.AddMethod(GypLoadableModule) + env.AddMethod(GypStaticLibrary) + env.AddMethod(GypSharedLibrary) + + env.AddMethod(FilterOut) + + env.AddMethod(compilable) + + +base_env = Environment( + tools = ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], + INTERMEDIATE_DIR='$OBJ_DIR/${COMPONENT_NAME}/_${TARGET_NAME}_intermediate', + LIB_DIR='$TOP_BUILDDIR/lib', + OBJ_DIR='$TOP_BUILDDIR/obj', + SCONSBUILD_DIR=sconsbuild_dir.abspath, + SHARED_INTERMEDIATE_DIR='$OBJ_DIR/_global_intermediate', + SRC_DIR=Dir('..'), + TARGET_PLATFORM='LINUX', + TOP_BUILDDIR='$SCONSBUILD_DIR/$CONFIG_NAME', + LIBPATH=['$LIB_DIR'], +) + +if not GetOption('verbose'): + base_env.SetDefault( + ARCOMSTR='Creating library $TARGET', + ASCOMSTR='Assembling $TARGET', + CCCOMSTR='Compiling $TARGET', + CONCATSOURCECOMSTR='ConcatSource $TARGET', + CXXCOMSTR='Compiling $TARGET', + LDMODULECOMSTR='Building loadable module $TARGET', + LINKCOMSTR='Linking $TARGET', + MANIFESTCOMSTR='Updating manifest for $TARGET', + MIDLCOMSTR='Compiling IDL $TARGET', + PCHCOMSTR='Precompiling $TARGET', + RANLIBCOMSTR='Indexing $TARGET', + RCCOMSTR='Compiling resource $TARGET', + SHCCCOMSTR='Compiling $TARGET', + SHCXXCOMSTR='Compiling $TARGET', + SHLINKCOMSTR='Linking $TARGET', + SHMANIFESTCOMSTR='Updating manifest for $TARGET', + ) + +add_gyp_methods(base_env) + +for conf in conf_list: + env = base_env.Clone(CONFIG_NAME=conf) + SConsignFile(env.File('$TOP_BUILDDIR/.sconsign').abspath) + for sconscript in sconscript_files: + target_alias = env.SConscript(sconscript, exports=['env']) + if target_alias: + target_alias_list.extend(target_alias) + +Default(Alias('all', target_alias_list)) + +help_fmt = ''' +Usage: hammer [SCONS_OPTIONS] [VARIABLES] [TARGET] ... + +Local command-line build options: + --mode=CONFIG Configuration to build: + --mode=Debug [default] + --mode=Release + --verbose Print actual executed command lines. + +Supported command-line build variables: + LOAD=[module,...] Comma-separated list of components to load in the + dependency graph ('-' prefix excludes) + PROGRESS=type Display a progress indicator: + name: print each evaluated target name + spinner: print a spinner every 5 targets + +The following TARGET names can also be used as LOAD= module names: + +%s +''' + +if GetOption('help'): + def columnar_text(items, width=78, indent=2, sep=2): + result = [] + colwidth = max(map(len, items)) + sep + cols = (width - indent) / colwidth + if cols < 1: + cols = 1 + rows = (len(items) + cols - 1) / cols + indent = '%*s' % (indent, '') + sep = indent + for row in xrange(0, rows): + result.append(sep) + for i in xrange(row, len(items), rows): + result.append('%-*s' % (colwidth, items[i])) + sep = '\n' + indent + result.append('\n') + return ''.join(result) + + load_list = set(sconscript_file_map.keys()) + target_aliases = set(map(str, target_alias_list)) + + common = load_list and target_aliases + load_only = load_list - common + target_only = target_aliases - common + help_text = [help_fmt % columnar_text(sorted(list(common)))] + if target_only: + fmt = "The following are additional TARGET names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(target_only)))) + if load_only: + fmt = "The following are additional LOAD= module names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(load_only)))) + Help(''.join(help_text)) diff --git a/build/apply_locales.py b/build/apply_locales.py new file mode 100755 index 0000000..6af7280 --- /dev/null +++ b/build/apply_locales.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# TODO: remove this script when GYP has for loops + +import sys +import optparse + +def main(argv): + + parser = optparse.OptionParser() + usage = 'usage: %s [options ...] format_string locale_list' + parser.set_usage(usage.replace('%s', '%prog')) + parser.add_option('-d', dest='dash_to_underscore', action="store_true", + default=False, + help='map "en-US" to "en" and "-" to "_" in locales') + + (options, arglist) = parser.parse_args(argv) + + if len(arglist) < 3: + print 'ERROR: need string and list of locales' + return 1 + + str_template = arglist[1] + locales = arglist[2:] + + results = [] + for locale in locales: + # For Cocoa to find the locale at runtime, it needs to use '_' instead + # of '-' (http://crbug.com/20441). Also, 'en-US' should be represented + # simply as 'en' (http://crbug.com/19165, http://crbug.com/25578). + if options.dash_to_underscore: + if locale == 'en-US': + locale = 'en' + locale = locale.replace('-', '_') + results.append(str_template.replace('ZZLOCALE', locale)) + + # Quote each element so filename spaces don't mess up GYP's attempt to parse + # it into a list. + print ' '.join(["'%s'" % x for x in results]) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/build/branding_value.sh b/build/branding_value.sh new file mode 100755 index 0000000..9fcb550 --- /dev/null +++ b/build/branding_value.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +# Copyright (c) 2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is a wrapper for fetching values from the BRANDING files. Pass the +# value of GYP's branding variable followed by the key you want and the right +# file is checked. +# +# branding_value.sh Chromium COPYRIGHT +# branding_value.sh Chromium PRODUCT_FULLNAME +# + +set -e + +if [ $# -ne 2 ] ; then + echo "error: expect two arguments, branding and key" >&2 + exit 1 +fi + +BUILD_BRANDING=$1 +THE_KEY=$2 + +pushd $(dirname "${0}") > /dev/null +BUILD_DIR=$(pwd) +popd > /dev/null + +TOP="${BUILD_DIR}/.." + +case ${BUILD_BRANDING} in + Chromium) + BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING" + ;; + Chrome) + BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING" + ;; + *) + echo "error: unknown branding: ${BUILD_BRANDING}" >&2 + exit 1 + ;; +esac + +BRANDING_VALUE=$(sed -n -e "s/^${THE_KEY}=\(.*\)\$/\1/p" "${BRANDING_FILE}") + +if [ -z "${BRANDING_VALUE}" ] ; then + echo "error: failed to find key '${THE_KEY}'" >&2 + exit 1 +fi + +echo "${BRANDING_VALUE}" diff --git a/build/build-bisect.py b/build/build-bisect.py new file mode 100755 index 0000000..64504bc --- /dev/null +++ b/build/build-bisect.py @@ -0,0 +1,284 @@ +#!/usr/bin/python2.5 +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Snapshot Build Bisect Tool + +This script bisects a snapshot archive using binary search. It starts at +a bad revision (it will try to guess HEAD) and asks for a last known-good +revision. It will then binary search across this revision range by downloading, +unzipping, and opening Chromium for you. After testing the specific revision, +it will ask you whether it is good or bad before continuing the search. +""" + +# Base URL to download snapshots from. +BUILD_BASE_URL = 'http://build.chromium.org/buildbot/snapshots/' + +# The type (platform) of the build archive. This is what's passed in to the +# '-a/--archive' option. +BUILD_ARCHIVE_TYPE = '' + +# The selected archive to bisect. +BUILD_ARCHIVE_DIR = '' + +# The location of the builds. +BUILD_ARCHIVE_URL = '/%d/' + +# Name of the build archive. +BUILD_ZIP_NAME = '' + +# Directory name inside the archive. +BUILD_DIR_NAME = '' + +# Name of the executable. +BUILD_EXE_NAME = '' + +# URL to the ViewVC commit page. +BUILD_VIEWVC_URL = 'http://src.chromium.org/viewvc/chrome?view=rev&revision=%d' + +# Changelogs URL +CHANGELOG_URL = 'http://build.chromium.org/buildbot/' \ + 'perf/dashboard/ui/changelog.html?url=/trunk/src&range=%d:%d' + +############################################################################### + +import math +import optparse +import os +import pipes +import re +import shutil +import sys +import tempfile +import urllib +import zipfile + + +def UnzipFilenameToDir(filename, dir): + """Unzip |filename| to directory |dir|.""" + zf = zipfile.ZipFile(filename) + # Make base. + pushd = os.getcwd() + try: + if not os.path.isdir(dir): + os.mkdir(dir) + os.chdir(dir) + # Extract files. + for info in zf.infolist(): + name = info.filename + if name.endswith('/'): # dir + if not os.path.isdir(name): + os.makedirs(name) + else: # file + dir = os.path.dirname(name) + if not os.path.isdir(dir): + os.makedirs(dir) + out = open(name, 'wb') + out.write(zf.read(name)) + out.close() + # Set permissions. Permission info in external_attr is shifted 16 bits. + os.chmod(name, info.external_attr >> 16L) + os.chdir(pushd) + except Exception, e: + print >>sys.stderr, e + sys.exit(1) + + +def SetArchiveVars(archive): + """Set a bunch of global variables appropriate for the specified archive.""" + global BUILD_ARCHIVE_TYPE + global BUILD_ARCHIVE_DIR + global BUILD_ZIP_NAME + global BUILD_DIR_NAME + global BUILD_EXE_NAME + global BUILD_BASE_URL + + BUILD_ARCHIVE_TYPE = archive + BUILD_ARCHIVE_DIR = 'chromium-rel-' + BUILD_ARCHIVE_TYPE + + if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): + BUILD_ZIP_NAME = 'chrome-linux.zip' + BUILD_DIR_NAME = 'chrome-linux' + BUILD_EXE_NAME = 'chrome' + elif BUILD_ARCHIVE_TYPE in ('mac'): + BUILD_ZIP_NAME = 'chrome-mac.zip' + BUILD_DIR_NAME = 'chrome-mac' + BUILD_EXE_NAME = 'Chromium.app/Contents/MacOS/Chromium' + elif BUILD_ARCHIVE_TYPE in ('xp'): + BUILD_ZIP_NAME = 'chrome-win32.zip' + BUILD_DIR_NAME = 'chrome-win32' + BUILD_EXE_NAME = 'chrome.exe' + + BUILD_BASE_URL += BUILD_ARCHIVE_DIR + +def ParseDirectoryIndex(url): + """Parses the HTML directory listing into a list of revision numbers.""" + handle = urllib.urlopen(url) + dirindex = handle.read() + handle.close() + return re.findall(r'<a href="([0-9]*)/">\1/</a>', dirindex) + +def GetRevList(good, bad): + """Gets the list of revision numbers between |good| and |bad|.""" + # Download the main revlist. + revlist = ParseDirectoryIndex(BUILD_BASE_URL) + revlist = map(int, revlist) + revlist = filter(lambda r: range(good, bad).__contains__(int(r)), revlist) + revlist.sort() + return revlist + +def TryRevision(rev, profile, args): + """Downloads revision |rev|, unzips it, and opens it for the user to test. + |profile| is the profile to use.""" + # Do this in a temp dir so we don't collide with user files. + cwd = os.getcwd() + tempdir = tempfile.mkdtemp(prefix='bisect_tmp') + os.chdir(tempdir) + + # Download the file. + download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME + try: + print 'Fetching ' + download_url + urllib.urlretrieve(download_url, BUILD_ZIP_NAME) + except Exception, e: + print('Could not retrieve the download. Sorry.') + sys.exit(-1) + + # Unzip the file. + print 'Unziping ...' + UnzipFilenameToDir(BUILD_ZIP_NAME, os.curdir) + + # Tell the system to open the app. + args = ['--user-data-dir=%s' % profile] + args + flags = ' '.join(map(pipes.quote, args)) + exe = os.path.join(os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME) + cmd = '%s %s' % (exe, flags) + print 'Running %s' % cmd + os.system(cmd) + + os.chdir(cwd) + print 'Cleaning temp dir ...' + try: + shutil.rmtree(tempdir, True) + except Exception, e: + pass + + +def AskIsGoodBuild(rev): + """Ask the user whether build |rev| is good or bad.""" + # Loop until we get a response that we can parse. + while True: + response = raw_input('\nBuild %d is [(g)ood/(b)ad]: ' % int(rev)) + if response and response in ('g', 'b'): + return response == 'g' + +def main(): + usage = ('%prog [options] [-- chromium-options]\n' + 'Perform binary search on the snapshot builds.') + parser = optparse.OptionParser(usage=usage) + # Strangely, the default help output doesn't include the choice list. + choices = ['mac', 'xp', 'linux', 'linux-64'] + parser.add_option('-a', '--archive', + choices = choices, + help = 'The buildbot archive to bisect [%s].' % + '|'.join(choices)) + parser.add_option('-b', '--bad', type = 'int', + help = 'The bad revision to bisect to.') + parser.add_option('-g', '--good', type = 'int', + help = 'The last known good revision to bisect from.') + parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', + help = 'Profile to use; this will not reset every run. ' + + 'Defaults to a clean profile.') + (opts, args) = parser.parse_args() + + if opts.archive is None: + parser.print_help() + return 1 + + if opts.bad and opts.good and (opts.good > opts.bad): + print ('The good revision (%d) must precede the bad revision (%d).\n' % + (opts.good, opts.bad)) + parser.print_help() + return 1 + + SetArchiveVars(opts.archive) + + # Pick a starting point, try to get HEAD for this. + if opts.bad: + bad_rev = opts.bad + else: + bad_rev = 0 + try: + # Location of the latest build revision number + BUILD_LATEST_URL = '%s/LATEST' % (BUILD_BASE_URL) + nh = urllib.urlopen(BUILD_LATEST_URL) + latest = int(nh.read()) + nh.close() + bad_rev = raw_input('Bad revision [HEAD:%d]: ' % latest) + if (bad_rev == ''): + bad_rev = latest + bad_rev = int(bad_rev) + except Exception, e: + print('Could not determine latest revision. This could be bad...') + bad_rev = int(raw_input('Bad revision: ')) + + # Find out when we were good. + if opts.good: + good_rev = opts.good + else: + good_rev = 0 + try: + good_rev = int(raw_input('Last known good [0]: ')) + except Exception, e: + pass + + # Get a list of revisions to bisect across. + revlist = GetRevList(good_rev, bad_rev) + if len(revlist) < 2: # Don't have enough builds to bisect + print 'We don\'t have enough builds to bisect. revlist: %s' % revlist + sys.exit(1) + + # If we don't have a |good_rev|, set it to be the first revision possible. + if good_rev == 0: + good_rev = revlist[0] + + # These are indexes of |revlist|. + good = 0 + bad = len(revlist) - 1 + last_known_good_rev = revlist[good] + + # Binary search time! + while good < bad: + candidates = revlist[good:bad] + num_poss = len(candidates) + if num_poss > 10: + print('%d candidates. %d tries left.' % + (num_poss, round(math.log(num_poss, 2)))) + else: + print('Candidates: %s' % revlist[good:bad]) + + # Cut the problem in half... + test = int((bad - good) / 2) + good + test_rev = revlist[test] + + # Let the user give this rev a spin (in her own profile, if she wants). + profile = opts.profile + if not profile: + profile = 'profile' # In a temp dir. + TryRevision(test_rev, profile, args) + if AskIsGoodBuild(test_rev): + last_known_good_rev = revlist[good] + good = test + 1 + else: + bad = test + + # We're done. Let the user know the results in an official manner. + print('You are probably looking for build %d.' % revlist[bad]) + print('CHANGELOG URL:') + print(CHANGELOG_URL % (last_known_good_rev, revlist[bad])) + print('Built at revision:') + print(BUILD_VIEWVC_URL % revlist[bad]) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/build/build_config.h b/build/build_config.h index b09aa51..bbc8236 100644 --- a/build/build_config.h +++ b/build/build_config.h @@ -32,6 +32,9 @@ #elif defined(__OpenBSD__) #define OS_OPENBSD 1 #define TOOLKIT_GTK +#elif defined(__sun) +#define OS_SOLARIS 1 +#define TOOLKIT_GTK #else #error Please add support for your platform in build/build_config.h #endif @@ -42,7 +45,8 @@ #define TOOLKIT_USES_GTK 1 #endif -#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) +#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) || \ + defined(OS_SOLARIS) #define USE_NSS 1 // Use NSS for crypto. #define USE_X11 1 // Use X for graphics. #endif @@ -56,17 +60,22 @@ // For access to standard POSIXish features, use OS_POSIX instead of a // more specific macro. #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ - defined(OS_OPENBSD) + defined(OS_OPENBSD) || defined(OS_SOLARIS) #define OS_POSIX 1 // Use base::DataPack for name/value pairs. #define USE_BASE_DATA_PACK 1 #endif // Use tcmalloc -#if defined(OS_WIN) && !defined(NO_TCMALLOC) +#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(NO_TCMALLOC) #define USE_TCMALLOC 1 #endif +// Use heapchecker. +#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(NO_HEAPCHECKER) +#define USE_HEAPCHECKER 1 +#endif + // Compiler detection. #if defined(__GNUC__) #define COMPILER_GCC 1 diff --git a/build/common.croc b/build/common.croc new file mode 100644 index 0000000..5588990 --- /dev/null +++ b/build/common.croc @@ -0,0 +1,127 @@ +# -*- python -*- +# Crocodile config file for Chromium - settings common to all platforms +# +# This should be speicified before the platform-specific config, for example: +# croc -c chrome_common.croc -c linux/chrome_linux.croc + +{ + # List of root directories, applied in order + 'roots' : [ + # Sub-paths we specifically care about and want to call out + { + 'root' : '_/src', + 'altname' : 'CHROMIUM', + }, + ], + + # List of rules, applied in order + # Note that any 'include':0 rules here will be overridden by the 'include':1 + # rules in the platform-specific configs. + 'rules' : [ + # Don't scan for executable lines in uninstrumented C++ header files + { + 'regexp' : '.*\\.(h|hpp)$', + 'add_if_missing' : 0, + }, + + # Groups + { + 'regexp' : '', + 'group' : 'source', + }, + { + 'regexp' : '.*_(test|unittest)\\.', + 'group' : 'test', + }, + + # Languages + { + 'regexp' : '.*\\.(c|h)$', + 'language' : 'C', + }, + { + 'regexp' : '.*\\.(cc|cpp|hpp)$', + 'language' : 'C++', + }, + + # Files/paths to include. Specify these before the excludes, since rules + # are in order. + { + 'regexp' : '^CHROMIUM/(base|media|net|printing|chrome|webkit/glue|native_client)/', + 'include' : 1, + }, + # Don't include subversion or mercurial SCM dirs + { + 'regexp' : '.*/(\\.svn|\\.hg)/', + 'include' : 0, + }, + # Don't include output dirs + { + 'regexp' : '.*/(Debug|Release|sconsbuild|out|xcodebuild)/', + 'include' : 0, + }, + # Don't include third-party source + { + 'regexp' : '.*/third_party/', + 'include' : 0, + }, + # We don't run the V8 test suite, so we don't care about V8 coverage. + { + 'regexp' : '.*/v8/', + 'include' : 0, + }, + ], + + # Paths to add source from + 'add_files' : [ + 'CHROMIUM' + ], + + # Statistics to print + 'print_stats' : [ + { + 'stat' : 'files_executable', + 'format' : '*RESULT FilesKnown: files_executable= %d files', + }, + { + 'stat' : 'files_instrumented', + 'format' : '*RESULT FilesInstrumented: files_instrumented= %d files', + }, + { + 'stat' : '100.0 * files_instrumented / files_executable', + 'format' : '*RESULT FilesInstrumentedPercent: files_instrumented_percent= %g', + }, + { + 'stat' : 'lines_executable', + 'format' : '*RESULT LinesKnown: lines_known= %d lines', + }, + { + 'stat' : 'lines_instrumented', + 'format' : '*RESULT LinesInstrumented: lines_instrumented= %d lines', + }, + { + 'stat' : 'lines_covered', + 'format' : '*RESULT LinesCoveredSource: lines_covered_source= %d lines', + 'group' : 'source', + }, + { + 'stat' : 'lines_covered', + 'format' : '*RESULT LinesCoveredTest: lines_covered_test= %d lines', + 'group' : 'test', + }, + { + 'stat' : '100.0 * lines_covered / lines_executable', + 'format' : '*RESULT PercentCovered: percent_covered= %g', + }, + { + 'stat' : '100.0 * lines_covered / lines_executable', + 'format' : '*RESULT PercentCoveredSource: percent_covered_source= %g', + 'group' : 'source', + }, + { + 'stat' : '100.0 * lines_covered / lines_executable', + 'format' : '*RESULT PercentCoveredTest: percent_covered_test= %g', + 'group' : 'test', + }, + ], +} diff --git a/build/common.gypi b/build/common.gypi new file mode 100644 index 0000000..3026274 --- /dev/null +++ b/build/common.gypi @@ -0,0 +1,1440 @@ +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# IMPORTANT: +# Please don't directly include this file if you are building via gyp_chromium, +# since gyp_chromium is automatically forcing its inclusion. +{ + 'variables': { + # .gyp files or targets should set chromium_code to 1 if they build + # Chromium-specific code, as opposed to external code. This variable is + # used to control such things as the set of warnings to enable, and + # whether warnings are treated as errors. + 'chromium_code%': 0, + + 'internal_pdf%': 0, + + # This allows to use libcros from the current system, ie. /usr/lib/ + # The cros_api will be pulled in as a static library, and all headers + # from the system include dirs. + 'system_libcros%': '0', + + # Variables expected to be overriden on the GYP command line (-D) or by + # ~/.gyp/include.gypi. + + # Putting a variables dict inside another variables dict looks kind of + # weird. This is done so that "branding" and "buildtype" are defined as + # variables within the outer variables dict here. This is necessary + # to get these variables defined for the conditions within this variables + # dict that operate on these variables. + 'variables': { + # Override branding to select the desired branding flavor. + 'branding%': 'Chromium', + + # Override buildtype to select the desired build flavor. + # Dev - everyday build for development/testing + # Official - release build (generally implies additional processing) + # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp + # conversion is done), some of the things which are now controlled by + # 'branding', such as symbol generation, will need to be refactored based + # on 'buildtype' (i.e. we don't care about saving symbols for non-Official + # builds). + 'buildtype%': 'Dev', + + 'variables': { + # Compute the architecture that we're building on. + 'conditions': [ + [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + # This handles the Linux platforms we generally deal with. Anything + # else gets passed through, which probably won't work very well; such + # hosts should pass an explicit target_arch to gyp. + 'host_arch%': + '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', + }, { # OS!="linux" + 'host_arch%': 'ia32', + }], + ], + + # Whether we're building a ChromeOS build. We set the initial + # value at this level of nesting so it's available for the + # toolkit_views test below. + 'chromeos%': '0', + + # To do a shared build on linux we need to be able to choose between + # type static_library and shared_library. We default to doing a static + # build but you can override this with "gyp -Dlibrary=shared_library" + # or you can add the following line (without the #) to + # ~/.gyp/include.gypi {'variables': {'library': 'shared_library'}} + # to compile as shared by default + 'library%': 'static_library', + }, + + # Set default value of toolkit_views on for Windows and Chrome OS. + # We set it at this level of nesting so the value is available for + # other conditionals below. + 'conditions': [ + ['OS=="win" or chromeos==1', { + 'toolkit_views%': 1, + }, { + 'toolkit_views%': 0, + }], + ], + + 'host_arch%': '<(host_arch)', + + # Default architecture we're building for is the architecture we're + # building on. + 'target_arch%': '<(host_arch)', + + # We do want to build Chromium with Breakpad support in certain + # situations. I.e. for Chrome bot. + 'linux_chromium_breakpad%': 0, + # And if we want to dump symbols. + 'linux_chromium_dump_symbols%': 0, + # Also see linux_strip_binary below. + + # Copy conditionally-set chromeos variable out one scope. + 'chromeos%': '<(chromeos)', + + # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are + # are built under a chromium full build (1) or a webkit.org chromium + # build (0). + 'inside_chromium_build%': 1, + + # Set to 1 to enable fast builds. It disables debug info for fastest + # compilation. + 'fastbuild%': 0, + + # Set to 1 compile with -fPIC cflag on linux. This is a must for shared + # libraries on linux x86-64 and arm. + 'linux_fpic%': 0, + + # Python version. + 'python_ver%': '2.5', + + # Set ARM-v7 compilation flags + 'armv7%': 0, + + # Set Neon compilation flags (only meaningful if armv7==1). + 'arm_neon%': 1, + + # The system root for cross-compiles. Default: none. + 'sysroot%': '', + + # On Linux, we build with sse2 for Chromium builds. + 'disable_sse2%': 0, + + # Remoting compilation is enabled by default. Set to 0 to disable. + 'remoting%': 1, + + 'library%': '<(library)', + + # Variable 'component' is for cases where we would like to build some + # components as dynamic shared libraries but still need variable + # 'library' for static libraries. + # By default, component is set to whatever library is set to and + # it can be overriden by the GYP command line or by ~/.gyp/include.gypi. + 'component%': '<(library)', + }, + + # Define branding and buildtype on the basis of their settings within the + # variables sub-dict above, unless overridden. + 'branding%': '<(branding)', + 'buildtype%': '<(buildtype)', + 'target_arch%': '<(target_arch)', + 'host_arch%': '<(host_arch)', + 'toolkit_views%': '<(toolkit_views)', + 'chromeos%': '<(chromeos)', + 'inside_chromium_build%': '<(inside_chromium_build)', + 'fastbuild%': '<(fastbuild)', + 'linux_fpic%': '<(linux_fpic)', + 'python_ver%': '<(python_ver)', + 'armv7%': '<(armv7)', + 'arm_neon%': '<(arm_neon)', + 'sysroot%': '<(sysroot)', + 'disable_sse2%': '<(disable_sse2)', + 'remoting%': '<(remoting)', + 'library%': '<(library)', + 'component%': '<(component)', + + # The release channel that this build targets. This is used to restrict + # channel-specific build options, like which installer packages to create. + # The default is 'all', which does no channel-specific filtering. + 'channel%': 'all', + + # Override chromium_mac_pch and set it to 0 to suppress the use of + # precompiled headers on the Mac. Prefix header injection may still be + # used, but prefix headers will not be precompiled. This is useful when + # using distcc to distribute a build to compile slaves that don't + # share the same compiler executable as the system driving the compilation, + # because precompiled headers rely on pointers into a specific compiler + # executable's image. Setting this to 0 is needed to use an experimental + # Linux-Mac cross compiler distcc farm. + 'chromium_mac_pch%': 1, + + # Mac OS X SDK and deployment target support. + # The SDK identifies the version of the system headers that will be used, + # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro. + # "Maximum allowed" refers to the operating system version whose APIs are + # available in the headers. + # The deployment target identifies the minimum system version that the + # built products are expected to function on. It corresponds to the + # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. + # To ensure these macros are available, #include <AvailabilityMacros.h>. + # Additional documentation on these macros is available at + # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 + # Chrome normally builds with the Mac OS X 10.5 SDK and sets the + # deployment target to 10.5. Other projects, such as O3D, may override + # these defaults. + 'mac_sdk%': '10.5', + 'mac_deployment_target%': '10.5', + + # Set to 1 to enable code coverage. In addition to build changes + # (e.g. extra CFLAGS), also creates a new target in the src/chrome + # project file called "coverage". + # Currently ignored on Windows. + 'coverage%': 0, + + # Overridable specification for potential use of alternative + # JavaScript engines. + 'javascript_engine%': 'v8', + + # Although base/allocator lets you select a heap library via an + # environment variable, the libcmt shim it uses sometimes gets in + # the way. To disable it entirely, and switch to normal msvcrt, do e.g. + # 'win_use_allocator_shim': 0, + # 'win_release_RuntimeLibrary': 2 + # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build. + 'win_use_allocator_shim%': 1, # 1 = shim allocator via libcmt; 0 = msvcrt + + # Whether usage of OpenMAX is enabled. + 'enable_openmax%': 0, + + # Whether proprietary audio/video codecs are assumed to be included with + # this build (only meaningful if branding!=Chrome). + 'proprietary_codecs%': 0, + + # TODO(bradnelson): eliminate this when possible. + # To allow local gyp files to prevent release.vsprops from being included. + # Yes(1) means include release.vsprops. + # Once all vsprops settings are migrated into gyp, this can go away. + 'msvs_use_common_release%': 1, + + # TODO(bradnelson): eliminate this when possible. + # To allow local gyp files to override additional linker options for msvs. + # Yes(1) means set use the common linker options. + 'msvs_use_common_linker_extras%': 1, + + # TODO(sgk): eliminate this if possible. + # It would be nicer to support this via a setting in 'target_defaults' + # in chrome/app/locales/locales.gypi overriding the setting in the + # 'Debug' configuration in the 'target_defaults' dict below, + # but that doesn't work as we'd like. + 'msvs_debug_link_incremental%': '2', + + # This is the location of the sandbox binary. Chrome looks for this before + # running the zygote process. If found, and SUID, it will be used to + # sandbox the zygote process and, thus, all renderer processes. + 'linux_sandbox_path%': '', + + # Set this to true to enable SELinux support. + 'selinux%': 0, + + # Strip the binary after dumping symbols. + 'linux_strip_binary%': 0, + + # Enable TCMalloc. + 'linux_use_tcmalloc%': 1, + + # Disable TCMalloc's debugallocation. + 'linux_use_debugallocation%': 0, + + # Disable TCMalloc's heapchecker. + 'linux_use_heapchecker%': 0, + + # Set to 1 to turn on seccomp sandbox by default. + # (Note: this is ignored for official builds.) + 'linux_use_seccomp_sandbox%': 0, + + # Set to 1 to link against libgnome-keyring instead of using dlopen(). + 'linux_link_gnome_keyring%': 0, + + # Set to select the Title Case versions of strings in GRD files. + 'use_titlecase_in_grd_files%': 0, + + # Used to disable Native Client at compile time, for platforms where it + # isn't supported + 'disable_nacl%': 0, + + # Set Thumb compilation flags. + 'arm_thumb%': 0, + + # Set ARM fpu compilation flags (only meaningful if armv7==1 and + # arm_neon==0). + 'arm_fpu%': 'vfpv3', + + # Enable new NPDevice API. + 'enable_new_npdevice_api%': 0, + + # Enable EGLImage support in OpenMAX + 'enable_eglimage%': 0, + + # Enable a variable used elsewhere throughout the GYP files to determine + # whether to compile in the sources for the GPU plugin / process. + 'enable_gpu%': 1, + + 'conditions': [ + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + # This will set gcc_version to XY if you are running gcc X.Y.*. + # This is used to tweak build flags for gcc 4.4. + 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', + # Figure out the python architecture to decide if we build pyauto. + 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)', + 'conditions': [ + ['branding=="Chrome" or linux_chromium_breakpad==1', { + 'linux_breakpad%': 1, + }, { + 'linux_breakpad%': 0, + }], + # All Chrome builds have breakpad symbols, but only process the + # symbols from official builds. + # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and + # crash server handle 64-bit symbols. + ['linux_chromium_dump_symbols==1 or ' + '(branding=="Chrome" and buildtype=="Official" and ' + 'target_arch=="ia32")', { + 'linux_dump_symbols%': 1, + }, { + 'linux_dump_symbols%': 0, + }], + ['toolkit_views==0', { + # GTK wants Title Case strings + 'use_titlecase_in_grd_files%': 1, + }], + ], + }], # OS=="linux" or OS=="freebsd" or OS=="openbsd" + ['OS=="mac"', { + # Mac wants Title Case strings + 'use_titlecase_in_grd_files%': 1, + 'conditions': [ + # mac_product_name is set to the name of the .app bundle as it should + # appear on disk. This duplicates data from + # chrome/app/theme/chromium/BRANDING and + # chrome/app/theme/google_chrome/BRANDING, but is necessary to get + # these names into the build system. + ['branding=="Chrome"', { + 'mac_product_name%': 'Google Chrome', + }, { # else: branding!="Chrome" + 'mac_product_name%': 'Chromium', + }], + + # Feature variables for enabling Mac Breakpad and Keystone auto-update + # support. Both features are on by default in official builds with + # Chrome branding. + ['branding=="Chrome" and buildtype=="Official"', { + 'mac_breakpad%': 1, + 'mac_keystone%': 1, + }, { # else: branding!="Chrome" or buildtype!="Official" + 'mac_breakpad%': 0, + 'mac_keystone%': 0, + }], + ], + }], # OS=="mac" + # Whether to use multiple cores to compile with visual studio. This is + # optional because it sometimes causes corruption on VS 2005. + # It is on by default on VS 2008 and off on VS 2005. + ['OS=="win"', { + 'conditions': [ + ['component=="shared_library"', { + 'win_use_allocator_shim%': 0, + }], + + ['MSVS_VERSION=="2005"', { + 'msvs_multi_core_compile%': 0, + },{ + 'msvs_multi_core_compile%': 1, + }], + # Don't do incremental linking for large modules on 32-bit. + ['MSVS_OS_BITS==32', { + 'msvs_large_module_debug_link_mode%': '1', # No + },{ + 'msvs_large_module_debug_link_mode%': '2', # Yes + }], + ], + 'nacl_win64_defines': [ + # This flag is used to minimize dependencies when building + # Native Client loader for 64-bit Windows. + 'NACL_WIN64', + ], + }], + ], + + # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' + # so Cocoa is happy (http://crbug.com/20441). + 'locales': [ + 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', + 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he', + 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv', + 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', + 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk', + 'vi', 'zh-CN', 'zh-TW', + ], + + # Disable touch support by default. + 'touchui%': 0, + }, + 'target_defaults': { + 'variables': { + # The condition that operates on chromium_code is in a target_conditions + # section, and will not have access to the default fallback value of + # chromium_code at the top of this file, or to the chromium_code + # variable placed at the root variables scope of .gyp files, because + # those variables are not set at target scope. As a workaround, + # if chromium_code is not set at target scope, define it in target scope + # to contain whatever value it has during early variable expansion. + # That's enough to make it available during target conditional + # processing. + 'chromium_code%': '<(chromium_code)', + + # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html + 'mac_release_optimization%': '3', # Use -O3 unless overridden + 'mac_debug_optimization%': '0', # Use -O0 unless overridden + # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx + 'win_release_Optimization%': '2', # 2 = /Os + 'win_debug_Optimization%': '0', # 0 = /Od + # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx + 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off + # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx + 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, + 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max + + 'release_extra_cflags%': '', + 'debug_extra_cflags%': '', + 'release_valgrind_build%': 0, + + 'conditions': [ + ['OS=="win" and component=="shared_library"', { + # See http://msdn.microsoft.com/en-us/library/aa652367.aspx + 'win_release_RuntimeLibrary%': '2', # 2 = /MT (nondebug DLL) + 'win_debug_RuntimeLibrary%': '3', # 3 = /MTd (debug DLL) + }, { + # See http://msdn.microsoft.com/en-us/library/aa652367.aspx + 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) + 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) + }], + ], + }, + 'conditions': [ + ['branding=="Chrome"', { + 'defines': ['GOOGLE_CHROME_BUILD'], + }, { # else: branding!="Chrome" + 'defines': ['CHROMIUM_BUILD'], + }], + ['toolkit_views==1', { + 'defines': ['TOOLKIT_VIEWS=1'], + }], + ['chromeos==1', { + 'defines': ['OS_CHROMEOS=1'], + }], + ['touchui==1', { + 'defines': ['TOUCH_UI=1'], + }], + ['remoting==1', { + 'defines': ['ENABLE_REMOTING=1'], + }], + ['proprietary_codecs==1', { + 'defines': ['USE_PROPRIETARY_CODECS'], + }], + ['fastbuild!=0', { + 'conditions': [ + # For Windows, we don't genererate debug information. + ['OS=="win"', { + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'false', + }, + 'VCCLCompilerTool': { + 'DebugInformationFormat': '0', + } + } + }, { # else: OS != "win", generate less debug information. + 'variables': { + 'debug_extra_cflags': '-g1', + }, + }], + ], # conditions for fastbuild. + }], # fastbuild!=0 + ['selinux==1', { + 'defines': ['CHROMIUM_SELINUX=1'], + }], + ['win_use_allocator_shim==0', { + 'conditions': [ + ['OS=="win"', { + 'defines': ['NO_TCMALLOC'], + }], + ], + }], + ['enable_gpu==1', { + 'defines': [ + 'ENABLE_GPU=1', + ], + }], + ['enable_eglimage==1', { + 'defines': [ + 'ENABLE_EGLIMAGE=1', + ], + }], + ['coverage!=0', { + 'conditions': [ + ['OS=="mac"', { + 'xcode_settings': { + 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs + 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage + }, + # Add -lgcov for types executable, shared_library, and + # loadable_module; not for static_library. + # This is a delayed conditional. + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, + }], + ], + }], + # Linux gyp (into scons) doesn't like target_conditions? + # TODO(???): track down why 'target_conditions' doesn't work + # on Linux gyp into scons like it does on Mac gyp into xcodeproj. + ['OS=="linux"', { + 'cflags': [ '-ftest-coverage', + '-fprofile-arcs' ], + 'link_settings': { 'libraries': [ '-lgcov' ] }, + }], + # Finally, for Windows, we simply turn on profiling. + ['OS=="win"', { + 'msvs_settings': { + 'VCLinkerTool': { + 'Profile': 'true', + }, + 'VCCLCompilerTool': { + # /Z7, not /Zi, so coverage is happyb + 'DebugInformationFormat': '1', + 'AdditionalOptions': ['/Yd'], + } + } + }], # OS==win + ], # conditions for coverage + }], # coverage!=0 + ], # conditions for 'target_defaults' + 'target_conditions': [ + ['chromium_code==0', { + 'conditions': [ + [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + 'cflags!': [ + '-Wall', + '-Wextra', + '-Werror', + ], + }], + [ 'OS=="win"', { + 'defines': [ + '_CRT_SECURE_NO_DEPRECATE', + '_CRT_NONSTDC_NO_WARNINGS', + '_CRT_NONSTDC_NO_DEPRECATE', + '_SCL_SECURE_NO_DEPRECATE', + ], + 'msvs_disabled_warnings': [4800], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'false', + 'Detect64BitPortabilityProblems': 'false', + }, + }, + }], + [ 'OS=="mac"', { + 'xcode_settings': { + 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', + 'WARNING_CFLAGS!': ['-Wall', '-Wextra'], + }, + }], + ], + }, { + # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the + # C99 macros on Mac and Linux. + 'defines': [ + '__STDC_FORMAT_MACROS', + ], + 'conditions': [ + ['OS!="win"', { + 'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'], + ['exclude', '/win/'], + ['exclude', '/win_[^/]*\\.cc$'] ], + }], + ['OS!="mac"', { + 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'], + ['exclude', '/(cocoa|mac)/'], + ['exclude', '\.mm?$' ] ], + }], + ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', { + 'sources/': [ + ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'], + ['exclude', '/gtk/'], + ['exclude', '/(gtk|x11)_[^/]*\\.cc$'], + ], + }], + ['OS!="linux"', { + 'sources/': [ + ['exclude', '_linux(_unittest)?\\.cc$'], + ['exclude', '/linux/'], + ], + }], + # We use "POSIX" to refer to all non-Windows operating systems. + ['OS=="win"', { + 'sources/': [ ['exclude', '_posix\\.cc$'] ], + # turn on warnings for signed/unsigned mismatch on chromium code. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': ['/we4389'], + }, + }, + }], + ['chromeos!=1', { + 'sources/': [ ['exclude', '_chromeos\\.cc$'] ] + }], + ['toolkit_views==0', { + 'sources/': [ ['exclude', '_views\\.cc$'] ] + }], + ], + }], + ], # target_conditions for 'target_defaults' + 'default_configuration': 'Debug', + 'configurations': { + # VCLinkerTool LinkIncremental values below: + # 0 == default + # 1 == /INCREMENTAL:NO + # 2 == /INCREMENTAL + # Debug links incremental, Release does not. + # + # Abstract base configurations to cover common + # attributes. + # + 'Common_Base': { + 'abstract': 1, + 'msvs_configuration_attributes': { + 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', + 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', + 'CharacterSet': '1', + }, + }, + 'x86_Base': { + 'abstract': 1, + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '1', + }, + }, + 'msvs_configuration_platform': 'Win32', + }, + 'x64_Base': { + 'abstract': 1, + 'msvs_configuration_platform': 'x64', + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '17', # x86 - 64 + 'AdditionalLibraryDirectories!': + ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], + 'AdditionalLibraryDirectories': + ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], + }, + 'VCLibrarianTool': { + 'AdditionalLibraryDirectories!': + ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], + 'AdditionalLibraryDirectories': + ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], + }, + }, + 'defines': [ + # Not sure if tcmalloc works on 64-bit Windows. + 'NO_TCMALLOC', + ], + }, + 'Debug_Base': { + 'abstract': 1, + 'defines': ['DYNAMIC_ANNOTATIONS_ENABLED=1'], + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'NO', + 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', + 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ], + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_debug_Optimization)', + 'PreprocessorDefinitions': ['_DEBUG'], + 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', + 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_debug_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_debug_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_debug_InlineFunctionExpansion)', + }], + ], + }, + 'VCLinkerTool': { + 'LinkIncremental': '<(msvs_debug_link_incremental)', + }, + 'VCResourceCompilerTool': { + 'PreprocessorDefinitions': ['_DEBUG'], + }, + }, + 'conditions': [ + ['OS=="linux"', { + 'cflags': [ + '<@(debug_extra_cflags)', + ], + }], + ], + }, + 'Release_Base': { + 'abstract': 1, + 'defines': [ + 'NDEBUG', + ], + 'xcode_settings': { + 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip + 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', + 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_release_Optimization)', + 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_release_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_release_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_release_InlineFunctionExpansion)', + }], + ], + }, + 'VCLinkerTool': { + 'LinkIncremental': '1', + }, + }, + 'conditions': [ + ['release_valgrind_build==0', { + 'defines': ['NVALGRIND', 'DYNAMIC_ANNOTATIONS_ENABLED=0'], + }, { + 'defines': ['DYNAMIC_ANNOTATIONS_ENABLED=1'], + }], + ['win_use_allocator_shim==0', { + 'defines': ['NO_TCMALLOC'], + }], + ['OS=="linux"', { + 'cflags': [ + '<@(release_extra_cflags)', + ], + }], + ], + }, + 'Purify_Base': { + 'abstract': 1, + 'defines': [ + 'PURIFY', + 'NO_TCMALLOC', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + 'RuntimeLibrary': '0', + 'BufferSecurityCheck': 'false', + }, + 'VCLinkerTool': { + 'EnableCOMDATFolding': '1', + 'LinkIncremental': '1', + }, + }, + }, + # + # Concrete configurations + # + 'Debug': { + 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'], + }, + 'Release': { + 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'], + 'conditions': [ + ['msvs_use_common_release', { + 'includes': ['release.gypi'], + }], + ] + }, + 'conditions': [ + [ 'OS=="win"', { + # TODO(bradnelson): add a gyp mechanism to make this more graceful. + 'Purify': { + 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'], + }, + 'Debug_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'], + }, + 'Release_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'], + }, + 'Purify_x64': { + 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'], + }, + }], + ], + }, + }, + 'conditions': [ + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { + 'target_defaults': { + # Enable -Werror by default, but put it in a variable so it can + # be disabled in ~/.gyp/include.gypi on the valgrind builders. + 'variables': { + # Use -fno-strict-aliasing by default since gcc 4.4 has periodic + # issues that slip through the cracks. We could do this just for + # gcc 4.4 but it makes more sense to be consistent on all + # compilers in use. TODO(Craig): turn this off again when + # there is some 4.4 test infrastructure in place and existing + # aliasing issues have been fixed. + 'no_strict_aliasing%': 1, + 'conditions': [['OS=="linux"', {'werror%': '-Werror',}], + ['OS=="freebsd"', {'werror%': '',}], + ['OS=="openbsd"', {'werror%': '',}], + ], + }, + 'cflags': [ + '<(werror)', # See note above about the werror variable. + '-pthread', + '-fno-exceptions', + '-Wall', + # TODO(evan): turn this back on once all the builds work. + # '-Wextra', + # Don't warn about unused function params. We use those everywhere. + '-Wno-unused-parameter', + # Don't warn about the "struct foo f = {0};" initialization pattern. + '-Wno-missing-field-initializers', + '-D_FILE_OFFSET_BITS=64', + # Don't export any symbols (for example, to plugins we dlopen()). + # Note: this is *required* to make some plugins work. + '-fvisibility=hidden', + ], + 'cflags_cc': [ + '-fno-rtti', + '-fno-threadsafe-statics', + # Make inline functions have hidden visiblity by default. + # Surprisingly, not covered by -fvisibility=hidden. + '-fvisibility-inlines-hidden', + ], + 'ldflags': [ + '-pthread', '-Wl,-z,noexecstack', + ], + 'scons_variable_settings': { + 'LIBPATH': ['$LIB_DIR'], + # Linking of large files uses lots of RAM, so serialize links + # using the handy flock command from util-linux. + 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + + # We have several cases where archives depend on each other in + # a cyclic fashion. Since the GNU linker does only a single + # pass over the archives we surround the libraries with + # --start-group and --end-group (aka -( and -) ). That causes + # ld to loop over the group until no more undefined symbols + # are found. In an ideal world we would only make groups from + # those libraries which we knew to be in cycles. However, + # that's tough with SCons, so we bodge it by making all the + # archives a group by redefining the linking command here. + # + # TODO: investigate whether we still have cycles that + # require --{start,end}-group. There has been a lot of + # refactoring since this was first coded, which might have + # eliminated the circular dependencies. + # + # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS + # so that we prefer our own built libraries (e.g. -lpng) to + # system versions of libraries that pkg-config might turn up. + # TODO(sgk): investigate handling this not by re-ordering the + # flags this way, but by adding a hook to use the SCons + # ParseFlags() option on the output from pkg-config. + 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', + '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', + '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], + 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', + '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', + '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], + 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', + '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', + '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']], + 'IMPLICIT_COMMAND_DEPENDENCIES': 0, + # -rpath is only used when building with shared libraries. + 'conditions': [ + [ 'library=="shared_library"', { + 'RPATH': '$LIB_DIR', + }], + ], + }, + 'scons_import_variables': [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'scons_propagate_variables': [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + 'configurations': { + 'Debug_Base': { + 'variables': { + 'debug_optimize%': '0', + }, + 'defines': [ + '_DEBUG', + ], + 'cflags': [ + '-O>(debug_optimize)', + '-g', + # One can use '-gstabs' to enable building the debugging + # information in STABS format for breakpad's dumpsyms. + ], + 'ldflags': [ + '-rdynamic', # Allows backtrace to resolve symbols. + ], + }, + 'Release_Base': { + 'variables': { + 'release_optimize%': '2', + # Binaries become big and gold is unable to perform GC + # and remove unused sections for some of test targets + # on 32 bit platform. + # (This is currently observed only in chromeos valgrind bots) + # The following flag is to disable --gc-sections linker + # option for these bots. + 'no_gc_sections%': 0, + }, + 'cflags': [ + '-O>(release_optimize)', + # Don't emit the GCC version ident directives, they just end up + # in the .comment section taking up binary size. + '-fno-ident', + # Put data and code in their own sections, so that unused symbols + # can be removed at link time with --gc-sections. + '-fdata-sections', + '-ffunction-sections', + ], + 'conditions' : [ + ['no_gc_sections==0', { + 'ldflags': [ + '-Wl,--gc-sections', + ], + }], + ] + }, + }, + 'variants': { + 'coverage': { + 'cflags': ['-fprofile-arcs', '-ftest-coverage'], + 'ldflags': ['-fprofile-arcs'], + }, + 'profile': { + 'cflags': ['-pg', '-g'], + 'ldflags': ['-pg'], + }, + 'symbols': { + 'cflags': ['-g'], + }, + }, + 'conditions': [ + [ 'target_arch=="ia32"', { + 'asflags': [ + # Needed so that libs with .s files (e.g. libicudata.a) + # are compatible with the general 32-bit-ness. + '-32', + ], + # All floating-point computations on x87 happens in 80-bit + # precision. Because the C and C++ language standards allow + # the compiler to keep the floating-point values in higher + # precision than what's specified in the source and doing so + # is more efficient than constantly rounding up to 64-bit or + # 32-bit precision as specified in the source, the compiler, + # especially in the optimized mode, tries very hard to keep + # values in x87 floating-point stack (in 80-bit precision) + # as long as possible. This has important side effects, that + # the real value used in computation may change depending on + # how the compiler did the optimization - that is, the value + # kept in 80-bit is different than the value rounded down to + # 64-bit or 32-bit. There are possible compiler options to make + # this behavior consistent (e.g. -ffloat-store would keep all + # floating-values in the memory, thus force them to be rounded + # to its original precision) but they have significant runtime + # performance penalty. + # + # -mfpmath=sse -msse2 makes the compiler use SSE instructions + # which keep floating-point values in SSE registers in its + # native precision (32-bit for single precision, and 64-bit for + # double precision values). This means the floating-point value + # used during computation does not change depending on how the + # compiler optimized the code, since the value is always kept + # in its specified precision. + 'conditions': [ + ['branding=="Chromium" and disable_sse2==0', { + 'cflags': [ + '-march=pentium4', + '-msse2', + '-mfpmath=sse', + ], + }], + # ChromeOS targets Pinetrail, which is sse3, but most of the + # benefit comes from sse2 so this setting allows ChromeOS + # to build on other CPUs. In the future -march=atom would help + # but requires a newer compiler. + ['chromeos==1 and disable_sse2==0', { + 'cflags': [ + '-msse2', + ], + }], + # Install packages have started cropping up with + # different headers between the 32-bit and 64-bit + # versions, so we have to shadow those differences off + # and make sure a 32-bit-on-64-bit build picks up the + # right files. + ['host_arch!="ia32"', { + 'include_dirs+': [ + '/usr/include32', + ], + }], + ], + # -mmmx allows mmintrin.h to be used for mmx intrinsics. + # video playback is mmx and sse2 optimized. + 'cflags': [ + '-m32', + '-mmmx', + ], + 'ldflags': [ + '-m32', + ], + }], + ['target_arch=="arm"', { + 'target_conditions': [ + ['_toolset=="target"', { + 'cflags_cc': [ + # The codesourcery arm-2009q3 toolchain warns at that the ABI + # has changed whenever it encounters a varargs function. This + # silences those warnings, as they are not helpful and + # clutter legitimate warnings. + '-Wno-abi', + ], + 'conditions': [ + ['arm_thumb == 1', { + 'cflags': [ + '-mthumb', + # TODO(piman): -Wa,-mimplicit-it=thumb is needed for + # inline assembly that uses condition codes but it's + # suboptimal. Better would be to #ifdef __thumb__ at the + # right place and have a separate thumb path. + '-Wa,-mimplicit-it=thumb', + ] + }], + ['armv7==1', { + 'cflags': [ + '-march=armv7-a', + '-mtune=cortex-a8', + '-mfloat-abi=softfp', + ], + 'conditions': [ + ['arm_neon==1', { + 'cflags': [ '-mfpu=neon', ], + }, { + 'cflags': [ '-mfpu=<(arm_fpu)', ], + }] + ], + }], + ], + }], + ], + }], + ['linux_fpic==1', { + 'cflags': [ + '-fPIC', + ], + }], + ['sysroot!=""', { + 'target_conditions': [ + ['_toolset=="target"', { + 'cflags': [ + '--sysroot=<(sysroot)', + ], + 'ldflags': [ + '--sysroot=<(sysroot)', + ], + }]] + }], + ['no_strict_aliasing==1', { + 'cflags': [ + '-fno-strict-aliasing', + ], + }], + ['linux_breakpad==1', { + 'cflags': [ '-gstabs' ], + 'defines': ['USE_LINUX_BREAKPAD'], + }], + ['linux_use_seccomp_sandbox==1 and buildtype!="Official"', { + 'defines': ['USE_SECCOMP_SANDBOX'], + }], + ['library=="shared_library"', { + # When building with shared libraries, remove the visiblity-hiding + # flag. + 'cflags!': [ '-fvisibility=hidden' ], + 'conditions': [ + ['target_arch=="x64" or target_arch=="arm"', { + # Shared libraries need -fPIC on x86-64 and arm + 'cflags': ['-fPIC'] + }] + ], + }], + ['linux_use_heapchecker==1', { + 'variables': {'linux_use_tcmalloc%': 1}, + }], + ['linux_use_tcmalloc==0', { + 'defines': ['NO_TCMALLOC'], + }], + ['linux_use_heapchecker==0', { + 'defines': ['NO_HEAPCHECKER'], + }], + ], + }, + }], + # FreeBSD-specific options; note that most FreeBSD options are set above, + # with Linux. + ['OS=="freebsd"', { + 'target_defaults': { + 'ldflags': [ + '-Wl,--no-keep-memory', + ], + }, + }], + ['OS=="solaris"', { + 'cflags!': ['-fvisibility=hidden'], + 'cflags_cc!': ['-fvisibility-inlines-hidden'], + }], + ['OS=="mac"', { + 'target_defaults': { + 'variables': { + # This should be 'mac_real_dsym%', but there seems to be a bug + # with % in variables that are intended to be set to different + # values in different targets, like this one. + 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. + }, + 'mac_bundle': 0, + 'xcode_settings': { + 'ALWAYS_SEARCH_USER_PATHS': 'NO', + 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99 + 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks + 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic + # (Equivalent to -fPIC) + 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions + 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti + 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings + # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', + 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden + 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics + 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror + 'GCC_VERSION': '4.2', + 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof + # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min + 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', + 'PREBINDING': 'NO', # No -Wl,-prebind + 'USE_HEADERMAP': 'NO', + 'WARNING_CFLAGS': [ + '-Wall', + '-Wendif-labels', + '-Wextra', + # Don't warn about unused function parameters. + '-Wno-unused-parameter', + # Don't warn about the "struct foo f = {0};" initialization + # pattern. + '-Wno-missing-field-initializers', + ], + 'conditions': [ + ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'}, + {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'} + ], + ], + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, + }], + ['_mac_bundle', { + 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, + }], + ['_type=="executable" or _type=="shared_library" or _type=="loadable_module"', { + 'target_conditions': [ + ['mac_real_dsym == 1', { + # To get a real .dSYM bundle produced by dsymutil, set the + # debug information format to dwarf-with-dsym. Since + # strip_from_xcode will not be used, set Xcode to do the + # stripping as well. + 'configurations': { + 'Release_Base': { + 'xcode_settings': { + 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', + 'DEPLOYMENT_POSTPROCESSING': 'YES', + 'STRIP_INSTALLED_PRODUCT': 'YES', + 'target_conditions': [ + ['_type=="shared_library" or _type=="loadable_module"', { + # The Xcode default is to strip debugging symbols + # only (-S). Local symbols should be stripped as + # well, which will be handled by -x. Xcode will + # continue to insert -S when stripping even when + # additional flags are added with STRIPFLAGS. + 'STRIPFLAGS': '-x', + }], # _type=="shared_library" or _type=="loadable_module"' + ], # target_conditions + }, # xcode_settings + }, # configuration "Release" + }, # configurations + }, { # mac_real_dsym != 1 + # To get a fast fake .dSYM bundle, use a post-build step to + # produce the .dSYM and strip the executable. strip_from_xcode + # only operates in the Release configuration. + 'postbuilds': [ + { + 'variables': { + # Define strip_from_xcode in a variable ending in _path + # so that gyp understands it's a path and performs proper + # relativization during dict merging. + 'strip_from_xcode_path': 'mac/strip_from_xcode', + }, + 'postbuild_name': 'Strip If Needed', + 'action': ['<(strip_from_xcode_path)'], + }, + ], # postbuilds + }], # mac_real_dsym + ], # target_conditions + }], # _type=="executable" or _type=="shared_library" or _type=="loadable_module" + ], # target_conditions + }, # target_defaults + }], # OS=="mac" + ['OS=="win"', { + 'target_defaults': { + 'defines': [ + '_WIN32_WINNT=0x0600', + 'WINVER=0x0600', + 'WIN32', + '_WINDOWS', + 'NOMINMAX', + '_CRT_RAND_S', + 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', + 'WIN32_LEAN_AND_MEAN', + '_SECURE_ATL', + '_ATL_NO_OPENGL', + '_HAS_TR1=0', + ], + 'conditions': [ + ['component=="static_library"', { + 'defines': [ + '_HAS_EXCEPTIONS=0', + ], + }], + ], + + 'msvs_system_include_dirs': [ + '<(DEPTH)/third_party/platformsdk_win7/files/Include', + '<(DEPTH)/third_party/directxsdk/files/Include', + '$(VSInstallDir)/VC/atlmfc/include', + ], + 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], + 'msvs_disabled_warnings': [4351, 4396, 4503, 4819], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'MinimalRebuild': 'false', + 'BufferSecurityCheck': 'true', + 'EnableFunctionLevelLinking': 'true', + 'RuntimeTypeInfo': 'false', + 'WarningLevel': '3', + 'WarnAsError': 'true', + 'DebugInformationFormat': '3', + 'conditions': [ + [ 'msvs_multi_core_compile', { + 'AdditionalOptions': ['/MP'], + }], + + ['component=="shared_library"', { + 'ExceptionHandling': '1', # /EHsc + }, { + 'ExceptionHandling': '0', + }], + ], + }, + 'VCLibrarianTool': { + 'AdditionalOptions': ['/ignore:4221'], + 'AdditionalLibraryDirectories': [ + '<(DEPTH)/third_party/platformsdk_win7/files/Lib', + '<(DEPTH)/third_party/directxsdk/files/Lib/x86', + ], + }, + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wininet.lib', + 'version.lib', + 'msimg32.lib', + 'ws2_32.lib', + 'usp10.lib', + 'psapi.lib', + 'dbghelp.lib', + ], + 'AdditionalLibraryDirectories': [ + '<(DEPTH)/third_party/platformsdk_win7/files/Lib', + '<(DEPTH)/third_party/directxsdk/files/Lib/x86', + ], + 'GenerateDebugInformation': 'true', + 'MapFileName': '$(OutDir)\\$(TargetName).map', + 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib', + 'FixedBaseAddress': '1', + # SubSystem values: + # 0 == not set + # 1 == /SUBSYSTEM:CONSOLE + # 2 == /SUBSYSTEM:WINDOWS + # Most of the executables we'll ever create are tests + # and utilities with console output. + 'SubSystem': '1', + }, + 'VCMIDLTool': { + 'GenerateStublessProxies': 'true', + 'TypeLibraryName': '$(InputName).tlb', + 'OutputDirectory': '$(IntDir)', + 'HeaderFileName': '$(InputName).h', + 'DLLDataFileName': 'dlldata.c', + 'InterfaceIdentifierFileName': '$(InputName)_i.c', + 'ProxyFileName': '$(InputName)_p.c', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + 'AdditionalIncludeDirectories': [ + '<(DEPTH)', + '<(SHARED_INTERMEDIATE_DIR)', + ], + }, + }, + }, + }], + ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { + 'target_defaults': { + 'defines': [ + 'DISABLE_NACL', + ], + }, + }], + ['OS=="win" and msvs_use_common_linker_extras', { + 'target_defaults': { + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': [ + 'dbghelp.dll', + 'dwmapi.dll', + 'uxtheme.dll', + ], + }, + }, + 'configurations': { + 'x86_Base': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/ignore:4221', + '/nxcompat', + ], + }, + }, + }, + 'x64_Base': { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + # safeseh is not compatible with x64 + '/dynamicbase', + '/ignore:4199', + '/ignore:4221', + '/nxcompat', + ], + }, + }, + }, + }, + }, + }], + ['enable_new_npdevice_api==1', { + 'target_defaults': { + 'defines': [ + 'ENABLE_NEW_NPDEVICE_API', + ], + }, + }], + ], + 'scons_settings': { + 'sconsbuild_dir': '<(DEPTH)/sconsbuild', + 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], + }, + 'xcode_settings': { + # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! + # This block adds *project-wide* configuration settings to each project + # file. It's almost always wrong to put things here. Specify your + # custom xcode_settings in target_defaults to add them to targets instead. + + # In an Xcode Project Info window, the "Base SDK for All Configurations" + # setting sets the SDK on a project-wide basis. In order to get the + # configured SDK to show properly in the Xcode UI, SDKROOT must be set + # here at the project level. + 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot + + # The Xcode generator will look for an xcode_settings section at the root + # of each dict and use it to apply settings on a file-wide basis. Most + # settings should not be here, they should be in target-specific + # xcode_settings sections, or better yet, should use non-Xcode-specific + # settings in target dicts. SYMROOT is a special case, because many other + # Xcode variables depend on it, including variables such as + # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something + # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the + # files to appear (when present) in the UI as actual files and not red + # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, + # and therefore SYMROOT, needs to be set at the project level. + 'SYMROOT': '<(DEPTH)/xcodebuild', + }, +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/compiler_version.py b/build/compiler_version.py new file mode 100755 index 0000000..69f0a50 --- /dev/null +++ b/build/compiler_version.py @@ -0,0 +1,50 @@ +#!/usr/bin/python + +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Compiler version checking tool for gcc + +Print gcc version as XY if you are running gcc X.Y.*. +This is used to tweak build flags for gcc 4.4. +""" + +import os +import re +import subprocess +import sys + +def GetVersion(compiler): + try: + # Note that compiler could be something tricky like "distcc g++". + compiler = compiler + " -dumpversion" + pipe = subprocess.Popen(compiler, stdout=subprocess.PIPE, shell=True) + gcc_output = pipe.communicate()[0] + result = re.match(r"(\d+)\.(\d+)", gcc_output) + return result.group(1) + result.group(2) + except Exception, e: + print >> sys.stderr, "compiler_version.py failed to execute:", compiler + print >> sys.stderr, e + return "" + +def main(): + # Check if CXX environment variable exists and + # if it does use that compiler. + cxx = os.getenv("CXX", None) + if cxx: + cxxversion = GetVersion(cxx) + if cxxversion != "": + print cxxversion + return 0 + else: + # Otherwise we check the g++ version. + gccversion = GetVersion("g++") + if gccversion != "": + print gccversion + return 0 + + return 1 + +if __name__ == "__main__": + sys.exit(main()) diff --git a/build/features_override.gypi b/build/features_override.gypi new file mode 100644 index 0000000..2e19776 --- /dev/null +++ b/build/features_override.gypi @@ -0,0 +1,83 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file is only included in full-chromium builds, and overrides the +# feature_defines variable in third_party/WebKit/WebKit/chromium/features.gypi. +{ + 'variables': { + # WARNING: This list of strings completely replaces the list in + # features.gypi. Therefore, if an enable is listed in features.gypi + # but not listed below, it will revert to its hardcoded webkit value. + 'feature_defines': [ + 'ENABLE_3D_CANVAS=1', + 'ENABLE_BLOB_SLICE=1', + 'ENABLE_CHANNEL_MESSAGING=1', + 'ENABLE_DASHBOARD_SUPPORT=0', + 'ENABLE_DATABASE=1', + 'ENABLE_DATAGRID=0', + 'ENABLE_DIRECTORY_UPLOAD=1', + 'ENABLE_DOM_STORAGE=1', + 'ENABLE_EVENTSOURCE=1', + 'ENABLE_FILE_READER=1', + 'ENABLE_FILTERS=1', + 'ENABLE_GEOLOCATION=1', + 'ENABLE_ICONDATABASE=0', + 'ENABLE_INDEXED_DATABASE=1', + 'ENABLE_JAVASCRIPT_DEBUGGER=1', + 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_METER_TAG=1', + 'ENABLE_NOTIFICATIONS=1', + 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', + 'ENABLE_OPENTYPE_SANITIZER=1', + 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_PROGRESS_TAG=1', + 'ENABLE_RUBY=1', + 'ENABLE_SANDBOX=1', + 'ENABLE_SHARED_WORKERS=1', + 'ENABLE_SVG=<(enable_svg)', + 'ENABLE_SVG_ANIMATION=<(enable_svg)', + 'ENABLE_SVG_AS_IMAGE=<(enable_svg)', + 'ENABLE_SVG_FONTS=<(enable_svg)', + 'ENABLE_SVG_FOREIGN_OBJECT=<(enable_svg)', + 'ENABLE_SVG_USE=<(enable_svg)', + 'ENABLE_TOUCH_EVENTS=<(enable_touch_events)', + 'ENABLE_V8_SCRIPT_DEBUG_SERVER=1', + 'ENABLE_VIDEO=1', + 'ENABLE_WEB_SOCKETS=1', + 'ENABLE_WEB_TIMING=1', + 'ENABLE_WORKERS=1', + 'ENABLE_XPATH=1', + 'ENABLE_XSLT=1', + ], + # We have to nest variables inside variables so that they can be overridden + # through GYP_DEFINES. + 'variables': { + 'use_accelerated_compositing%': 0, + 'enable_svg%': 1, + 'enable_touch_events%': 1, + }, + 'use_accelerated_compositing%': '<(use_accelerated_compositing)', + 'enable_svg%': '<(enable_svg)', + 'enable_touch_events%': '<(enable_touch_events)', + 'conditions': [ + ['OS=="win" or OS=="linux" or use_accelerated_compositing==1', { + 'feature_defines': [ + 'WTF_USE_ACCELERATED_COMPOSITING=1', + 'ENABLE_3D_RENDERING=1', + ], + 'use_accelerated_compositing': 1, + }], + ], + # TODO: If the need arises, create a mechanism that will intelligently + # merge the lists rather than replace one with the other. This may + # require changes in gyp. + }, + +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/gyp_chromium b/build/gyp_chromium new file mode 100755 index 0000000..174ea29 --- /dev/null +++ b/build/gyp_chromium @@ -0,0 +1,97 @@ +#!/usr/bin/python + +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This script is wrapper for Chromium that adds some support for how GYP +# is invoked by Chromium beyond what can be done in the gclient hooks. + +import glob +import os +import shlex +import sys + +script_dir = os.path.dirname(__file__) +chrome_src = os.path.normpath(os.path.join(script_dir, os.pardir)) + +sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) +import gyp + +def additional_include_files(args=[]): + """ + Returns a list of additional (.gypi) files to include, without + duplicating ones that are already specified on the command line. + """ + # Determine the include files specified on the command line. + # This doesn't cover all the different option formats you can use, + # but it's mainly intended to avoid duplicating flags on the automatic + # makefile regeneration which only uses this format. + specified_includes = set() + for arg in args: + if arg.startswith('-I') and len(arg) > 2: + specified_includes.add(os.path.realpath(arg[2:])) + + result = [] + def AddInclude(path): + if os.path.realpath(path) not in specified_includes: + result.append(path) + + # Always include common.gypi & features_override.gypi + AddInclude(os.path.join(script_dir, 'common.gypi')) + AddInclude(os.path.join(script_dir, 'features_override.gypi')) + + # Optionally add supplemental .gypi files if present. + supplements = glob.glob(os.path.join(chrome_src, '*', 'supplement.gypi')) + for supplement in supplements: + AddInclude(supplement) + + return result + +if __name__ == '__main__': + args = sys.argv[1:] + + # This could give false positives since it doesn't actually do real option + # parsing. Oh well. + gyp_file_specified = False + for arg in args: + if arg.endswith('.gyp'): + gyp_file_specified = True + break + + # If we didn't get a file, check an env var, and then fall back to + # assuming 'all.gyp' from the same directory as the script. + if not gyp_file_specified: + gyp_file = os.environ.get('CHROMIUM_GYP_FILE') + if gyp_file: + # Note that CHROMIUM_GYP_FILE values can't have backslashes as + # path separators even on Windows due to the use of shlex.split(). + args.extend(shlex.split(gyp_file)) + else: + args.append(os.path.join(script_dir, 'all.gyp')) + + args.extend(['-I' + i for i in additional_include_files(args)]) + + # There shouldn't be a circular dependency relationship between .gyp files, + # but in Chromium's .gyp files, on non-Mac platforms, circular relationships + # currently exist. The check for circular dependencies is currently + # bypassed on other platforms, but is left enabled on the Mac, where a + # violation of the rule causes Xcode to misbehave badly. + # TODO(mark): Find and kill remaining circular dependencies, and remove this + # option. http://crbug.com/35878. + # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the + # list. + if sys.platform not in ('darwin',): + args.append('--no-circular-check') + + # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check + # to enfore syntax checking. + syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') + if syntax_check and int(syntax_check): + args.append('--check') + + print 'Updating projects from gyp files...' + sys.stdout.flush() + + # Off we go... + sys.exit(gyp.main(args)) diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh new file mode 100755 index 0000000..41289cf --- /dev/null +++ b/build/install-build-deps.sh @@ -0,0 +1,456 @@ +#!/bin/bash -e + +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Script to install everything needed to build chromium (well, ideally, anyway) +# See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions +# and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit + +usage() { + echo "Usage: $0 [--options]" + echo "Options:" + echo "--[no-]syms: enable or disable installation of debugging symbols" + echo "--[no-]gold: enable or disable installation of gold linker" + echo "--[no-]lib32: enable or disable installation of 32 bit libraries" + echo "Script will prompt interactively if options not given." + exit 1 +} + +while test "$1" != "" +do + case "$1" in + --syms) do_inst_syms=1;; + --no-syms) do_inst_syms=0;; + --gold) do_inst_gold=1;; + --no-gold) do_inst_gold=0;; + --lib32) do_inst_lib32=1;; + --no-lib32) do_inst_lib32=0;; + *) usage;; + esac + shift +done + +install_gold() { + # Gold is optional; it's a faster replacement for ld, + # and makes life on 2GB machines much more pleasant. + + # First make sure root can access this directory, as that's tripped + # up some folks. + if sudo touch xyz.$$ + then + sudo rm xyz.$$ + else + echo root cannot write to the current directory, not installing gold + return + fi + + BINUTILS=binutils-2.20.1 + BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 + BINUTILS_SHA1=fd2ba806e6f3a55cee453cb25c86991b26a75dee + + test -f $BINUTILS.tar.bz2 || wget $BINUTILS_URL + if test "`sha1sum $BINUTILS.tar.bz2|cut -d' ' -f1`" != "$BINUTILS_SHA1" + then + echo Bad sha1sum for $BINUTILS.tar.bz2 + exit 1 + fi + + tar -xjvf $BINUTILS.tar.bz2 + cd $BINUTILS + ./configure --prefix=/usr/local/gold --enable-gold + make -j3 + if sudo make install + then + # Still need to figure out graceful way of pointing gyp to use + # /usr/local/gold/bin/ld without requiring him to set environment + # variables. That will go into bootstrap-linux.sh when it's ready. + echo "Installing gold as /usr/bin/ld." + echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" + test -f /usr/bin/ld && test ! -f /usr/bin/ld.orig && \ + sudo mv /usr/bin/ld /usr/bin/ld.orig + sudo strip /usr/local/gold/bin/ld + sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold + sudo ln -fs /usr/bin/ld.gold /usr/bin/ld + else + echo "make install failed, not installing gold" + fi +} + +if ! egrep -q \ + 'Ubuntu (8\.04|8\.10|9\.04|9\.10|10\.04|10\.10|karmic|lucid|maverick)' \ + /etc/issue; then + echo "Only Ubuntu 8.04 (hardy) through 10.10 (maverick) are currently" \ + "supported" >&2 + exit 1 +fi + +if ! uname -m | egrep -q "i686|x86_64"; then + echo "Only x86 architectures are currently supported" >&2 + exit +fi + +if [ "x$(id -u)" != x0 ]; then + echo "Running as non-root user." + echo "You might have to enter your password one or more times for 'sudo'." + echo +fi + +# Packages needed for chromeos only +chromeos_dev_list="libpulse-dev" + +# Packages need for development +dev_list="apache2 bison fakeroot flex g++ gperf libapache2-mod-php5 + libasound2-dev libbz2-dev libcairo2-dev libdbus-glib-1-dev + libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libglib2.0-dev + libgnome-keyring-dev libgtk2.0-dev libjpeg62-dev libnspr4-dev + libnss3-dev libpam0g-dev libsqlite3-dev libxslt1-dev libxss-dev + lighttpd mesa-common-dev msttcorefonts patch perl php5-cgi pkg-config + python python-dev rpm subversion ttf-dejavu-core ttf-kochi-gothic + ttf-kochi-mincho wdiff libcurl4-gnutls-dev $chromeos_dev_list" + +# Run-time libraries required by chromeos only +chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev" + +# Full list of required run-time libraries +lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libdbus-glib-1-2 libexpat1 + libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 + libnspr4-0d libnss3-1d libpango1.0-0 libpcre3 libpixman-1-0 libpng12-0 + libstdc++6 libsqlite3-0 libx11-6 libxau6 libxcb1 libxcomposite1 + libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 + libxinerama1 libxrandr2 libxrender1 zlib1g $chromeos_lib_list" + +# Debugging symbols for all of the run-time libraries +dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg + libfontconfig1-dbg libglib2.0-0-dbg libgtk2.0-0-dbg libnspr4-0d-dbg + libnss3-1d-dbg libpango1.0-0-dbg libpcre3-dbg libpixman-1-0-dbg + libx11-6-dbg libxau6-dbg libxcb1-dbg libxcomposite1-dbg + libxcursor1-dbg libxdamage1-dbg libxdmcp6-dbg libxext6-dbg + libxfixes3-dbg libxi6-dbg libxinerama1-dbg libxrandr2-dbg + libxrender1-dbg zlib1g-dbg" + +# CUPS package changed its name from hardy to the next version. Include +# proper package here depending on the system. +if egrep -q 'Ubuntu (8\.04|8\.10)' /etc/issue; then + dev_list="${dev_list} libcupsys2-dev" +else + dev_list="${dev_list} libcups2-dev" +fi + +# Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is +# accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has +# been provided to yes_no(), the function also accepts RETURN as a user input. +# The parameter specifies the exit code that should be returned in that case. +# The function will echo the user's selection followed by a newline character. +# Users can abort the function by pressing CTRL-C. This will call "exit 1". +yes_no() { + local c + while :; do + c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT + stty -echo iuclc -icanon 2>/dev/null + dd count=1 bs=1 2>/dev/null | od -An -tx1)" + case "$c" in + " 0a") if [ -n "$1" ]; then + [ $1 -eq 0 ] && echo "Y" || echo "N" + return $1 + fi + ;; + " 79") echo "Y" + return 0 + ;; + " 6e") echo "N" + return 1 + ;; + "") echo "Aborted" >&2 + exit 1 + ;; + *) # The user pressed an unrecognized key. As we are not echoing + # any incorrect user input, alert the user by ringing the bell. + (tput bel) 2>/dev/null + ;; + esac + done +} + +if test "$do_inst_syms" = "" +then + echo "This script installs all tools and libraries needed to build Chromium." + echo "" + echo "For most of the libraries, it can also install debugging symbols, which" + echo "will allow you to debug code in the system libraries. Most developers" + echo "won't need these symbols." + echo -n "Do you want me to install them for you (y/N) " + if yes_no 1; then + do_inst_syms=1 + fi +fi +if test "$do_inst_syms" = "1"; then + echo "Installing debugging symbols." +else + echo "Skipping installation of debugging symbols." + dbg_list= +fi + +sudo apt-get update + +# We initially run "apt-get" with the --reinstall option and parse its output. +# This way, we can find all the packages that need to be newly installed +# without accidentally promoting any packages from "auto" to "manual". +# We then re-run "apt-get" with just the list of missing packages. +echo "Finding missing packages..." +packages="${dev_list} ${lib_list} ${dbg_list}" +# Intentially leaving $packages unquoted so it's more readable. +echo "Packages required: " $packages +echo +new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" +if new_list="$(yes n | LANG=C $new_list_cmd)"; then + # We probably never hit this following line. + echo "No missing packages, and the packages are up-to-date." +elif [ $? -eq 1 ]; then + # We expect apt-get to have exit status of 1. + # This indicates that we canceled the install with "yes n|". + new_list=$(echo "$new_list" | + sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d') + new_list=$(echo "$new_list" | sed 's/ *$//') + if [ -z "$new_list" ] ; then + echo "No missing packages, and the packages are up-to-date." + else + echo "Installing missing packages: $new_list." + sudo apt-get install ${new_list} + fi + echo +else + # An apt-get exit status of 100 indicates that a real error has occurred. + + # I am intentionally leaving out the '"'s around new_list_cmd, + # as this makes it easier to cut and paste the output + echo "The following command failed: " ${new_list_cmd} + echo + echo "It produces the following output:" + yes n | $new_list_cmd || true + echo + echo "You will have to install the above packages yourself." + echo + exit 100 +fi + +# Some operating systems already ship gold (on recent Debian and +# Ubuntu you can do "apt-get install binutils-gold" to get it), but +# older releases didn't. Additionally, gold 2.20 (included in Ubuntu +# Lucid) makes binaries that just segfault. +# So install from source if we don't have a good version. + +case `ld --version` in +*gold*2.20.1*) ;; +*gold*2.2[1-9]*) ;; +* ) + if test "$do_inst_gold" = "" + then + echo "Gold is a new linker that links Chrome 5x faster than ld." + echo "Don't use it if you need to link other apps (e.g. valgrind, wine)" + echo -n "REPLACE SYSTEM LINKER ld with gold and back up ld? (y/N) " + if yes_no 1; then + do_inst_gold=1 + fi + fi + if test "$do_inst_gold" = "1" + then + # If the system provides a good version of gold, just install it. + if apt-cache show binutils-gold | grep -Eq 'Version: 2.2(0.1|[1-9]*)'; then + echo "Installing binutils-gold. Backing up ld as ld.single." + sudo apt-get install binutils-gold + else + # FIXME: avoid installing as /usr/bin/ld + echo "Building binutils. Backing up ld as ld.orig." + install_gold || exit 99 + fi + else + echo "Not installing gold." + fi +esac + +# Install 32bit backwards compatibility support for 64bit systems +if [ "$(uname -m)" = "x86_64" ]; then + if test "$do_inst_lib32" = "" + then + echo "Installing 32bit libraries not already provided by the system" + echo + echo "This is only needed to build a 32-bit Chrome on your 64-bit system." + echo + echo "While we only need to install a relatively small number of library" + echo "files, we temporarily need to download a lot of large *.deb packages" + echo "that contain these files. We will create new *.deb packages that" + echo "include just the 32bit libraries. These files will then be found on" + echo "your system in places like /lib32, /usr/lib32, /usr/lib/debug/lib32," + echo "/usr/lib/debug/usr/lib32. If you ever need to uninstall these files," + echo "look for packages named *-ia32.deb." + echo "Do you want me to download all packages needed to build new 32bit" + echo -n "package files (Y/n) " + if yes_no 0; then + do_inst_lib32=1 + fi + fi + if test "$do_inst_lib32" != "1" + then + echo "Exiting without installing any 32bit libraries." + exit 0 + fi + + # Standard 32bit compatibility libraries + echo "First, installing the limited existing 32-bit support..." + cmp_list="ia32-libs lib32asound2-dev lib32readline5-dev lib32stdc++6 lib32z1 + lib32z1-dev libc6-dev-i386 libc6-i386 g++-multilib" + sudo apt-get install $cmp_list + + tmp=/tmp/install-32bit.$$ + trap 'rm -rf "${tmp}"' EXIT INT TERM QUIT + mkdir -p "${tmp}/apt/lists/partial" "${tmp}/cache" "${tmp}/partial" + touch "${tmp}/status" + + [ -r /etc/apt/apt.conf ] && cp /etc/apt/apt.conf "${tmp}/apt/" + cat >>"${tmp}/apt/apt.conf" <<EOF + Apt::Architecture "i386"; + Dir::Cache "${tmp}/cache"; + Dir::Cache::Archives "${tmp}/"; + Dir::State::Lists "${tmp}/apt/lists/"; + Dir::State::status "${tmp}/status"; +EOF + + # Download 32bit packages + echo "Computing list of available 32bit packages..." + sudo apt-get -c="${tmp}/apt/apt.conf" update + + echo "Downloading available 32bit packages..." + sudo apt-get -c="${tmp}/apt/apt.conf" \ + --yes --download-only --force-yes --reinstall install \ + ${lib_list} ${dbg_list} + + # Open packages, remove everything that is not a library, move the + # library to a lib32 directory and package everything as a *.deb file. + echo "Repackaging and installing 32bit packages for use on 64bit systems..." + for i in ${lib_list} ${dbg_list}; do + orig="$(echo "${tmp}/${i}"_*_i386.deb)" + compat="$(echo "${orig}" | + sed -e 's,\(_[^_/]*_\)i386\(.deb\),-ia32\1amd64\2,')" + rm -rf "${tmp}/staging" + msg="$(fakeroot -u sh -exc ' + # Unpack 32bit Debian archive + umask 022 + mkdir -p "'"${tmp}"'/staging/dpkg/DEBIAN" + cd "'"${tmp}"'/staging" + ar x "'${orig}'" + tar zCfx dpkg data.tar.gz + tar zCfx dpkg/DEBIAN control.tar.gz + + # Create a posix extended regular expression fragment that will + # recognize the includes which have changed. Should be rare, + # will almost always be empty. + includes=`sed -n -e "s/^[0-9a-z]* //g" \ + -e "\,usr/include/,p" dpkg/DEBIAN/md5sums | + xargs -n 1 -I FILE /bin/sh -c \ + "cmp -s dpkg/FILE /FILE || echo FILE" | + tr "\n" "|" | + sed -e "s,|$,,"` + + # If empty, set it to not match anything. + test -z "$includes" && includes="^//" + + # Turn the conflicts into an extended RE for removal from the + # Provides line. + conflicts=`sed -n -e "/Conflicts/s/Conflicts: *//;T;s/, */|/g;p" \ + dpkg/DEBIAN/control` + + # Rename package, change architecture, remove conflicts and dependencies + sed -r -i \ + -e "/Package/s/$/-ia32/" \ + -e "/Architecture/s/:.*$/: amd64/" \ + -e "/Depends/s/:.*/: ia32-libs/" \ + -e "/Provides/s/($conflicts)(, *)?//g;T1;s/, *$//;:1" \ + -e "/Recommends/d" \ + -e "/Conflicts/d" \ + dpkg/DEBIAN/control + + # Only keep files that live in "lib" directories or the includes + # that have changed. + sed -r -i \ + -e "/\/lib64\//d" -e "/\/.?bin\//d" \ + -e "\,$includes,s,[ /]include/,&32/,g;s,include/32/,include32/,g" \ + -e "s, lib/, lib32/,g" \ + -e "s,/lib/,/lib32/,g" \ + -e "t;d" \ + -e "\,^/usr/lib32/debug\(.*/lib32\),s,^/usr/lib32/debug,/usr/lib/debug," \ + dpkg/DEBIAN/md5sums + + # Re-run ldconfig after installation/removal + { echo "#!/bin/sh"; echo "[ \"x\$1\" = xconfigure ]&&ldconfig||:"; } \ + >dpkg/DEBIAN/postinst + { echo "#!/bin/sh"; echo "[ \"x\$1\" = xremove ]&&ldconfig||:"; } \ + >dpkg/DEBIAN/postrm + chmod 755 dpkg/DEBIAN/postinst dpkg/DEBIAN/postrm + + # Remove any other control files + find dpkg/DEBIAN -mindepth 1 "(" -name control -o -name md5sums -o \ + -name postinst -o -name postrm ")" -o -print | + xargs -r rm -rf + + # Remove any files/dirs that live outside of "lib" directories, + # or are not in our list of changed includes. + find dpkg -mindepth 1 -regextype posix-extended \ + "(" -name DEBIAN -o -name lib -o -regex "dpkg/($includes)" ")" \ + -prune -o -print | tac | + xargs -r -n 1 sh -c "rm \$0 2>/dev/null || rmdir \$0 2>/dev/null || : " + find dpkg -name lib64 -o -name bin -o -name "?bin" | + tac | xargs -r rm -rf + + # Remove any symbolic links that were broken by the above steps. + find -L dpkg -type l -print | tac | xargs -r rm -rf + + # Rename lib to lib32, but keep debug symbols in /usr/lib/debug/usr/lib32 + # That is where gdb looks for them. + find dpkg -type d -o -path "*/lib/*" -print | + xargs -r -n 1 sh -c " + i=\$(echo \"\${0}\" | + sed -e s,/lib/,/lib32/,g \ + -e s,/usr/lib32/debug\\\\\(.*/lib32\\\\\),/usr/lib/debug\\\\1,); + mkdir -p \"\${i%/*}\"; + mv \"\${0}\" \"\${i}\"" + + # Rename include to include32. + [ -d "dpkg/usr/include" ] && mv "dpkg/usr/include" "dpkg/usr/include32" + + # Prune any empty directories + find dpkg -type d | tac | xargs -r -n 1 rmdir 2>/dev/null || : + + # Create our own Debian package + cd .. + dpkg --build staging/dpkg .' 2>&1)" + compat="$(eval echo $(echo "${compat}" | + sed -e 's,_[^_/]*_amd64.deb,_*_amd64.deb,'))" + [ -r "${compat}" ] || { + echo "${msg}" >&2 + echo "Failed to build new Debian archive!" >&2 + exit 1 + } + + msg="$(sudo dpkg -i "${compat}" 2>&1)" && { + echo "Installed ${compat##*/}" + } || { + # echo "${msg}" >&2 + echo "Skipped ${compat##*/}" + } + done + + # Add symbolic links for developing 32bit code + echo "Adding missing symbolic links, enabling 32bit code development..." + for i in $(find /lib32 /usr/lib32 -maxdepth 1 -name \*.so.\* | + sed -e 's/[.]so[.][0-9].*/.so/' | + sort -u); do + [ "x${i##*/}" = "xld-linux.so" ] && continue + [ -r "$i" ] && continue + j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | + sort -n | tail -n 1)" + [ -r "$i.$j" ] || continue + sudo ln -s "${i##*/}.$j" "$i" + done +fi diff --git a/build/internal/README.chromium b/build/internal/README.chromium new file mode 100644 index 0000000..4624830 --- /dev/null +++ b/build/internal/README.chromium @@ -0,0 +1,24 @@ +Internal property sheets: + essential.vsprops + Contains the common settings used throughout the projects. Is included by either ..\debug.vsprops or ..\release.vsprops, so in general, it is not included directly. + + release_defaults.vsprops + Included by ..\release.vsprops. Its settings are overriden by release_impl$(CHROME_BUILD_TYPE).vsprops. Uses the default VS setting which is "Maximize Speed". Results in relatively fast build with reasonable optimization level but without whole program optimization to reduce build time. + + release_impl.vsprops + Included by ..\release.vsprops by default when CHROME_BUILD_TYPE is undefined. Includes release_defaults.vsprops. + + release_impl_checksenabled.vsprops + Included by ..\release.vsprops when CHROME_BUILD_TYPE=_checksenabled. Matches what release_defaults.vsprops does, but doesn't actually inherit from it as we couldn't quite get that working. The only difference is that _DEBUG is set instead of NDEBUG. Used for keeping debug checks enabled with a build that is fast enough to dogfood with. + + release_impl_official.vsprops + Included by ..\release.vsprops when CHROME_BUILD_TYPE=_official. Includes release_defaults.vsprops. Enables Whole Program Optimizations (WPO), which doubles the build time. Results in much more optimized build. Uses "Full Optimization" and "Flavor small code". + + release_impl_pgo_instrument.vsprops + Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_instrument. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) instrumentation (first pass). Uses "Full Optimization" and "Flavor small code". + + release_impl_pgo_optimize.vsprops + Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_optimize. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) optimization (second pass). Uses "Full Optimization" and "Flavor small code". + + release_impl_purify.vsprops + Included by ..\release.vsprops when CHROME_BUILD_TYPE=_purify. Includes release_defaults.vsprops. Disables optimizations. Used with Purify to test without debug tools and without optimization; i.e. NDEBUG is defined but the compiler doesn't optimize the binary. diff --git a/build/internal/release_defaults.gypi b/build/internal/release_defaults.gypi new file mode 100644 index 0000000..5aa2b75 --- /dev/null +++ b/build/internal/release_defaults.gypi @@ -0,0 +1,15 @@ +{ + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimizations': '2', + 'StringPooling': 'true', + 'OmitFramePointers': 'true', + }, + 'VCLinkerTool': { + 'LinkIncremental': '1', + 'OptimizeReferences': '2', + 'EnableCOMDATFolding': '2', + 'OptimizeForWindows98': '1', + }, + }, +} diff --git a/build/internal/release_impl.gypi b/build/internal/release_impl.gypi new file mode 100644 index 0000000..aff06dc --- /dev/null +++ b/build/internal/release_impl.gypi @@ -0,0 +1,3 @@ +{ + 'includes': ['release_defaults.gypi'], +} diff --git a/build/internal/release_impl_official.gypi b/build/internal/release_impl_official.gypi new file mode 100644 index 0000000..18f7928 --- /dev/null +++ b/build/internal/release_impl_official.gypi @@ -0,0 +1,21 @@ +{ + 'includes': ['release_defaults.gypi'], + 'defines': ['OFFICIAL_BUILD'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '3', + 'InlineFunctionExpansion': '2', + 'EnableIntrinsicFunctions': 'true', + 'FavorSizeOrSpeed': '2', + 'OmitFramePointers': 'true', + 'EnableFiberSafeOptimizations': 'true', + 'WholeProgramOptimization': 'true', + }, + 'VCLibrarianTool': { + 'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'], + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '1', + }, + }, +} diff --git a/build/linux/SConstruct b/build/linux/SConstruct new file mode 100644 index 0000000..27b6984 --- /dev/null +++ b/build/linux/SConstruct @@ -0,0 +1,2 @@ +# This file is generated; do not edit. +SConscript('system_main.scons') diff --git a/build/linux/chrome_linux.croc b/build/linux/chrome_linux.croc new file mode 100644 index 0000000..4ce75e2 --- /dev/null +++ b/build/linux/chrome_linux.croc @@ -0,0 +1,29 @@ +# -*- python -*- +# Crocodile config file for Chromium linux + +# TODO(jhawkins): We'll need to add a chromeos.croc once we get a coverage bot +# for that platform. + +{ + # List of rules, applied in order + 'rules' : [ + # Specify inclusions before exclusions, since rules are in order. + + # Don't include non-Linux platform dirs + { + 'regexp' : '.*/(chromeos|views)/', + 'include' : 0, + }, + # Don't include windows or mac specific files + { + 'regexp' : '.*(_|/)(mac|win|views)(\\.|_)', + 'include' : 0, + }, + + # Groups + { + 'regexp' : '.*_test_linux\\.', + 'group' : 'test', + }, + ], +} diff --git a/build/linux/dbus-glib.target.mk b/build/linux/dbus-glib.target.mk new file mode 100644 index 0000000..e9add6b --- /dev/null +++ b/build/linux/dbus-glib.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := dbus-glib +### Rules for final target. diff --git a/build/linux/dump_app_syms b/build/linux/dump_app_syms new file mode 100755 index 0000000..632bcc7 --- /dev/null +++ b/build/linux/dump_app_syms @@ -0,0 +1,36 @@ +#!/bin/sh + +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Helper script to run dump_syms on Chrome Linux executables and strip +# them if needed. + +set -e + +usage() { + echo -n "$0 <dump_syms_exe> <strip_binary> " >&2 + echo "<binary_with_symbols> <symbols_output>" >&2 +} + + +if [ $# -ne 4 ]; then + usage + exit 1 +fi + +SCRIPTDIR="$(readlink -f "$(dirname "$0")")" +DUMPSYMS="$1" +STRIP_BINARY="$2" +INFILE="$3" +OUTFILE="$4" + +# Dump the symbols from the given binary. +if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then + "$DUMPSYMS" "$INFILE" > "$OUTFILE" +fi + +if [ "$STRIP_BINARY" != "0" ]; then + strip "$INFILE" +fi diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py new file mode 100755 index 0000000..37e50f4 --- /dev/null +++ b/build/linux/dump_signature.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +# +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# This generates symbol signatures with the same algorithm as +# src/breakpad/src/common/linux/file_id.cc@461 + +import struct +import sys +import subprocess + +if len(sys.argv) != 2: + sys.stderr.write("Error, no filename specified.\n") + sys.exit(1) + +# Shell out to objdump to get the offset of the .text section +objdump = subprocess.Popen(['objdump', '-h', sys.argv[1]], stdout = subprocess.PIPE) +(sections, _) = objdump.communicate() +if objdump.returncode != 0: + sys.stderr.write('Failed to run objdump to find .text section.\n') + sys.exit(1) + +text_section = [x for x in sections.splitlines() if '.text' in x] +if len(text_section) == 0: + sys.stderr.write('objdump failed to find a .text section.\n') + sys.exit(1) +text_section = text_section[0] +try: + file_offset = int(text_section.split()[5], 16) +except ValueError: + sys.stderr.write("Failed to parse objdump output. Here is the failing line:\n"); + sys.stderr.write(text_section) + sys.exit(1) + +bin = open(sys.argv[1]) +bin.seek(file_offset) +if bin.tell() != file_offset: + sys.stderr.write("Failed to seek to the .text segment. Truncated file?\n"); + sys.exit(1) + +data = bin.read(4096) +if len(data) != 4096: + sys.stderr.write("Error, did not read first page of data.\n"); + sys.exit(1) +bin.close() + +signature = [0] * 16 +for i in range(0, 4096): + signature[i % 16] ^= ord(data[i]) + +# Append a 0 at the end for the generation number (always 0 on Linux) +out = ('%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X0' % + struct.unpack('I2H8B', struct.pack('16B', *signature))) +sys.stdout.write(out) diff --git a/build/linux/fontconfig.target.mk b/build/linux/fontconfig.target.mk new file mode 100644 index 0000000..a5e6271 --- /dev/null +++ b/build/linux/fontconfig.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := fontconfig +### Rules for final target. diff --git a/build/linux/freetype2.target.mk b/build/linux/freetype2.target.mk new file mode 100644 index 0000000..297b743 --- /dev/null +++ b/build/linux/freetype2.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := freetype2 +### Rules for final target. diff --git a/build/linux/gconf.target.mk b/build/linux/gconf.target.mk new file mode 100644 index 0000000..b7aa300 --- /dev/null +++ b/build/linux/gconf.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := gconf +### Rules for final target. diff --git a/build/linux/gdk.target.mk b/build/linux/gdk.target.mk new file mode 100644 index 0000000..03279bb --- /dev/null +++ b/build/linux/gdk.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := gdk +### Rules for final target. diff --git a/build/linux/gnome-keyring.target.mk b/build/linux/gnome-keyring.target.mk new file mode 100644 index 0000000..cd773ef --- /dev/null +++ b/build/linux/gnome-keyring.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := gnome-keyring +### Rules for final target. diff --git a/build/linux/gtk.target.mk b/build/linux/gtk.target.mk new file mode 100644 index 0000000..227d712 --- /dev/null +++ b/build/linux/gtk.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := gtk +### Rules for final target. diff --git a/build/linux/gtkprint.target.mk b/build/linux/gtkprint.target.mk new file mode 100644 index 0000000..c4fc89d --- /dev/null +++ b/build/linux/gtkprint.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := gtkprint +### Rules for final target. diff --git a/build/linux/nss.target.mk b/build/linux/nss.target.mk new file mode 100644 index 0000000..877adf8 --- /dev/null +++ b/build/linux/nss.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := nss +### Rules for final target. diff --git a/build/linux/pkg-config-wrapper b/build/linux/pkg-config-wrapper new file mode 100755 index 0000000..fa76c2e --- /dev/null +++ b/build/linux/pkg-config-wrapper @@ -0,0 +1,14 @@ +#!/bin/sh + +root="$1" +if [ -z "$root" ] +then + echo "usage: $0 /path/to/sysroot [pkg-config-arguments]" >&2 + exit 1 +fi + +rewrite=`dirname $0`/rewrite_dirs.py + +shift +config_path=$root/usr/lib/pkgconfig:$root/usr/share/pkgconfig +PKG_CONFIG_PATH=$config_path pkg-config --define-variable=prefix=/usr "$@" | $rewrite $root diff --git a/build/linux/python_arch.sh b/build/linux/python_arch.sh new file mode 100755 index 0000000..f364469 --- /dev/null +++ b/build/linux/python_arch.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This figures out the architecture of the version of Python we are building +# pyautolib against. +# +# python_arch.sh /usr/lib/libpython2.5.so.1.0 +# python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0 +# + +python=$(readlink -f "$1") +if [ ! -r "$python" ]; then + echo unknown + exit 0; +fi +file_out=$(file "$python") +if [ $? -ne 0 ]; then + echo unknown + exit 0; +fi + +echo $file_out | grep -qs "ARM" +if [ $? -eq 0 ]; then + echo arm + exit 0 +fi + +echo $file_out | grep -qs "x86-64" +if [ $? -eq 0 ]; then + echo x64 + exit 0 +fi + +echo $file_out | grep -qs "Intel 80386" +if [ $? -eq 0 ]; then + echo ia32 + exit 0 +fi + +exit 1 diff --git a/build/linux/rewrite_dirs.py b/build/linux/rewrite_dirs.py new file mode 100755 index 0000000..5c41cf9 --- /dev/null +++ b/build/linux/rewrite_dirs.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Rewrites paths in -I, -L and other option to be relative to a sysroot.""" + +import sys +import os + +REWRITE_PREFIX = ['-I', + '-idirafter', + '-imacros', + '-imultilib', + '-include', + '-iprefix', + '-iquote', + '-isystem', + '-L'] + +def RewritePath(path, sysroot): + """Rewrites a path by prefixing it with the sysroot if it is absolute.""" + if os.path.isabs(path) and not path.startswith(sysroot): + path = path.lstrip('/') + return os.path.join(sysroot, path) + else: + return path + +def RewriteLine(line, sysroot): + """Rewrites all the paths in recognized options.""" + args = line.split() + count = len(args) + i = 0 + while i < count: + for prefix in REWRITE_PREFIX: + # The option can be either in the form "-I /path/to/dir" or + # "-I/path/to/dir" so handle both. + if args[i] == prefix: + i += 1 + try: + args[i] = RewritePath(args[i], sysroot) + except IndexError: + sys.stderr.write('Missing argument following %s\n' % prefix) + break + elif args[i].startswith(prefix): + args[i] = prefix + RewritePath(args[i][len(prefix):], sysroot) + i += 1 + + return ' '.join(args) + +def main(argv): + try: + sysroot = argv[1] + except IndexError: + sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) + return 1 + + for line in sys.stdin.readlines(): + line = RewriteLine(line.strip(), sysroot) + print line + return 0 + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/build/linux/selinux.target.mk b/build/linux/selinux.target.mk new file mode 100644 index 0000000..32b144b --- /dev/null +++ b/build/linux/selinux.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := selinux +### Rules for final target. diff --git a/build/linux/system.Makefile b/build/linux/system.Makefile new file mode 100644 index 0000000..4eebf76 --- /dev/null +++ b/build/linux/system.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= /usr/local/google/src/chromium-merge/src/build/linux/out +.PHONY: all +all: + $(MAKE) -C ../.. xext dbus-glib gtk gnome-keyring fontconfig x11 gconf gdk freetype2 gtkprint nss diff --git a/build/linux/system.gyp b/build/linux/system.gyp new file mode 100644 index 0000000..876579a --- /dev/null +++ b/build/linux/system.gyp @@ -0,0 +1,318 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'conditions': [ + ['sysroot!=""', { + 'variables': { + 'pkg-config': './pkg-config-wrapper "<(sysroot)"', + }, + }, { + 'variables': { + 'pkg-config': 'pkg-config' + }, + }], + [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { + 'variables': { + # We use our own copy of libssl, although we still need to link against + # the rest of NSS. + 'use_system_ssl%': 0, + }, + }, { # OS!="linux" + 'variables': { + 'use_system_ssl%': 1, + }, + }], + ], + + + 'targets': [ + { + 'target_name': 'gtk', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)', + ], + }, + }]] + }, + { + 'target_name': 'gtkprint', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)', + ], + }, + }]] + }, + { + 'target_name': 'nss', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'conditions': [ + ['use_system_ssl==0', { + 'dependencies': [ + '../../net/third_party/nss/ssl.gyp:ssl', + '../../third_party/zlib/zlib.gyp:zlib', + ], + 'direct_dependent_settings': { + 'cflags': [ + # We need for our local copies of the libssl headers to come + # first, otherwise the code will build, but will fallback to + # the set of features advertised in the system headers. + # Unfortunately, there's no include path that we can filter + # out of $(pkg-config --cflags nss) and GYP include paths + # come after cflags on the command line. So we have these + # bodges: + '-I../net/third_party/nss/ssl', # for scons + '-Inet/third_party/nss/ssl', # for make + '-IWebKit/chromium/net/third_party/nss/ssl', # for make in webkit + '<!@(<(pkg-config) --cflags nss)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")', + ], + }, + }, { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags nss)', + ], + 'defines': [ + 'USE_SYSTEM_SSL', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l nss)', + ], + }, + }]] + }], + ], + }, + { + 'target_name': 'freetype2', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags freetype2)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l freetype2)', + ], + }, + }]] + }, + { + 'target_name': 'fontconfig', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags fontconfig)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l fontconfig)', + ], + }, + }]] + }, + { + 'target_name': 'gdk', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gdk-2.0)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gdk-2.0)', + ], + }, + }]] + }, + { + 'target_name': 'gconf', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gconf-2.0)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gconf-2.0)', + ], + }, + }]] + }, + { + 'target_name': 'x11', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags x11)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other x11)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l x11)', + ], + }, + }]] + }, + { + 'target_name': 'xext', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xext)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xext)', + ], + }, + }]] + }, + { + 'target_name': 'selinux', + 'type': 'settings', + 'conditions': [ + ['_toolset=="target"', { + 'link_settings': { + 'libraries': [ + '-lselinux', + ], + }, + }]] + }, + { + 'target_name': 'gnome-keyring', + 'type': 'settings', + 'conditions': [ + ['chromeos==0', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gnome-keyring-1)', + ], + 'conditions': [ + ['linux_link_gnome_keyring==0', { + 'defines': ['DLOPEN_GNOME_KEYRING'], + }], + ], + }, + 'conditions': [ + ['linux_link_gnome_keyring!=0', { + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', + ], + }, + }, { + 'link_settings': { + 'libraries': [ + '-ldl', + ], + }, + }], + ], + }], + ], + }, + { + 'target_name': 'dbus-glib', + 'type': 'settings', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags dbus-glib-1)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-glib-1)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l dbus-glib-1)', + ], + }, + }, + ], +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/linux/system_main.scons b/build/linux/system_main.scons new file mode 100644 index 0000000..fc5901f --- /dev/null +++ b/build/linux/system_main.scons @@ -0,0 +1,327 @@ +# This file is generated; do not edit. + +__doc__ = ''' +Wrapper configuration for building this entire "solution," +including all the specific targets in various *.scons files. +''' + +import os +import sys + +import SCons.Environment +import SCons.Util + +def GetProcessorCount(): + ''' + Detects the number of CPUs on the system. Adapted form: + http://codeliberates.blogspot.com/2008/05/detecting-cpuscores-in-python.html + ''' + # Linux, Unix and Mac OS X: + if hasattr(os, 'sysconf'): + if os.sysconf_names.has_key('SC_NPROCESSORS_ONLN'): + # Linux and Unix or Mac OS X with python >= 2.5: + return os.sysconf('SC_NPROCESSORS_ONLN') + else: # Mac OS X with Python < 2.5: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + # Windows: + if os.environ.has_key('NUMBER_OF_PROCESSORS'): + return max(int(os.environ.get('NUMBER_OF_PROCESSORS', '1')), 1) + return 1 # Default + +# Support PROGRESS= to show progress in different ways. +p = ARGUMENTS.get('PROGRESS') +if p == 'spinner': + Progress(['/\r', '|\r', '\\\r', '-\r'], + interval=5, + file=open('/dev/tty', 'w')) +elif p == 'name': + Progress('$TARGET\r', overwrite=True, file=open('/dev/tty', 'w')) + +# Set the default -j value based on the number of processors. +SetOption('num_jobs', GetProcessorCount() + 1) + +# Have SCons use its cached dependency information. +SetOption('implicit_cache', 1) + +# Only re-calculate MD5 checksums if a timestamp has changed. +Decider('MD5-timestamp') + +# Since we set the -j value by default, suppress SCons warnings about being +# unable to support parallel build on versions of Python with no threading. +default_warnings = ['no-no-parallel-support'] +SetOption('warn', default_warnings + GetOption('warn')) + +AddOption('--mode', nargs=1, dest='conf_list', default=[], + action='append', help='Configuration to build.') + +AddOption('--verbose', dest='verbose', default=False, + action='store_true', help='Verbose command-line output.') + + +# +sconscript_file_map = dict( + ssl = '../../net/third_party/nss/ssl.scons', + zlib = '../../third_party/zlib/zlib.scons', +) + +class LoadTarget: + ''' + Class for deciding if a given target sconscript is to be included + based on a list of included target names, optionally prefixed with '-' + to exclude a target name. + ''' + def __init__(self, load): + ''' + Initialize a class with a list of names for possible loading. + + Arguments: + load: list of elements in the LOAD= specification + ''' + self.included = set([c for c in load if not c.startswith('-')]) + self.excluded = set([c[1:] for c in load if c.startswith('-')]) + + if not self.included: + self.included = set(['all']) + + def __call__(self, target): + ''' + Returns True if the specified target's sconscript file should be + loaded, based on the initialized included and excluded lists. + ''' + return (target in self.included or + ('all' in self.included and not target in self.excluded)) + +if 'LOAD' in ARGUMENTS: + load = ARGUMENTS['LOAD'].split(',') +else: + load = [] +load_target = LoadTarget(load) + +sconscript_files = [] +for target, sconscript in sconscript_file_map.iteritems(): + if load_target(target): + sconscript_files.append(sconscript) + + +target_alias_list= [] + +conf_list = GetOption('conf_list') +if conf_list: + # In case the same --mode= value was specified multiple times. + conf_list = list(set(conf_list)) +else: + conf_list = ['Debug'] + +sconsbuild_dir = Dir('../../sconsbuild') + + +def FilterOut(self, **kw): + kw = SCons.Environment.copy_non_reserved_keywords(kw) + for key, val in kw.items(): + envval = self.get(key, None) + if envval is None: + # No existing variable in the environment, so nothing to delete. + continue + + for vremove in val: + # Use while not if, so we can handle duplicates. + while vremove in envval: + envval.remove(vremove) + + self[key] = envval + + # TODO(sgk): SCons.Environment.Append() has much more logic to deal + # with various types of values. We should handle all those cases in here + # too. (If variable is a dict, etc.) + + +non_compilable_suffixes = { + 'LINUX' : set([ + '.bdic', + '.css', + '.dat', + '.fragment', + '.gperf', + '.h', + '.hh', + '.hpp', + '.html', + '.hxx', + '.idl', + '.in', + '.in0', + '.in1', + '.js', + '.mk', + '.rc', + '.sigs', + '', + ]), + 'WINDOWS' : set([ + '.h', + '.hh', + '.hpp', + '.dat', + '.idl', + '.in', + '.in0', + '.in1', + ]), +} + +def compilable(env, file): + base, ext = os.path.splitext(str(file)) + if ext in non_compilable_suffixes[env['TARGET_PLATFORM']]: + return False + return True + +def compilable_files(env, sources): + return [x for x in sources if compilable(env, x)] + +def GypProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def GypTestProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(*result) + return result + +def GypLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Library(target, source, *args, **kw) + return result + +def GypLoadableModule(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.LoadableModule(target, source, *args, **kw) + return result + +def GypStaticLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.StaticLibrary(target, source, *args, **kw) + return result + +def GypSharedLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.SharedLibrary(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def add_gyp_methods(env): + env.AddMethod(GypProgram) + env.AddMethod(GypTestProgram) + env.AddMethod(GypLibrary) + env.AddMethod(GypLoadableModule) + env.AddMethod(GypStaticLibrary) + env.AddMethod(GypSharedLibrary) + + env.AddMethod(FilterOut) + + env.AddMethod(compilable) + + +base_env = Environment( + tools = ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], + INTERMEDIATE_DIR='$OBJ_DIR/${COMPONENT_NAME}/_${TARGET_NAME}_intermediate', + LIB_DIR='$TOP_BUILDDIR/lib', + OBJ_DIR='$TOP_BUILDDIR/obj', + SCONSBUILD_DIR=sconsbuild_dir.abspath, + SHARED_INTERMEDIATE_DIR='$OBJ_DIR/_global_intermediate', + SRC_DIR=Dir('../..'), + TARGET_PLATFORM='LINUX', + TOP_BUILDDIR='$SCONSBUILD_DIR/$CONFIG_NAME', + LIBPATH=['$LIB_DIR'], +) + +if not GetOption('verbose'): + base_env.SetDefault( + ARCOMSTR='Creating library $TARGET', + ASCOMSTR='Assembling $TARGET', + CCCOMSTR='Compiling $TARGET', + CONCATSOURCECOMSTR='ConcatSource $TARGET', + CXXCOMSTR='Compiling $TARGET', + LDMODULECOMSTR='Building loadable module $TARGET', + LINKCOMSTR='Linking $TARGET', + MANIFESTCOMSTR='Updating manifest for $TARGET', + MIDLCOMSTR='Compiling IDL $TARGET', + PCHCOMSTR='Precompiling $TARGET', + RANLIBCOMSTR='Indexing $TARGET', + RCCOMSTR='Compiling resource $TARGET', + SHCCCOMSTR='Compiling $TARGET', + SHCXXCOMSTR='Compiling $TARGET', + SHLINKCOMSTR='Linking $TARGET', + SHMANIFESTCOMSTR='Updating manifest for $TARGET', + ) + +add_gyp_methods(base_env) + +for conf in conf_list: + env = base_env.Clone(CONFIG_NAME=conf) + SConsignFile(env.File('$TOP_BUILDDIR/.sconsign').abspath) + for sconscript in sconscript_files: + target_alias = env.SConscript(sconscript, exports=['env']) + if target_alias: + target_alias_list.extend(target_alias) + +Default(Alias('all', target_alias_list)) + +help_fmt = ''' +Usage: hammer [SCONS_OPTIONS] [VARIABLES] [TARGET] ... + +Local command-line build options: + --mode=CONFIG Configuration to build: + --mode=Debug [default] + --mode=Release + --verbose Print actual executed command lines. + +Supported command-line build variables: + LOAD=[module,...] Comma-separated list of components to load in the + dependency graph ('-' prefix excludes) + PROGRESS=type Display a progress indicator: + name: print each evaluated target name + spinner: print a spinner every 5 targets + +The following TARGET names can also be used as LOAD= module names: + +%s +''' + +if GetOption('help'): + def columnar_text(items, width=78, indent=2, sep=2): + result = [] + colwidth = max(map(len, items)) + sep + cols = (width - indent) / colwidth + if cols < 1: + cols = 1 + rows = (len(items) + cols - 1) / cols + indent = '%*s' % (indent, '') + sep = indent + for row in xrange(0, rows): + result.append(sep) + for i in xrange(row, len(items), rows): + result.append('%-*s' % (colwidth, items[i])) + sep = '\n' + indent + result.append('\n') + return ''.join(result) + + load_list = set(sconscript_file_map.keys()) + target_aliases = set(map(str, target_alias_list)) + + common = load_list and target_aliases + load_only = load_list - common + target_only = target_aliases - common + help_text = [help_fmt % columnar_text(sorted(list(common)))] + if target_only: + fmt = "The following are additional TARGET names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(target_only)))) + if load_only: + fmt = "The following are additional LOAD= module names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(load_only)))) + Help(''.join(help_text)) diff --git a/build/linux/x11.target.mk b/build/linux/x11.target.mk new file mode 100644 index 0000000..d722300 --- /dev/null +++ b/build/linux/x11.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := x11 +### Rules for final target. diff --git a/build/linux/xext.target.mk b/build/linux/xext.target.mk new file mode 100644 index 0000000..5829922 --- /dev/null +++ b/build/linux/xext.target.mk @@ -0,0 +1,5 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := xext +### Rules for final target. diff --git a/build/mac/chrome_mac.croc b/build/mac/chrome_mac.croc new file mode 100644 index 0000000..f202cb9 --- /dev/null +++ b/build/mac/chrome_mac.croc @@ -0,0 +1,31 @@ +# -*- python -*- +# Crocodile config file for Chromium mac + +{ + # List of rules, applied in order + 'rules' : [ + # Specify inclusions before exclusions, since rules are in order. + + # Don't include linux or windows specific files + { + 'regexp' : '.*(_|/)(linux|win|views)(\\.|_)', + 'include' : 0, + }, + + # Groups + { + 'regexp' : '.*_test_mac\\.', + 'group' : 'test', + }, + + # Languages + { + 'regexp' : '.*\\.m$', + 'language' : 'ObjC', + }, + { + 'regexp' : '.*\\.mm$', + 'language' : 'ObjC++', + }, + ], +} diff --git a/build/mac/strip_from_xcode b/build/mac/strip_from_xcode new file mode 100755 index 0000000..c26b9fb --- /dev/null +++ b/build/mac/strip_from_xcode @@ -0,0 +1,62 @@ +#!/bin/bash + +# Copyright (c) 2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is a handy wrapper script that figures out how to call the strip +# utility (strip_save_dsym in this case), if it even needs to be called at all, +# and then does it. This script should be called by a post-link phase in +# targets that might generate Mach-O executables, dynamic libraries, or +# loadable bundles. +# +# An example "Strip If Needed" build phase placed after "Link Binary With +# Libraries" would do: +# exec "${XCODEPROJ_DEPTH}/build/mac/strip_from_xcode" + +if [ "${CONFIGURATION}" != "Release" ] ; then + # Only strip in release mode. + exit 0 +fi + +declare -a FLAGS + +# MACH_O_TYPE is not set for a command-line tool, so check PRODUCT_TYPE too. +# Weird. +if [ "${MACH_O_TYPE}" = "mh_execute" ] || \ + [ "${PRODUCT_TYPE}" = "com.apple.product-type.tool" ] ; then + # Strip everything (no special flags). No-op. + true +elif [ "${MACH_O_TYPE}" = "mh_dylib" ] || \ + [ "${MACH_O_TYPE}" = "mh_bundle" ]; then + # Strip debugging symbols and local symbols + FLAGS[${#FLAGS[@]}]=-S + FLAGS[${#FLAGS[@]}]=-x +elif [ "${MACH_O_TYPE}" = "staticlib" ] ; then + # Don't strip static libraries. + exit 0 +else + # Warn, but don't treat this as an error. + echo $0: warning: unrecognized MACH_O_TYPE ${MACH_O_TYPE} + exit 0 +fi + +if [ -n "${STRIPFLAGS}" ] ; then + # Pick up the standard STRIPFLAGS Xcode setting, used for "Additional Strip + # Flags". + for stripflag in "${STRIPFLAGS}" ; do + FLAGS[${#FLAGS[@]}]="${stripflag}" + done +fi + +if [ -n "${CHROMIUM_STRIP_SAVE_FILE}" ] ; then + # An Xcode project can communicate a file listing symbols to saved in this + # environment variable by setting it as a build setting. This isn't a + # standard Xcode setting. It's used in preference to STRIPFLAGS to + # eliminate quoting ambiguity concerns. + FLAGS[${#FLAGS[@]}]=-s + FLAGS[${#FLAGS[@]}]="${CHROMIUM_STRIP_SAVE_FILE}" +fi + +exec "$(dirname ${0})/strip_save_dsym" "${FLAGS[@]}" \ + "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" diff --git a/build/mac/strip_save_dsym b/build/mac/strip_save_dsym new file mode 100755 index 0000000..3904c17 --- /dev/null +++ b/build/mac/strip_save_dsym @@ -0,0 +1,341 @@ +#!/usr/bin/python + +# Copyright (c) 2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Usage: strip_save_dsym <whatever-arguments-you-would-pass-to-strip> +# +# strip_save_dsym is a wrapper around the standard strip utility. Given an +# input Mach-O file, strip_save_dsym will save a copy of the file in a "fake" +# .dSYM bundle for debugging, and then call strip to strip the Mach-O file. +# Note that the .dSYM file is a "fake" in that it's not a self-contained +# .dSYM bundle, it just contains a copy of the original (unstripped) Mach-O +# file, and therefore contains references to object files on the filesystem. +# The generated .dSYM bundle is therefore unsuitable for debugging in the +# absence of these .o files. +# +# If a .dSYM already exists and has a newer timestamp than the Mach-O file, +# this utility does nothing. That allows strip_save_dsym to be run on a file +# that has already been stripped without trashing the .dSYM. +# +# Rationale: the "right" way to generate dSYM bundles, dsymutil, is incredibly +# slow. On the other hand, doing a file copy (which is really all that +# dsymutil does) is comparatively fast. Since we usually just want to strip +# a release-mode executable but still be able to debug it, and we don't care +# so much about generating a hermetic dSYM bundle, we'll prefer the file copy. +# If a real dSYM is ever needed, it's still possible to create one by running +# dsymutil and pointing it at the original Mach-O file inside the "fake" +# bundle, provided that the object files are available. + +import errno +import os +import re +import shutil +import subprocess +import sys +import time + +# Returns a list of architectures contained in a Mach-O file. The file can be +# a universal (fat) file, in which case there will be one list element for +# each contained architecture, or it can be a thin single-architecture Mach-O +# file, in which case the list will contain a single element identifying the +# architecture. On error, returns an empty list. Determines the architecture +# list by calling file. +def macho_archs(macho): + macho_types = ["executable", + "dynamically linked shared library", + "bundle"] + macho_types_re = "Mach-O (?:64-bit )?(?:" + "|".join(macho_types) + ")" + + file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "--", macho], + stdout=subprocess.PIPE) + + archs = [] + + type_line = file_cmd.stdout.readline() + type_match = re.match("^%s (.*)$" % macho_types_re, type_line) + if type_match: + archs.append(type_match.group(1)) + return [type_match.group(1)] + else: + type_match = re.match("^Mach-O universal binary with (.*) architectures$", + type_line) + if type_match: + for i in range(0, int(type_match.group(1))): + arch_line = file_cmd.stdout.readline() + arch_match = re.match( + "^.* \(for architecture (.*)\):\t%s .*$" % macho_types_re, + arch_line) + if arch_match: + archs.append(arch_match.group(1)) + + if file_cmd.wait() != 0: + archs = [] + + if len(archs) == 0: + print >> sys.stderr, "No architectures in %s" % macho + + return archs + +# Returns a dictionary mapping architectures contained in the file as returned +# by macho_archs to the LC_UUID load command for that architecture. +# Architectures with no LC_UUID load command are omitted from the dictionary. +# Determines the UUID value by calling otool. +def macho_uuids(macho): + uuids = {} + + archs = macho_archs(macho) + if len(archs) == 0: + return uuids + + for arch in archs: + if arch == "": + continue + + otool_cmd = subprocess.Popen(["/usr/bin/otool", "-arch", arch, "-l", "-", + macho], + stdout=subprocess.PIPE) + # state 0 is when nothing UUID-related has been seen yet. State 1 is + # entered after a load command begins, but it may not be an LC_UUID load + # command. States 2, 3, and 4 are intermediate states while reading an + # LC_UUID command. State 5 is the terminal state for a successful LC_UUID + # read. State 6 is the error state. + state = 0 + uuid = "" + for otool_line in otool_cmd.stdout: + if state == 0: + if re.match("^Load command .*$", otool_line): + state = 1 + elif state == 1: + if re.match("^ cmd LC_UUID$", otool_line): + state = 2 + else: + state = 0 + elif state == 2: + if re.match("^ cmdsize 24$", otool_line): + state = 3 + else: + state = 6 + elif state == 3: + # The UUID display format changed in the version of otool shipping + # with the Xcode 3.2.2 prerelease. The new format is traditional: + # uuid 4D7135B2-9C56-C5F5-5F49-A994258E0955 + # The old format, from cctools-750 and older's otool, breaks the UUID + # up into a sequence of bytes: + # uuid 0x4d 0x71 0x35 0xb2 0x9c 0x56 0xc5 0xf5 + # 0x5f 0x49 0xa9 0x94 0x25 0x8e 0x09 0x55 + new_uuid_match = re.match("^ uuid (.{8}-.{4}-.{4}-.{4}-.{12})$", + otool_line) + if new_uuid_match: + uuid = new_uuid_match.group(1) + + # Skip state 4, there is no second line to read. + state = 5 + else: + old_uuid_match = re.match("^ uuid 0x(..) 0x(..) 0x(..) 0x(..) " + "0x(..) 0x(..) 0x(..) 0x(..)$", + otool_line) + if old_uuid_match: + state = 4 + uuid = old_uuid_match.group(1) + old_uuid_match.group(2) + \ + old_uuid_match.group(3) + old_uuid_match.group(4) + "-" + \ + old_uuid_match.group(5) + old_uuid_match.group(6) + "-" + \ + old_uuid_match.group(7) + old_uuid_match.group(8) + "-" + else: + state = 6 + elif state == 4: + old_uuid_match = re.match("^ 0x(..) 0x(..) 0x(..) 0x(..) " + "0x(..) 0x(..) 0x(..) 0x(..)$", + otool_line) + if old_uuid_match: + state = 5 + uuid += old_uuid_match.group(1) + old_uuid_match.group(2) + "-" + \ + old_uuid_match.group(3) + old_uuid_match.group(4) + \ + old_uuid_match.group(5) + old_uuid_match.group(6) + \ + old_uuid_match.group(7) + old_uuid_match.group(8) + else: + state = 6 + + if otool_cmd.wait() != 0: + state = 6 + + if state == 5: + uuids[arch] = uuid.upper() + + if len(uuids) == 0: + print >> sys.stderr, "No UUIDs in %s" % macho + + return uuids + +# Given a path to a Mach-O file and possible information from the environment, +# determines the desired path to the .dSYM. +def dsym_path(macho): + # If building a bundle, the .dSYM should be placed next to the bundle. Use + # WRAPPER_NAME to make this determination. If called from xcodebuild, + # WRAPPER_NAME will be set to the name of the bundle. + dsym = "" + if "WRAPPER_NAME" in os.environ: + if "BUILT_PRODUCTS_DIR" in os.environ: + dsym = os.path.join(os.environ["BUILT_PRODUCTS_DIR"], + os.environ["WRAPPER_NAME"]) + else: + dsym = os.environ["WRAPPER_NAME"] + else: + dsym = macho + + dsym += ".dSYM" + + return dsym + +# Creates a fake .dSYM bundle at dsym for macho, a Mach-O image with the +# architectures and UUIDs specified by the uuids map. +def make_fake_dsym(macho, dsym): + uuids = macho_uuids(macho) + if len(uuids) == 0: + return False + + dwarf_dir = os.path.join(dsym, "Contents", "Resources", "DWARF") + dwarf_file = os.path.join(dwarf_dir, os.path.basename(macho)) + try: + os.makedirs(dwarf_dir) + except OSError, (err, error_string): + if err != errno.EEXIST: + raise + shutil.copyfile(macho, dwarf_file) + + # info_template is the same as what dsymutil would have written, with the + # addition of the fake_dsym key. + info_template = \ +'''<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleIdentifier</key> + <string>com.apple.xcode.dsym.%(root_name)s</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>dSYM</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>dSYM_UUID</key> + <dict> +%(uuid_dict)s </dict> + <key>fake_dsym</key> + <true/> + </dict> +</plist> +''' + + root_name = os.path.basename(dsym)[:-5] # whatever.dSYM without .dSYM + uuid_dict = "" + for arch in sorted(uuids): + uuid_dict += "\t\t\t<key>" + arch + "</key>\n"\ + "\t\t\t<string>" + uuids[arch] + "</string>\n" + info_dict = { + "root_name": root_name, + "uuid_dict": uuid_dict, + } + info_contents = info_template % info_dict + info_file = os.path.join(dsym, "Contents", "Info.plist") + info_fd = open(info_file, "w") + info_fd.write(info_contents) + info_fd.close() + + return True + +# For a Mach-O file, determines where the .dSYM bundle should be located. If +# the bundle does not exist or has a modification time older than the Mach-O +# file, calls make_fake_dsym to create a fake .dSYM bundle there, then strips +# the Mach-O file and sets the modification time on the .dSYM bundle and Mach-O +# file to be identical. +def strip_and_make_fake_dsym(macho): + dsym = dsym_path(macho) + macho_stat = os.stat(macho) + dsym_stat = None + try: + dsym_stat = os.stat(dsym) + except OSError, (err, error_string): + if err != errno.ENOENT: + raise + + if dsym_stat is None or dsym_stat.st_mtime < macho_stat.st_mtime: + # Make a .dSYM bundle + if not make_fake_dsym(macho, dsym): + return False + + # Strip the Mach-O file + remove_dsym = True + try: + strip_path = "" + if "SYSTEM_DEVELOPER_BIN_DIR" in os.environ: + strip_path = os.environ["SYSTEM_DEVELOPER_BIN_DIR"] + else: + strip_path = "/usr/bin" + strip_path = os.path.join(strip_path, "strip") + strip_cmdline = [strip_path] + sys.argv[1:] + # Print the strip invocation so that it's obvious something is happening + print " ".join(strip_cmdline) + strip_cmd = subprocess.Popen(strip_cmdline) + if strip_cmd.wait() == 0: + remove_dsym = False + finally: + if remove_dsym: + shutil.rmtree(dsym) + + # Update modification time on the Mach-O file and .dSYM bundle + now = time.time() + os.utime(macho, (now, now)) + os.utime(dsym, (now, now)) + + return True + +def main(argv=None): + if argv is None: + argv = sys.argv + + # This only supports operating on one file at a time. Look at the arguments + # to strip to figure out what the source to be stripped is. Arguments are + # processed in the same way that strip does, although to reduce complexity, + # this doesn't do all of the same checking as strip. For example, strip + # has no -Z switch and would treat -Z on the command line as an error. For + # the purposes this is needed for, that's fine. + macho = None + process_switches = True + ignore_argument = False + for arg in argv[1:]: + if ignore_argument: + ignore_argument = False + continue + if process_switches: + if arg == "-": + process_switches = False + # strip has these switches accept an argument: + if arg in ["-s", "-R", "-d", "-o", "-arch"]: + ignore_argument = True + if arg[0] == "-": + continue + if macho is None: + macho = arg + else: + print >> sys.stderr, "Too many things to strip" + return 1 + + if macho is None: + print >> sys.stderr, "Nothing to strip" + return 1 + + if not strip_and_make_fake_dsym(macho): + return 1 + + return 0 + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/build/output_dll_copy.rules b/build/output_dll_copy.rules new file mode 100644 index 0000000..c6e9051 --- /dev/null +++ b/build/output_dll_copy.rules @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<VisualStudioToolFile + Name="Output DLL copy" + Version="8.00" + > + <Rules> + <CustomBuildRule + Name="Output DLL copy" + CommandLine="xcopy /R /C /Y $(InputPath) $(OutDir)" + Outputs="$(OutDir)\$(InputFileName)" + FileExtensions="*.dll" + > + <Properties> + </Properties> + </CustomBuildRule> + </Rules> +</VisualStudioToolFile> diff --git a/build/release.gypi b/build/release.gypi new file mode 100644 index 0000000..c12526b --- /dev/null +++ b/build/release.gypi @@ -0,0 +1,19 @@ +{ + 'conditions': [ + # Handle build types. + ['buildtype=="Dev"', { + 'includes': ['internal/release_impl.gypi'], + }], + ['buildtype=="Official"', { + 'includes': ['internal/release_impl_official.gypi'], + }], + # TODO(bradnelson): may also need: + # checksenabled + # coverage + # dom_stats + # pgo_instrument + # pgo_optimize + # purify + ], +} + diff --git a/build/temp_gyp/README.chromium b/build/temp_gyp/README.chromium new file mode 100644 index 0000000..8045d61 --- /dev/null +++ b/build/temp_gyp/README.chromium @@ -0,0 +1,3 @@ +This directory will be removed once the files in it are committed upstream and +Chromium imports an upstream revision with these files. Contact mark for +details. diff --git a/build/temp_gyp/SConstruct b/build/temp_gyp/SConstruct new file mode 100644 index 0000000..176b283 --- /dev/null +++ b/build/temp_gyp/SConstruct @@ -0,0 +1,2 @@ +# This file is generated; do not edit. +SConscript('googleurl_main.scons') diff --git a/build/temp_gyp/googleurl.Makefile b/build/temp_gyp/googleurl.Makefile new file mode 100644 index 0000000..6c8a6d6 --- /dev/null +++ b/build/temp_gyp/googleurl.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= /usr/local/google/src/chromium-merge/src/build/temp_gyp/out +.PHONY: all +all: + $(MAKE) -C ../.. googleurl googleurl_unittests diff --git a/build/temp_gyp/googleurl.gyp b/build/temp_gyp/googleurl.gyp new file mode 100644 index 0000000..9a2eda3 --- /dev/null +++ b/build/temp_gyp/googleurl.gyp @@ -0,0 +1,112 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# TODO(mark): Upstream this file to googleurl. +{ + 'variables': { + 'chromium_code': 1, + }, + 'targets': [ + { + 'target_name': 'googleurl', + 'type': '<(component)', + 'msvs_guid': 'EF5E94AB-B646-4E5B-A058-52EF07B8351C', + 'dependencies': [ + '../../base/base.gyp:base', + '../../third_party/icu/icu.gyp:icudata', + '../../third_party/icu/icu.gyp:icui18n', + '../../third_party/icu/icu.gyp:icuuc', + ], + 'sources': [ + '../../googleurl/src/gurl.cc', + '../../googleurl/src/gurl.h', + '../../googleurl/src/url_canon.h', + '../../googleurl/src/url_canon_etc.cc', + '../../googleurl/src/url_canon_fileurl.cc', + '../../googleurl/src/url_canon_host.cc', + '../../googleurl/src/url_canon_icu.cc', + '../../googleurl/src/url_canon_icu.h', + '../../googleurl/src/url_canon_internal.cc', + '../../googleurl/src/url_canon_internal.h', + '../../googleurl/src/url_canon_internal_file.h', + '../../googleurl/src/url_canon_ip.cc', + '../../googleurl/src/url_canon_ip.h', + '../../googleurl/src/url_canon_mailtourl.cc', + '../../googleurl/src/url_canon_path.cc', + '../../googleurl/src/url_canon_pathurl.cc', + '../../googleurl/src/url_canon_query.cc', + '../../googleurl/src/url_canon_relative.cc', + '../../googleurl/src/url_canon_stdstring.h', + '../../googleurl/src/url_canon_stdurl.cc', + '../../googleurl/src/url_file.h', + '../../googleurl/src/url_parse.cc', + '../../googleurl/src/url_parse.h', + '../../googleurl/src/url_parse_file.cc', + '../../googleurl/src/url_parse_internal.h', + '../../googleurl/src/url_util.cc', + '../../googleurl/src/url_util.h', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '../..', + ], + }, + 'conditions': [ + ['OS=="win" and component=="shared_library"', { + 'defines': [ + 'GURL_DLL', + 'GURL_IMPLEMENTATION=1', + ], + 'direct_dependent_settings': { + 'defines': [ + 'GURL_DLL', + ], + }, + }], + ], + }, + { + 'target_name': 'googleurl_unittests', + 'dependencies': [ + 'googleurl', + '../../testing/gtest.gyp:gtest', + '../../third_party/icu/icu.gyp:icuuc', + ], + 'sources': [ + '../../googleurl/src/gurl_unittest.cc', + '../../googleurl/src/url_canon_unittest.cc', + '../../googleurl/src/url_parse_unittest.cc', + '../../googleurl/src/url_test_utils.h', + '../../googleurl/src/url_util_unittest.cc', + '../../googleurl/src/gurl_test_main.cc', + ], + 'conditions': [ + ['OS=="linux" or OS=="freebsd"', { + 'conditions': [ + ['linux_use_tcmalloc==1', { + 'dependencies': [ + '../../base/allocator/allocator.gyp:allocator', + ], + }], + ], + }], + # TODO(victorw): The unittest code uses inline functions that access + # global variables, it also uses internal functions that we may not want + # to export, so skip building unittests for windows multi dll build. + # The googleurl functions are tested by the static library build. + ['OS=="win" and component=="shared_library"', { + 'type': 'none', + }, { + 'type': 'executable', + }], + ], + }, + ], +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/temp_gyp/googleurl.scons b/build/temp_gyp/googleurl.scons new file mode 100644 index 0000000..032325b --- /dev/null +++ b/build/temp_gyp/googleurl.scons @@ -0,0 +1,343 @@ +# This file is generated; do not edit. + +import os + +Import("env") + +env = env.Clone(COMPONENT_NAME='googleurl', + TARGET_NAME='googleurl') + +configurations = { + 'Release' : { + 'Append' : dict( + CCFLAGS = [ + '-Werror', + '-pthread', + '-fno-exceptions', + '-Wall', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-pthread', + '-D_REENTRANT', + '-I/usr/include/gtk-2.0', + '-I/usr/lib/gtk-2.0/include', + '-I/usr/include/atk-1.0', + '-I/usr/include/cairo', + '-I/usr/include/pango-1.0', + '-I/usr/include/gio-unix-2.0/', + '-I/usr/include/glib-2.0', + '-I/usr/lib/glib-2.0/include', + '-I/usr/include/pixman-1', + '-I/usr/include/freetype2', + '-I/usr/include/directfb', + '-I/usr/include/libpng12', + '-O2', + '-fno-ident', + '-fdata-sections', + '-ffunction-sections', + '-fno-asynchronous-unwind-tables' + ], + CPPDEFINES = [ + '__STDC_FORMAT_MACROS', + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'U_STATIC_IMPLEMENTATION', + 'NDEBUG', + 'NVALGRIND' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/i18n'), + env.Dir('$SRC_DIR/build/temp_gyp/../..') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-Wl,--gc-sections' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, + 'Debug' : { + 'Append' : dict( + CCFLAGS = [ + '-Werror', + '-pthread', + '-fno-exceptions', + '-Wall', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-pthread', + '-D_REENTRANT', + '-I/usr/include/gtk-2.0', + '-I/usr/lib/gtk-2.0/include', + '-I/usr/include/atk-1.0', + '-I/usr/include/cairo', + '-I/usr/include/pango-1.0', + '-I/usr/include/gio-unix-2.0/', + '-I/usr/include/glib-2.0', + '-I/usr/lib/glib-2.0/include', + '-I/usr/include/pixman-1', + '-I/usr/include/freetype2', + '-I/usr/include/directfb', + '-I/usr/include/libpng12', + '-O0', + '-g' + ], + CPPDEFINES = [ + '__STDC_FORMAT_MACROS', + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'U_STATIC_IMPLEMENTATION', + '_DEBUG' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/i18n'), + env.Dir('$SRC_DIR/build/temp_gyp/../..') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-rdynamic' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, +} + +config = configurations[env['CONFIG_NAME']] +env.Append(**config['Append']) +env.FilterOut(**config['FilterOut']) +env.Replace(**config['Replace']) + +# Scons forces -fPIC for SHCCFLAGS on some platforms. +# Disable that so we can control it from cflags in gyp. +# Note that Scons itself is inconsistent with its -fPIC +# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not. +# This will make SHCCFLAGS consistent with SHCFLAGS. +env['SHCCFLAGS'] = ['$CCFLAGS'] + +for _var in config['ImportExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env[_var] = os.environ[_var] +for _var in config['PropagateExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env['ENV'][_var] = os.environ[_var] + +env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR') + +if ARGUMENTS.get('COVERAGE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-fprofile-arcs', + '-ftest-coverage' + ], + LINKFLAGS = [ + '-fprofile-arcs' + ], + ) + +if ARGUMENTS.get('PROFILE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-pg', + '-g' + ], + LINKFLAGS = [ + '-pg' + ], + ) + +if ARGUMENTS.get('SYMBOLS') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-g' + ], + ) + +input_files = [ + '../../googleurl/src/gurl.cc', + '../../googleurl/src/gurl.h', + '../../googleurl/src/url_canon.h', + '../../googleurl/src/url_canon_etc.cc', + '../../googleurl/src/url_canon_fileurl.cc', + '../../googleurl/src/url_canon_host.cc', + '../../googleurl/src/url_canon_icu.cc', + '../../googleurl/src/url_canon_icu.h', + '../../googleurl/src/url_canon_internal.cc', + '../../googleurl/src/url_canon_internal.h', + '../../googleurl/src/url_canon_internal_file.h', + '../../googleurl/src/url_canon_ip.cc', + '../../googleurl/src/url_canon_ip.h', + '../../googleurl/src/url_canon_mailtourl.cc', + '../../googleurl/src/url_canon_path.cc', + '../../googleurl/src/url_canon_pathurl.cc', + '../../googleurl/src/url_canon_query.cc', + '../../googleurl/src/url_canon_relative.cc', + '../../googleurl/src/url_canon_stdstring.h', + '../../googleurl/src/url_canon_stdurl.cc', + '../../googleurl/src/url_file.h', + '../../googleurl/src/url_parse.cc', + '../../googleurl/src/url_parse.h', + '../../googleurl/src/url_parse_file.cc', + '../../googleurl/src/url_parse_internal.h', + '../../googleurl/src/url_util.cc', + '../../googleurl/src/url_util.h', +] + +target_files = [] +prerequisites = [] + +_result = [] +for infile in input_files: + if env.compilable(infile): + if (type(infile) == type('') + and (infile.startswith('$SRC_DIR/build/temp_gyp/') + or not os.path.isabs(env.subst(infile)))): + # Force files below the build directory by replacing all '..' + # elements in the path with '__': + base, ext = os.path.splitext(os.path.normpath(infile)) + base = [d == '..' and '__' or d for d in base.split('/')] + base = os.path.join(*base) + object = '${OBJ_DIR}/${COMPONENT_NAME}/${TARGET_NAME}/' + base + if not infile.startswith('$SRC_DIR/build/temp_gyp/'): + infile = '$SRC_DIR/build/temp_gyp/' + infile + infile = env.StaticObject(object, infile)[0] + else: + infile = env.StaticObject(infile)[0] + _result.append(infile) +input_files = _result + +_outputs = env.GypStaticLibrary(env.File('${LIB_DIR}/${LIBPREFIX}googleurl${LIBSUFFIX}'), input_files) +target_files.extend(_outputs) + +gyp_target = env.Alias('googleurl', target_files) +env.Requires(gyp_target, prerequisites) +Return("gyp_target") diff --git a/build/temp_gyp/googleurl.target.mk b/build/temp_gyp/googleurl.target.mk new file mode 100644 index 0000000..8648a40 --- /dev/null +++ b/build/temp_gyp/googleurl.target.mk @@ -0,0 +1,169 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := googleurl +DEFS_Debug := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DU_STATIC_IMPLEMENTATION' \ + '-D__STDC_FORMAT_MACROS' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=1' \ + '-D_DEBUG' + +# Flags passed to both C and C++ files. +CFLAGS_Debug := -Werror \ + -pthread \ + -fno-exceptions \ + -Wall \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -pthread \ + -D_REENTRANT \ + -I/usr/include/gtk-2.0 \ + -I/usr/lib/gtk-2.0/include \ + -I/usr/include/atk-1.0 \ + -I/usr/include/cairo \ + -I/usr/include/pango-1.0 \ + -I/usr/include/gio-unix-2.0/ \ + -I/usr/include/glib-2.0 \ + -I/usr/lib/glib-2.0/include \ + -I/usr/include/pixman-1 \ + -I/usr/include/freetype2 \ + -I/usr/include/directfb \ + -I/usr/include/libpng12 \ + -O0 \ + -g + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Debug := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Debug := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Debug := -Ithird_party/icu/public/common \ + -Ithird_party/icu/public/i18n \ + -I. + +DEFS_Release := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DU_STATIC_IMPLEMENTATION' \ + '-D__STDC_FORMAT_MACROS' \ + '-DNDEBUG' \ + '-DNVALGRIND' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=0' + +# Flags passed to both C and C++ files. +CFLAGS_Release := -Werror \ + -pthread \ + -fno-exceptions \ + -Wall \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -pthread \ + -D_REENTRANT \ + -I/usr/include/gtk-2.0 \ + -I/usr/lib/gtk-2.0/include \ + -I/usr/include/atk-1.0 \ + -I/usr/include/cairo \ + -I/usr/include/pango-1.0 \ + -I/usr/include/gio-unix-2.0/ \ + -I/usr/include/glib-2.0 \ + -I/usr/lib/glib-2.0/include \ + -I/usr/include/pixman-1 \ + -I/usr/include/freetype2 \ + -I/usr/include/directfb \ + -I/usr/include/libpng12 \ + -O2 \ + -fno-ident \ + -fdata-sections \ + -ffunction-sections + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Release := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Release := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Release := -Ithird_party/icu/public/common \ + -Ithird_party/icu/public/i18n \ + -I. + +OBJS := $(obj).target/$(TARGET)/googleurl/src/gurl.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_etc.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_fileurl.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_host.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_icu.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_internal.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_ip.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_mailtourl.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_path.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_pathurl.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_query.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_relative.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_stdurl.o \ + $(obj).target/$(TARGET)/googleurl/src/url_parse.o \ + $(obj).target/$(TARGET)/googleurl/src/url_parse_file.o \ + $(obj).target/$(TARGET)/googleurl/src/url_util.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := -pthread \ + -Wl,-z,noexecstack \ + -rdynamic + +LDFLAGS_Release := -pthread \ + -Wl,-z,noexecstack \ + -Wl,--gc-sections + +LIBS := + +$(obj).target/build/temp_gyp/libgoogleurl.a: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(obj).target/build/temp_gyp/libgoogleurl.a: LIBS := $(LIBS) +$(obj).target/build/temp_gyp/libgoogleurl.a: TOOLSET := $(TOOLSET) +$(obj).target/build/temp_gyp/libgoogleurl.a: $(OBJS) FORCE_DO_CMD + $(call do_cmd,alink) + +all_deps += $(obj).target/build/temp_gyp/libgoogleurl.a +# Add target alias +.PHONY: googleurl +googleurl: $(obj).target/build/temp_gyp/libgoogleurl.a + +# Add target alias to "all" target. +.PHONY: all +all: googleurl + diff --git a/build/temp_gyp/googleurl_main.scons b/build/temp_gyp/googleurl_main.scons new file mode 100644 index 0000000..77b799a --- /dev/null +++ b/build/temp_gyp/googleurl_main.scons @@ -0,0 +1,339 @@ +# This file is generated; do not edit. + +__doc__ = ''' +Wrapper configuration for building this entire "solution," +including all the specific targets in various *.scons files. +''' + +import os +import sys + +import SCons.Environment +import SCons.Util + +def GetProcessorCount(): + ''' + Detects the number of CPUs on the system. Adapted form: + http://codeliberates.blogspot.com/2008/05/detecting-cpuscores-in-python.html + ''' + # Linux, Unix and Mac OS X: + if hasattr(os, 'sysconf'): + if os.sysconf_names.has_key('SC_NPROCESSORS_ONLN'): + # Linux and Unix or Mac OS X with python >= 2.5: + return os.sysconf('SC_NPROCESSORS_ONLN') + else: # Mac OS X with Python < 2.5: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + # Windows: + if os.environ.has_key('NUMBER_OF_PROCESSORS'): + return max(int(os.environ.get('NUMBER_OF_PROCESSORS', '1')), 1) + return 1 # Default + +# Support PROGRESS= to show progress in different ways. +p = ARGUMENTS.get('PROGRESS') +if p == 'spinner': + Progress(['/\r', '|\r', '\\\r', '-\r'], + interval=5, + file=open('/dev/tty', 'w')) +elif p == 'name': + Progress('$TARGET\r', overwrite=True, file=open('/dev/tty', 'w')) + +# Set the default -j value based on the number of processors. +SetOption('num_jobs', GetProcessorCount() + 1) + +# Have SCons use its cached dependency information. +SetOption('implicit_cache', 1) + +# Only re-calculate MD5 checksums if a timestamp has changed. +Decider('MD5-timestamp') + +# Since we set the -j value by default, suppress SCons warnings about being +# unable to support parallel build on versions of Python with no threading. +default_warnings = ['no-no-parallel-support'] +SetOption('warn', default_warnings + GetOption('warn')) + +AddOption('--mode', nargs=1, dest='conf_list', default=[], + action='append', help='Configuration to build.') + +AddOption('--verbose', dest='verbose', default=False, + action='store_true', help='Verbose command-line output.') + + +# +sconscript_file_map = dict( + base = '../../base/base.scons', + googleurl = 'googleurl.scons', + googleurl_unittests = 'googleurl_unittests.scons', + gtest = '../../testing/gtest.scons', + icudata = '../../third_party/icu/icudata.scons', + icui18n = '../../third_party/icu/icui18n.scons', + icuuc = '../../third_party/icu/icuuc.scons', + lastchange = '../util/lastchange.scons', + libevent = '../../third_party/libevent/libevent.scons', + modp_b64 = '../../third_party/modp_b64/modp_b64.scons', + ssl = '../../net/third_party/nss/ssl.scons', + symbolize = '../../base/symbolize.scons', + xdg_mime = '../../base/xdg_mime.scons', + zlib = '../../third_party/zlib/zlib.scons', +) + +class LoadTarget: + ''' + Class for deciding if a given target sconscript is to be included + based on a list of included target names, optionally prefixed with '-' + to exclude a target name. + ''' + def __init__(self, load): + ''' + Initialize a class with a list of names for possible loading. + + Arguments: + load: list of elements in the LOAD= specification + ''' + self.included = set([c for c in load if not c.startswith('-')]) + self.excluded = set([c[1:] for c in load if c.startswith('-')]) + + if not self.included: + self.included = set(['all']) + + def __call__(self, target): + ''' + Returns True if the specified target's sconscript file should be + loaded, based on the initialized included and excluded lists. + ''' + return (target in self.included or + ('all' in self.included and not target in self.excluded)) + +if 'LOAD' in ARGUMENTS: + load = ARGUMENTS['LOAD'].split(',') +else: + load = [] +load_target = LoadTarget(load) + +sconscript_files = [] +for target, sconscript in sconscript_file_map.iteritems(): + if load_target(target): + sconscript_files.append(sconscript) + + +target_alias_list= [] + +conf_list = GetOption('conf_list') +if conf_list: + # In case the same --mode= value was specified multiple times. + conf_list = list(set(conf_list)) +else: + conf_list = ['Debug'] + +sconsbuild_dir = Dir('../../sconsbuild') + + +def FilterOut(self, **kw): + kw = SCons.Environment.copy_non_reserved_keywords(kw) + for key, val in kw.items(): + envval = self.get(key, None) + if envval is None: + # No existing variable in the environment, so nothing to delete. + continue + + for vremove in val: + # Use while not if, so we can handle duplicates. + while vremove in envval: + envval.remove(vremove) + + self[key] = envval + + # TODO(sgk): SCons.Environment.Append() has much more logic to deal + # with various types of values. We should handle all those cases in here + # too. (If variable is a dict, etc.) + + +non_compilable_suffixes = { + 'LINUX' : set([ + '.bdic', + '.css', + '.dat', + '.fragment', + '.gperf', + '.h', + '.hh', + '.hpp', + '.html', + '.hxx', + '.idl', + '.in', + '.in0', + '.in1', + '.js', + '.mk', + '.rc', + '.sigs', + '', + ]), + 'WINDOWS' : set([ + '.h', + '.hh', + '.hpp', + '.dat', + '.idl', + '.in', + '.in0', + '.in1', + ]), +} + +def compilable(env, file): + base, ext = os.path.splitext(str(file)) + if ext in non_compilable_suffixes[env['TARGET_PLATFORM']]: + return False + return True + +def compilable_files(env, sources): + return [x for x in sources if compilable(env, x)] + +def GypProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def GypTestProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(*result) + return result + +def GypLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Library(target, source, *args, **kw) + return result + +def GypLoadableModule(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.LoadableModule(target, source, *args, **kw) + return result + +def GypStaticLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.StaticLibrary(target, source, *args, **kw) + return result + +def GypSharedLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.SharedLibrary(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def add_gyp_methods(env): + env.AddMethod(GypProgram) + env.AddMethod(GypTestProgram) + env.AddMethod(GypLibrary) + env.AddMethod(GypLoadableModule) + env.AddMethod(GypStaticLibrary) + env.AddMethod(GypSharedLibrary) + + env.AddMethod(FilterOut) + + env.AddMethod(compilable) + + +base_env = Environment( + tools = ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], + INTERMEDIATE_DIR='$OBJ_DIR/${COMPONENT_NAME}/_${TARGET_NAME}_intermediate', + LIB_DIR='$TOP_BUILDDIR/lib', + OBJ_DIR='$TOP_BUILDDIR/obj', + SCONSBUILD_DIR=sconsbuild_dir.abspath, + SHARED_INTERMEDIATE_DIR='$OBJ_DIR/_global_intermediate', + SRC_DIR=Dir('../..'), + TARGET_PLATFORM='LINUX', + TOP_BUILDDIR='$SCONSBUILD_DIR/$CONFIG_NAME', + LIBPATH=['$LIB_DIR'], +) + +if not GetOption('verbose'): + base_env.SetDefault( + ARCOMSTR='Creating library $TARGET', + ASCOMSTR='Assembling $TARGET', + CCCOMSTR='Compiling $TARGET', + CONCATSOURCECOMSTR='ConcatSource $TARGET', + CXXCOMSTR='Compiling $TARGET', + LDMODULECOMSTR='Building loadable module $TARGET', + LINKCOMSTR='Linking $TARGET', + MANIFESTCOMSTR='Updating manifest for $TARGET', + MIDLCOMSTR='Compiling IDL $TARGET', + PCHCOMSTR='Precompiling $TARGET', + RANLIBCOMSTR='Indexing $TARGET', + RCCOMSTR='Compiling resource $TARGET', + SHCCCOMSTR='Compiling $TARGET', + SHCXXCOMSTR='Compiling $TARGET', + SHLINKCOMSTR='Linking $TARGET', + SHMANIFESTCOMSTR='Updating manifest for $TARGET', + ) + +add_gyp_methods(base_env) + +for conf in conf_list: + env = base_env.Clone(CONFIG_NAME=conf) + SConsignFile(env.File('$TOP_BUILDDIR/.sconsign').abspath) + for sconscript in sconscript_files: + target_alias = env.SConscript(sconscript, exports=['env']) + if target_alias: + target_alias_list.extend(target_alias) + +Default(Alias('all', target_alias_list)) + +help_fmt = ''' +Usage: hammer [SCONS_OPTIONS] [VARIABLES] [TARGET] ... + +Local command-line build options: + --mode=CONFIG Configuration to build: + --mode=Debug [default] + --mode=Release + --verbose Print actual executed command lines. + +Supported command-line build variables: + LOAD=[module,...] Comma-separated list of components to load in the + dependency graph ('-' prefix excludes) + PROGRESS=type Display a progress indicator: + name: print each evaluated target name + spinner: print a spinner every 5 targets + +The following TARGET names can also be used as LOAD= module names: + +%s +''' + +if GetOption('help'): + def columnar_text(items, width=78, indent=2, sep=2): + result = [] + colwidth = max(map(len, items)) + sep + cols = (width - indent) / colwidth + if cols < 1: + cols = 1 + rows = (len(items) + cols - 1) / cols + indent = '%*s' % (indent, '') + sep = indent + for row in xrange(0, rows): + result.append(sep) + for i in xrange(row, len(items), rows): + result.append('%-*s' % (colwidth, items[i])) + sep = '\n' + indent + result.append('\n') + return ''.join(result) + + load_list = set(sconscript_file_map.keys()) + target_aliases = set(map(str, target_alias_list)) + + common = load_list and target_aliases + load_only = load_list - common + target_only = target_aliases - common + help_text = [help_fmt % columnar_text(sorted(list(common)))] + if target_only: + fmt = "The following are additional TARGET names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(target_only)))) + if load_only: + fmt = "The following are additional LOAD= module names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(load_only)))) + Help(''.join(help_text)) diff --git a/build/temp_gyp/googleurl_unittests.scons b/build/temp_gyp/googleurl_unittests.scons new file mode 100644 index 0000000..808b660 --- /dev/null +++ b/build/temp_gyp/googleurl_unittests.scons @@ -0,0 +1,421 @@ +# This file is generated; do not edit. + +import os + +Import("env") + +env = env.Clone(COMPONENT_NAME='googleurl', + TARGET_NAME='googleurl_unittests') + +configurations = { + 'Release' : { + 'Append' : dict( + CCFLAGS = [ + '-Werror', + '-pthread', + '-fno-exceptions', + '-Wall', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-O2', + '-fno-ident', + '-fdata-sections', + '-ffunction-sections', + '-fno-asynchronous-unwind-tables' + ], + CPPDEFINES = [ + '__STDC_FORMAT_MACROS', + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'UNIT_TEST', + 'GTEST_HAS_RTTI=0', + 'U_STATIC_IMPLEMENTATION', + 'NDEBUG', + 'NVALGRIND' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/temp_gyp/../..'), + env.Dir('$SRC_DIR/build/temp_gyp/../../testing/gtest/include') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-Wl,--gc-sections' + ], + LIBS = [ + '-lrt', + '-lgtk-x11-2.0', + '-lgdk-x11-2.0', + '-latk-1.0', + '-lgio-2.0', + '-lpangoft2-1.0', + '-lgdk_pixbuf-2.0', + '-lm', + '-lpangocairo-1.0', + '-lcairo', + '-lpango-1.0', + '-lfreetype', + '-lfontconfig', + '-lgobject-2.0', + '-lgmodule-2.0', + '-lgthread-2.0', + '-lrt', + '-lglib-2.0', + '-lnss3', + '-lnssutil3', + '-lsmime3', + '-lplds4', + '-lplc4', + '-lnspr4', + '-lpthread', + '-ldl', + '-lz', + '-lrt', + 'libgoogleurl', + 'libgtest', + 'libicuuc', + 'libbase', + 'libmodp_b64', + 'libssl', + 'libzlib', + 'libsymbolize', + 'libxdg_mime', + 'libevent', + 'libicudata', + 'libicui18n' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, + 'Debug' : { + 'Append' : dict( + CCFLAGS = [ + '-Werror', + '-pthread', + '-fno-exceptions', + '-Wall', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-O0', + '-g' + ], + CPPDEFINES = [ + '__STDC_FORMAT_MACROS', + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'UNIT_TEST', + 'GTEST_HAS_RTTI=0', + 'U_STATIC_IMPLEMENTATION', + '_DEBUG' + ], + CPPPATH = [ + env.Dir('$SRC_DIR/build/temp_gyp/../../third_party/icu/public/common'), + env.Dir('$SRC_DIR/build/temp_gyp/../..'), + env.Dir('$SRC_DIR/build/temp_gyp/../../testing/gtest/include') + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-rdynamic' + ], + LIBS = [ + '-lrt', + '-lgtk-x11-2.0', + '-lgdk-x11-2.0', + '-latk-1.0', + '-lgio-2.0', + '-lpangoft2-1.0', + '-lgdk_pixbuf-2.0', + '-lm', + '-lpangocairo-1.0', + '-lcairo', + '-lpango-1.0', + '-lfreetype', + '-lfontconfig', + '-lgobject-2.0', + '-lgmodule-2.0', + '-lgthread-2.0', + '-lrt', + '-lglib-2.0', + '-lnss3', + '-lnssutil3', + '-lsmime3', + '-lplds4', + '-lplc4', + '-lnspr4', + '-lpthread', + '-ldl', + '-lz', + '-lrt', + 'libgoogleurl', + 'libgtest', + 'libicuuc', + 'libbase', + 'libmodp_b64', + 'libssl', + 'libzlib', + 'libsymbolize', + 'libxdg_mime', + 'libevent', + 'libicudata', + 'libicui18n' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, +} + +config = configurations[env['CONFIG_NAME']] +env.Append(**config['Append']) +env.FilterOut(**config['FilterOut']) +env.Replace(**config['Replace']) + +# Scons forces -fPIC for SHCCFLAGS on some platforms. +# Disable that so we can control it from cflags in gyp. +# Note that Scons itself is inconsistent with its -fPIC +# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not. +# This will make SHCCFLAGS consistent with SHCFLAGS. +env['SHCCFLAGS'] = ['$CCFLAGS'] + +for _var in config['ImportExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env[_var] = os.environ[_var] +for _var in config['PropagateExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env['ENV'][_var] = os.environ[_var] + +env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR') + +if ARGUMENTS.get('COVERAGE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-fprofile-arcs', + '-ftest-coverage' + ], + LINKFLAGS = [ + '-fprofile-arcs' + ], + ) + +if ARGUMENTS.get('PROFILE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-pg', + '-g' + ], + LINKFLAGS = [ + '-pg' + ], + ) + +if ARGUMENTS.get('SYMBOLS') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-g' + ], + ) + +input_files = [ + '../../googleurl/src/gurl_unittest.cc', + '../../googleurl/src/url_canon_unittest.cc', + '../../googleurl/src/url_parse_unittest.cc', + '../../googleurl/src/url_test_utils.h', + '../../googleurl/src/url_util_unittest.cc', + '../../googleurl/src/gurl_test_main.cc', +] + +target_files = [] +prerequisites = [] + +_result = [] +for infile in input_files: + if env.compilable(infile): + if (type(infile) == type('') + and (infile.startswith('$SRC_DIR/build/temp_gyp/') + or not os.path.isabs(env.subst(infile)))): + # Force files below the build directory by replacing all '..' + # elements in the path with '__': + base, ext = os.path.splitext(os.path.normpath(infile)) + base = [d == '..' and '__' or d for d in base.split('/')] + base = os.path.join(*base) + object = '${OBJ_DIR}/${COMPONENT_NAME}/${TARGET_NAME}/' + base + if not infile.startswith('$SRC_DIR/build/temp_gyp/'): + infile = '$SRC_DIR/build/temp_gyp/' + infile + infile = env.StaticObject(object, infile)[0] + else: + infile = env.StaticObject(infile)[0] + _result.append(infile) +input_files = _result + +_outputs = env.GypProgram(env.File('${TOP_BUILDDIR}/${PROGPREFIX}googleurl_unittests${PROGSUFFIX}'), input_files) +target_files.extend(_outputs) + +if GetOption('verbose'): + _action = Action([['cd', + '"/usr/local/google/src/chromium-merge/src/build/temp_gyp"', + '&&', + '$TARGET_NAME', + '--gtest_print_time']]) +else: + _action = Action([['cd', + '"/usr/local/google/src/chromium-merge/src/build/temp_gyp"', + '&&', + '$TARGET_NAME', + '--gtest_print_time']], ) + +gyp_target = env.Alias('googleurl_unittests', target_files) +dependencies = [ + Alias('googleurl'), + Alias('gtest'), + Alias('icuuc'), + Alias('base'), + Alias('modp_b64'), + Alias('gtk'), + Alias('nss'), + Alias('ssl'), + Alias('zlib'), + Alias('symbolize'), + Alias('xdg_mime'), + Alias('libevent'), + Alias('icudata'), + Alias('icui18n') +] +env.Requires(target_files, dependencies) +env.Requires(gyp_target, dependencies) +for prerequisite in prerequisites: + env.Requires(prerequisite, dependencies) +env.Requires(gyp_target, prerequisites) + +_run_as_target = env.Alias('run_googleurl_unittests', target_files, _action) +env.Requires(_run_as_target, [ + Alias('googleurl_unittests'), +]) +env.AlwaysBuild(_run_as_target) +Return("gyp_target") diff --git a/build/temp_gyp/googleurl_unittests.target.mk b/build/temp_gyp/googleurl_unittests.target.mk new file mode 100644 index 0000000..0f023ed --- /dev/null +++ b/build/temp_gyp/googleurl_unittests.target.mk @@ -0,0 +1,168 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := googleurl_unittests +DEFS_Debug := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DUNIT_TEST' \ + '-DGTEST_HAS_RTTI=0' \ + '-DU_STATIC_IMPLEMENTATION' \ + '-D__STDC_FORMAT_MACROS' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=1' \ + '-D_DEBUG' + +# Flags passed to both C and C++ files. +CFLAGS_Debug := -Werror \ + -pthread \ + -fno-exceptions \ + -Wall \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -O0 \ + -g + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Debug := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Debug := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Debug := -Ithird_party/icu/public/common \ + -I. \ + -Itesting/gtest/include + +DEFS_Release := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DUNIT_TEST' \ + '-DGTEST_HAS_RTTI=0' \ + '-DU_STATIC_IMPLEMENTATION' \ + '-D__STDC_FORMAT_MACROS' \ + '-DNDEBUG' \ + '-DNVALGRIND' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=0' + +# Flags passed to both C and C++ files. +CFLAGS_Release := -Werror \ + -pthread \ + -fno-exceptions \ + -Wall \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -O2 \ + -fno-ident \ + -fdata-sections \ + -ffunction-sections + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Release := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Release := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Release := -Ithird_party/icu/public/common \ + -I. \ + -Itesting/gtest/include + +OBJS := $(obj).target/$(TARGET)/googleurl/src/gurl_unittest.o \ + $(obj).target/$(TARGET)/googleurl/src/url_canon_unittest.o \ + $(obj).target/$(TARGET)/googleurl/src/url_parse_unittest.o \ + $(obj).target/$(TARGET)/googleurl/src/url_util_unittest.o \ + $(obj).target/$(TARGET)/googleurl/src/gurl_test_main.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# Make sure our dependencies are built before any of us. +$(OBJS): | $(obj).target/build/temp_gyp/libgoogleurl.a $(obj).target/testing/libgtest.a $(obj).target/third_party/icu/libicuuc.a $(obj).target/base/allocator/liballocator.a $(obj).target/base/libbase.a $(obj).target/third_party/modp_b64/libmodp_b64.a $(obj).target/base/third_party/dynamic_annotations/libdynamic_annotations.a $(obj).target/base/libsymbolize.a $(obj).target/net/third_party/nss/libssl.a $(obj).target/third_party/zlib/libzlib.a $(obj).target/base/libxdg_mime.a $(obj).target/third_party/libevent/libevent.a $(obj).target/third_party/icu/libicudata.a $(obj).target/third_party/icu/libicui18n.a + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := -pthread \ + -Wl,-z,noexecstack \ + -Wl,-uIsHeapProfilerRunning,-uProfilerStart \ + -Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi \ + -Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl \ + -rdynamic + +LDFLAGS_Release := -pthread \ + -Wl,-z,noexecstack \ + -Wl,-uIsHeapProfilerRunning,-uProfilerStart \ + -Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi \ + -Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl \ + -Wl,--gc-sections + +LIBS := -lrt \ + -ldl \ + -lgtk-x11-2.0 \ + -lgdk-x11-2.0 \ + -latk-1.0 \ + -lgio-2.0 \ + -lpangoft2-1.0 \ + -lgdk_pixbuf-2.0 \ + -lm \ + -lpangocairo-1.0 \ + -lcairo \ + -lpango-1.0 \ + -lfreetype \ + -lfontconfig \ + -lgobject-2.0 \ + -lgmodule-2.0 \ + -lgthread-2.0 \ + -lglib-2.0 \ + -lnss3 \ + -lnssutil3 \ + -lsmime3 \ + -lplds4 \ + -lplc4 \ + -lnspr4 \ + -lpthread \ + -lz + +$(builddir)/googleurl_unittests: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(builddir)/googleurl_unittests: LIBS := $(LIBS) +$(builddir)/googleurl_unittests: TOOLSET := $(TOOLSET) +$(builddir)/googleurl_unittests: $(OBJS) $(obj).target/build/temp_gyp/libgoogleurl.a $(obj).target/testing/libgtest.a $(obj).target/third_party/icu/libicuuc.a $(obj).target/base/allocator/liballocator.a $(obj).target/base/libbase.a $(obj).target/third_party/modp_b64/libmodp_b64.a $(obj).target/base/third_party/dynamic_annotations/libdynamic_annotations.a $(obj).target/base/libsymbolize.a $(obj).target/net/third_party/nss/libssl.a $(obj).target/third_party/zlib/libzlib.a $(obj).target/base/libxdg_mime.a $(obj).target/third_party/libevent/libevent.a $(obj).target/third_party/icu/libicudata.a $(obj).target/third_party/icu/libicui18n.a FORCE_DO_CMD + $(call do_cmd,link) + +all_deps += $(builddir)/googleurl_unittests +# Add target alias +.PHONY: googleurl_unittests +googleurl_unittests: $(builddir)/googleurl_unittests + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/googleurl_unittests + diff --git a/build/temp_gyp/pdfsqueeze.gyp b/build/temp_gyp/pdfsqueeze.gyp new file mode 100644 index 0000000..d7a742c --- /dev/null +++ b/build/temp_gyp/pdfsqueeze.gyp @@ -0,0 +1,46 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'pdfsqueeze', + 'type': 'executable', + 'sources': [ + '../../third_party/pdfsqueeze/pdfsqueeze.m', + ], + 'defines': [ + # Use defines to map the full path names that will be used for + # the vars into the short forms expected by pdfsqueeze.m. + '______third_party_pdfsqueeze_ApplyGenericRGB_qfilter=ApplyGenericRGB_qfilter', + '______third_party_pdfsqueeze_ApplyGenericRGB_qfilter_len=ApplyGenericRGB_qfilter_len', + ], + 'include_dirs': [ + '<(INTERMEDIATE_DIR)', + ], + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/Quartz.framework', + ], + 'actions': [ + { + 'action_name': 'Generate inline filter data', + 'inputs': [ + '../../third_party/pdfsqueeze/ApplyGenericRGB.qfilter', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/ApplyGenericRGB.h', + ], + 'action': ['xxd', '-i', '<@(_inputs)', '<@(_outputs)'], + }, + ], + }, + ], +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/util/SConstruct b/build/util/SConstruct new file mode 100644 index 0000000..bd7020c --- /dev/null +++ b/build/util/SConstruct @@ -0,0 +1,2 @@ +# This file is generated; do not edit. +SConscript('build_util_main.scons') diff --git a/build/util/build_util.Makefile b/build/util/build_util.Makefile new file mode 100644 index 0000000..ea46b78 --- /dev/null +++ b/build/util/build_util.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= /usr/local/google/src/chromium-merge/src/build/util/out +.PHONY: all +all: + $(MAKE) -C ../.. lastchange diff --git a/build/util/build_util.gyp b/build/util/build_util.gyp new file mode 100644 index 0000000..a909177 --- /dev/null +++ b/build/util/build_util.gyp @@ -0,0 +1,43 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'lastchange', + 'type': 'none', + 'variables': { + 'lastchange_out_path': '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE', + 'default_lastchange_path': '../LASTCHANGE.in', + }, + 'actions': [ + { + 'action_name': 'lastchange', + 'inputs': [ + # Note: <(default_lastchange_path) is optional, + # so it doesn't show up in inputs. + './lastchange.py', + ], + 'outputs': [ + '<(lastchange_out_path).always', + '<(lastchange_out_path)', + ], + 'action': [ + 'python', '<@(_inputs)', + '-o', '<(lastchange_out_path)', + '-d', '<(default_lastchange_path)', + ], + 'message': 'Extracting last change to <(lastchange_out_path)', + 'process_outputs_as_sources': '1', + }, + ], + }, + ] +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: diff --git a/build/util/build_util_main.scons b/build/util/build_util_main.scons new file mode 100644 index 0000000..41dc2c4 --- /dev/null +++ b/build/util/build_util_main.scons @@ -0,0 +1,326 @@ +# This file is generated; do not edit. + +__doc__ = ''' +Wrapper configuration for building this entire "solution," +including all the specific targets in various *.scons files. +''' + +import os +import sys + +import SCons.Environment +import SCons.Util + +def GetProcessorCount(): + ''' + Detects the number of CPUs on the system. Adapted form: + http://codeliberates.blogspot.com/2008/05/detecting-cpuscores-in-python.html + ''' + # Linux, Unix and Mac OS X: + if hasattr(os, 'sysconf'): + if os.sysconf_names.has_key('SC_NPROCESSORS_ONLN'): + # Linux and Unix or Mac OS X with python >= 2.5: + return os.sysconf('SC_NPROCESSORS_ONLN') + else: # Mac OS X with Python < 2.5: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + # Windows: + if os.environ.has_key('NUMBER_OF_PROCESSORS'): + return max(int(os.environ.get('NUMBER_OF_PROCESSORS', '1')), 1) + return 1 # Default + +# Support PROGRESS= to show progress in different ways. +p = ARGUMENTS.get('PROGRESS') +if p == 'spinner': + Progress(['/\r', '|\r', '\\\r', '-\r'], + interval=5, + file=open('/dev/tty', 'w')) +elif p == 'name': + Progress('$TARGET\r', overwrite=True, file=open('/dev/tty', 'w')) + +# Set the default -j value based on the number of processors. +SetOption('num_jobs', GetProcessorCount() + 1) + +# Have SCons use its cached dependency information. +SetOption('implicit_cache', 1) + +# Only re-calculate MD5 checksums if a timestamp has changed. +Decider('MD5-timestamp') + +# Since we set the -j value by default, suppress SCons warnings about being +# unable to support parallel build on versions of Python with no threading. +default_warnings = ['no-no-parallel-support'] +SetOption('warn', default_warnings + GetOption('warn')) + +AddOption('--mode', nargs=1, dest='conf_list', default=[], + action='append', help='Configuration to build.') + +AddOption('--verbose', dest='verbose', default=False, + action='store_true', help='Verbose command-line output.') + + +# +sconscript_file_map = dict( + lastchange = 'lastchange.scons', +) + +class LoadTarget: + ''' + Class for deciding if a given target sconscript is to be included + based on a list of included target names, optionally prefixed with '-' + to exclude a target name. + ''' + def __init__(self, load): + ''' + Initialize a class with a list of names for possible loading. + + Arguments: + load: list of elements in the LOAD= specification + ''' + self.included = set([c for c in load if not c.startswith('-')]) + self.excluded = set([c[1:] for c in load if c.startswith('-')]) + + if not self.included: + self.included = set(['all']) + + def __call__(self, target): + ''' + Returns True if the specified target's sconscript file should be + loaded, based on the initialized included and excluded lists. + ''' + return (target in self.included or + ('all' in self.included and not target in self.excluded)) + +if 'LOAD' in ARGUMENTS: + load = ARGUMENTS['LOAD'].split(',') +else: + load = [] +load_target = LoadTarget(load) + +sconscript_files = [] +for target, sconscript in sconscript_file_map.iteritems(): + if load_target(target): + sconscript_files.append(sconscript) + + +target_alias_list= [] + +conf_list = GetOption('conf_list') +if conf_list: + # In case the same --mode= value was specified multiple times. + conf_list = list(set(conf_list)) +else: + conf_list = ['Debug'] + +sconsbuild_dir = Dir('../../sconsbuild') + + +def FilterOut(self, **kw): + kw = SCons.Environment.copy_non_reserved_keywords(kw) + for key, val in kw.items(): + envval = self.get(key, None) + if envval is None: + # No existing variable in the environment, so nothing to delete. + continue + + for vremove in val: + # Use while not if, so we can handle duplicates. + while vremove in envval: + envval.remove(vremove) + + self[key] = envval + + # TODO(sgk): SCons.Environment.Append() has much more logic to deal + # with various types of values. We should handle all those cases in here + # too. (If variable is a dict, etc.) + + +non_compilable_suffixes = { + 'LINUX' : set([ + '.bdic', + '.css', + '.dat', + '.fragment', + '.gperf', + '.h', + '.hh', + '.hpp', + '.html', + '.hxx', + '.idl', + '.in', + '.in0', + '.in1', + '.js', + '.mk', + '.rc', + '.sigs', + '', + ]), + 'WINDOWS' : set([ + '.h', + '.hh', + '.hpp', + '.dat', + '.idl', + '.in', + '.in0', + '.in1', + ]), +} + +def compilable(env, file): + base, ext = os.path.splitext(str(file)) + if ext in non_compilable_suffixes[env['TARGET_PLATFORM']]: + return False + return True + +def compilable_files(env, sources): + return [x for x in sources if compilable(env, x)] + +def GypProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def GypTestProgram(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Program(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(*result) + return result + +def GypLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.Library(target, source, *args, **kw) + return result + +def GypLoadableModule(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.LoadableModule(target, source, *args, **kw) + return result + +def GypStaticLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.StaticLibrary(target, source, *args, **kw) + return result + +def GypSharedLibrary(env, target, source, *args, **kw): + source = compilable_files(env, source) + result = env.SharedLibrary(target, source, *args, **kw) + if env.get('INCREMENTAL'): + env.Precious(result) + return result + +def add_gyp_methods(env): + env.AddMethod(GypProgram) + env.AddMethod(GypTestProgram) + env.AddMethod(GypLibrary) + env.AddMethod(GypLoadableModule) + env.AddMethod(GypStaticLibrary) + env.AddMethod(GypSharedLibrary) + + env.AddMethod(FilterOut) + + env.AddMethod(compilable) + + +base_env = Environment( + tools = ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'], + INTERMEDIATE_DIR='$OBJ_DIR/${COMPONENT_NAME}/_${TARGET_NAME}_intermediate', + LIB_DIR='$TOP_BUILDDIR/lib', + OBJ_DIR='$TOP_BUILDDIR/obj', + SCONSBUILD_DIR=sconsbuild_dir.abspath, + SHARED_INTERMEDIATE_DIR='$OBJ_DIR/_global_intermediate', + SRC_DIR=Dir('../..'), + TARGET_PLATFORM='LINUX', + TOP_BUILDDIR='$SCONSBUILD_DIR/$CONFIG_NAME', + LIBPATH=['$LIB_DIR'], +) + +if not GetOption('verbose'): + base_env.SetDefault( + ARCOMSTR='Creating library $TARGET', + ASCOMSTR='Assembling $TARGET', + CCCOMSTR='Compiling $TARGET', + CONCATSOURCECOMSTR='ConcatSource $TARGET', + CXXCOMSTR='Compiling $TARGET', + LDMODULECOMSTR='Building loadable module $TARGET', + LINKCOMSTR='Linking $TARGET', + MANIFESTCOMSTR='Updating manifest for $TARGET', + MIDLCOMSTR='Compiling IDL $TARGET', + PCHCOMSTR='Precompiling $TARGET', + RANLIBCOMSTR='Indexing $TARGET', + RCCOMSTR='Compiling resource $TARGET', + SHCCCOMSTR='Compiling $TARGET', + SHCXXCOMSTR='Compiling $TARGET', + SHLINKCOMSTR='Linking $TARGET', + SHMANIFESTCOMSTR='Updating manifest for $TARGET', + ) + +add_gyp_methods(base_env) + +for conf in conf_list: + env = base_env.Clone(CONFIG_NAME=conf) + SConsignFile(env.File('$TOP_BUILDDIR/.sconsign').abspath) + for sconscript in sconscript_files: + target_alias = env.SConscript(sconscript, exports=['env']) + if target_alias: + target_alias_list.extend(target_alias) + +Default(Alias('all', target_alias_list)) + +help_fmt = ''' +Usage: hammer [SCONS_OPTIONS] [VARIABLES] [TARGET] ... + +Local command-line build options: + --mode=CONFIG Configuration to build: + --mode=Debug [default] + --mode=Release + --verbose Print actual executed command lines. + +Supported command-line build variables: + LOAD=[module,...] Comma-separated list of components to load in the + dependency graph ('-' prefix excludes) + PROGRESS=type Display a progress indicator: + name: print each evaluated target name + spinner: print a spinner every 5 targets + +The following TARGET names can also be used as LOAD= module names: + +%s +''' + +if GetOption('help'): + def columnar_text(items, width=78, indent=2, sep=2): + result = [] + colwidth = max(map(len, items)) + sep + cols = (width - indent) / colwidth + if cols < 1: + cols = 1 + rows = (len(items) + cols - 1) / cols + indent = '%*s' % (indent, '') + sep = indent + for row in xrange(0, rows): + result.append(sep) + for i in xrange(row, len(items), rows): + result.append('%-*s' % (colwidth, items[i])) + sep = '\n' + indent + result.append('\n') + return ''.join(result) + + load_list = set(sconscript_file_map.keys()) + target_aliases = set(map(str, target_alias_list)) + + common = load_list and target_aliases + load_only = load_list - common + target_only = target_aliases - common + help_text = [help_fmt % columnar_text(sorted(list(common)))] + if target_only: + fmt = "The following are additional TARGET names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(target_only)))) + if load_only: + fmt = "The following are additional LOAD= module names:\n\n%s\n" + help_text.append(fmt % columnar_text(sorted(list(load_only)))) + Help(''.join(help_text)) diff --git a/build/util/lastchange.py b/build/util/lastchange.py new file mode 100644 index 0000000..8f1fb64 --- /dev/null +++ b/build/util/lastchange.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +lastchange.py -- Chromium revision fetching utility. +""" + +import optparse +import os +import re +import subprocess +import sys + + +def svn_fetch_revision(): + """ + Fetch the Subversion revision for the local tree. + + Errors are swallowed. + """ + try: + p = subprocess.Popen(['svn', 'info'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=(sys.platform=='win32')) + except OSError, e: + # 'svn' is apparently either not installed or not executable. + return None + revision = None + if p: + svn_re = re.compile('^Revision:\s+(\d+)', re.M) + m = svn_re.search(p.stdout.read()) + if m: + revision = m.group(1) + return revision + + +def git_fetch_id(): + """ + Fetch the GIT identifier for the local tree. + + Errors are swallowed. + """ + try: + p = subprocess.Popen(['git', 'log', '-1'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=(sys.platform=='win32')) + except OSError: + # 'git' is apparently either not installed or not executable. + return None + id = None + if p: + git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) + m = git_re.search(p.stdout.read()) + if m: + id = m.group(2) + return id + + +def fetch_change(default_lastchange): + """ + Returns the last change, from some appropriate revision control system. + """ + change = svn_fetch_revision() + if not change and sys.platform in ('linux2',): + change = git_fetch_id() + if not change: + if default_lastchange and os.path.exists(default_lastchange): + change = open(default_lastchange, 'r').read().strip() + else: + change = '0' + return change + + +def write_if_changed(file_name, contents): + """ + Writes the specified contents to the specified file_name + iff the contents are different than the current contents. + """ + try: + old_contents = open(file_name, 'r').read() + except EnvironmentError: + pass + else: + if contents == old_contents: + return + os.unlink(file_name) + open(file_name, 'w').write(contents) + + +def main(argv=None): + if argv is None: + argv = sys.argv + + parser = optparse.OptionParser(usage="lastchange.py [-h] [[-o] FILE]") + parser.add_option("-d", "--default-lastchange", metavar="FILE", + help="default last change input FILE") + parser.add_option("-o", "--output", metavar="FILE", + help="write last change to FILE") + opts, args = parser.parse_args(argv[1:]) + + out_file = opts.output + + while len(args) and out_file is None: + if out_file is None: + out_file = args.pop(0) + if args: + sys.stderr.write('Unexpected arguments: %r\n\n' % args) + parser.print_help() + sys.exit(2) + + change = fetch_change(opts.default_lastchange) + + contents = "LASTCHANGE=%s\n" % change + + if out_file: + write_if_changed(out_file, contents) + else: + sys.stdout.write(contents) + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/build/util/lastchange.scons b/build/util/lastchange.scons new file mode 100644 index 0000000..9c26cce --- /dev/null +++ b/build/util/lastchange.scons @@ -0,0 +1,278 @@ +# This file is generated; do not edit. + +import os + +Import("env") + +env = env.Clone(COMPONENT_NAME='build_util', + TARGET_NAME='lastchange') + +configurations = { + 'Release' : { + 'Append' : dict( + CCFLAGS = [ + '-pthread', + '-fno-exceptions', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-O2', + '-fno-ident', + '-fdata-sections', + '-ffunction-sections', + '-fno-asynchronous-unwind-tables' + ], + CPPDEFINES = [ + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + 'NDEBUG', + 'NVALGRIND' + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-Wl,--gc-sections' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, + 'Debug' : { + 'Append' : dict( + CCFLAGS = [ + '-pthread', + '-fno-exceptions', + '-D_FILE_OFFSET_BITS=64', + '-fvisibility=hidden', + '-fno-strict-aliasing', + '-O0', + '-g' + ], + CPPDEFINES = [ + 'CHROMIUM_BUILD', + 'ENABLE_GPU=1', + '_DEBUG' + ], + CXXFLAGS = [ + '-fno-rtti', + '-fno-threadsafe-statics', + '-fvisibility-inlines-hidden' + ], + LINKFLAGS = [ + '-pthread', + '-rdynamic' + ], + ), + 'FilterOut' : dict( + ), + 'Replace' : dict( + FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], + FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], + FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], + IMPLICIT_COMMAND_DEPENDENCIES = '0', + LDMODULECOM = [['$FLOCK_LDMODULE', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LDMODULEFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + LIBPATH = ['$LIB_DIR'], + LINKCOM = [['$FLOCK_LINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$LINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + SHLINKCOM = [['$FLOCK_SHLINK', + '-o', + '$TARGET', + '$_LIBDIRFLAGS', + '$SHLINKFLAGS', + '$SOURCES', + '-Wl,--start-group', + '$_LIBFLAGS', + '-Wl,--end-group']], + ), + 'ImportExternal' : [ + 'AS', + 'CC', + 'CXX', + 'LINK', + ], + 'PropagateExternal' : [ + 'AS', + 'CC', + 'CCACHE_DIR', + 'CXX', + 'DISTCC_DIR', + 'DISTCC_HOSTS', + 'HOME', + 'INCLUDE_SERVER_ARGS', + 'INCLUDE_SERVER_PORT', + 'LINK', + 'CHROME_BUILD_TYPE', + 'CHROMIUM_BUILD', + 'OFFICIAL_BUILD', + ], + }, +} + +config = configurations[env['CONFIG_NAME']] +env.Append(**config['Append']) +env.FilterOut(**config['FilterOut']) +env.Replace(**config['Replace']) + +# Scons forces -fPIC for SHCCFLAGS on some platforms. +# Disable that so we can control it from cflags in gyp. +# Note that Scons itself is inconsistent with its -fPIC +# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not. +# This will make SHCCFLAGS consistent with SHCFLAGS. +env['SHCCFLAGS'] = ['$CCFLAGS'] + +for _var in config['ImportExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env[_var] = os.environ[_var] +for _var in config['PropagateExternal']: + if _var in ARGUMENTS: + env[_var] = ARGUMENTS[_var] + elif _var in os.environ: + env['ENV'][_var] = os.environ[_var] + +env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR') + +if ARGUMENTS.get('COVERAGE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-fprofile-arcs', + '-ftest-coverage' + ], + LINKFLAGS = [ + '-fprofile-arcs' + ], + ) + +if ARGUMENTS.get('PROFILE') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-pg', + '-g' + ], + LINKFLAGS = [ + '-pg' + ], + ) + +if ARGUMENTS.get('SYMBOLS') not in (None, '0'): + env.AppendUnique( + CCFLAGS = [ + '-g' + ], + ) + +input_files = [] + +target_files = [] +prerequisites = [] + +if GetOption('verbose'): + _action = Action([['cd', + '$SRC_DIR/build/util', + '&&', + 'python', + './lastchange.py', + '-o', + '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE', + '-d', + '../LASTCHANGE.in']]) +else: + _action = Action([['cd', + '$SRC_DIR/build/util', + '&&', + 'python', + './lastchange.py', + '-o', + '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE', + '-d', + '../LASTCHANGE.in']], 'Extracting last change to ${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE') +_outputs = env.Command( + ['${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE', + '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE.always'], + ['$SRC_DIR/build/util/./lastchange.py'], + _action +) +input_files.extend(_outputs) +prerequisites.extend(_outputs) +target_files.extend(_outputs) + +target_files.extend(input_files) + +gyp_target = env.Alias('lastchange', target_files) +env.Requires(gyp_target, prerequisites) +Return("gyp_target") diff --git a/build/util/lastchange.target.mk b/build/util/lastchange.target.mk new file mode 100644 index 0000000..5a64d85 --- /dev/null +++ b/build/util/lastchange.target.mk @@ -0,0 +1,110 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := lastchange +### Rules for action "lastchange": +quiet_cmd_lastchange_lastchange = ACTION Extracting last change to $(obj)/gen/build/LASTCHANGE $@ +cmd_lastchange_lastchange = export LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; cd build/util; mkdir -p $(obj)/gen/build; python ./lastchange.py -o "$(obj)/gen/build/LASTCHANGE" -d ../LASTCHANGE.in + +$(obj)/gen/build/LASTCHANGE.always: obj := $(abs_obj) + +$(obj)/gen/build/LASTCHANGE.always: builddir := $(abs_builddir) + +$(obj)/gen/build/LASTCHANGE.always: TOOLSET := $(TOOLSET) +$(obj)/gen/build/LASTCHANGE.always: build/util/lastchange.py FORCE_DO_CMD + $(call do_cmd,lastchange_lastchange) +$(obj)/gen/build/LASTCHANGE: $(obj)/gen/build/LASTCHANGE.always +$(obj)/gen/build/LASTCHANGE: ; + +all_deps += $(obj)/gen/build/LASTCHANGE.always $(obj)/gen/build/LASTCHANGE +action_lastchange_lastchange_outputs := $(obj)/gen/build/LASTCHANGE.always $(obj)/gen/build/LASTCHANGE + + +DEFS_Debug := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=1' \ + '-D_DEBUG' + +# Flags passed to both C and C++ files. +CFLAGS_Debug := -pthread \ + -fno-exceptions \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -O0 \ + -g + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Debug := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Debug := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Debug := + +DEFS_Release := '-DNO_HEAPCHECKER' \ + '-DCHROMIUM_BUILD' \ + '-DENABLE_REMOTING=1' \ + '-DENABLE_GPU=1' \ + '-DNDEBUG' \ + '-DNVALGRIND' \ + '-DDYNAMIC_ANNOTATIONS_ENABLED=0' + +# Flags passed to both C and C++ files. +CFLAGS_Release := -pthread \ + -fno-exceptions \ + -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -D_FILE_OFFSET_BITS=64 \ + -fvisibility=hidden \ + -fno-strict-aliasing \ + -O2 \ + -fno-ident \ + -fdata-sections \ + -ffunction-sections + +# Flags passed to only C (and not C++) files. +CFLAGS_C_Release := + +# Flags passed to only C++ (and not C) files. +CFLAGS_CC_Release := -fno-rtti \ + -fno-threadsafe-statics \ + -fvisibility-inlines-hidden + +INCS_Release := + +OBJS := + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# Make sure our actions/rules run before any of us. +$(OBJS): | $(action_lastchange_lastchange_outputs) + + +### Rules for final target. +# Build our special outputs first. +$(obj).target/build/util/lastchange.stamp: | $(action_lastchange_lastchange_outputs) + +# Preserve order dependency of special output on deps. +$(action_lastchange_lastchange_outputs): | + +$(obj).target/build/util/lastchange.stamp: TOOLSET := $(TOOLSET) +$(obj).target/build/util/lastchange.stamp: FORCE_DO_CMD + $(call do_cmd,touch) + +all_deps += $(obj).target/build/util/lastchange.stamp +# Add target alias +.PHONY: lastchange +lastchange: $(obj).target/build/util/lastchange.stamp + +# Add target alias to "all" target. +.PHONY: all +all: lastchange + diff --git a/build/util/support/support.gyp b/build/util/support/support.gyp new file mode 100644 index 0000000..5840f80 --- /dev/null +++ b/build/util/support/support.gyp @@ -0,0 +1,21 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../../common.gypi', + ], + 'targets': [ + { + 'target_name': 'support', + 'type': 'none', + }, + # TODO(slightlyoff) + ], +} + +# vim: shiftwidth=2:et:ai:tabstop=2 diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt new file mode 100644 index 0000000..e434d0c --- /dev/null +++ b/build/whitespace_file.txt @@ -0,0 +1,5 @@ +This file is used for making non-code changes to trigger buildbot cycles. Make +any modification below this line. +================================================================================ + +Smash, smash, smash... diff --git a/build/win/chrome_win.croc b/build/win/chrome_win.croc new file mode 100644 index 0000000..d4770d6 --- /dev/null +++ b/build/win/chrome_win.croc @@ -0,0 +1,21 @@ +# -*- python -*- +# Crocodile config file for Chromium windows + +{ + # List of rules, applied in order + 'rules' : [ + # Specify inclusions before exclusions, since rules are in order. + + # Don't include posix or linux specific files + { + 'regexp' : '.*(_|/)(linux|posix)(\\.|_)', + 'include' : 0, + }, + + # Groups + { + 'regexp' : '.*_test_win\\.', + 'group' : 'test', + }, + ], +} diff --git a/build/win/system.gyp b/build/win/system.gyp new file mode 100644 index 0000000..0c06849 --- /dev/null +++ b/build/win/system.gyp @@ -0,0 +1,33 @@ +# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'cygwin', + 'type': 'none', + 'actions': [ + { + 'action_name': 'setup_mount', + 'msvs_cygwin_shell': 0, + 'inputs': [ + '../../third_party/cygwin/setup_mount.bat', + ], + # Visual Studio requires an output file, or else the + # custom build step won't run. + 'outputs': [ + '../../third_party/cygwin/_always_run_setup_mount.marker', + ], + 'action': ['', '<@(_inputs)'], + }, + ], + }, + ], +} + +# Local Variables: +# tab-width:2 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=2 shiftwidth=2: |