summaryrefslogtreecommitdiffstats
path: root/sdch
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 08:10:30 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 08:10:30 +0000
commit9e483ab325445c4070e2ea86e1b57beb652c2590 (patch)
tree0a1bd25386b08e314cd398091cff336f9a6bf7d6 /sdch
parentad04a7013db13a4402160e8596ab2f7e4f19fb0d (diff)
downloadchromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.zip
chromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.tar.gz
chromium_src-9e483ab325445c4070e2ea86e1b57beb652c2590.tar.bz2
Initial generation of native Visual Studio solution files
(project files still to come). To wit: * Solution file configuration is in *_sln.scons files (base\base_sln.scons, chrome\chrome_sln.scons). * Individual Project file configuration is in the the .scons file for the relevant target (base\base_unittests.scons, third_party\libxml\libxml.scons, etc.)--that is, where their file lists will live. * MSVSProject() calls are currently placeholders that establish the existence of Project Nodes (and Project dependencies) but don't yet have actual Project configuration information (file lists, .vsprops, etc.). * Configuraiton is very manual. In particular, the entries in the .sln file will be written out in exactly the order specified in the configuration(s). The current ordering is taken from our existing .sln files, so we can generate virtually the same configurations on output. * Generated solution files are nearly byte-for-byte identical with our existing .sln files, modulo: * net\dump_cache has a WebsiteProperties sections (making that configurable per project isn't important right now); * sandbox\sandbox.sln was missing a dependency of base.vcproj on on debug_message.vcproj (present in other .sln files) * webkit\webkit.sln was missing dependencies of WebCore.vcproj on libxml_config.vcproj and libxslt_config.vcproj (present in chrome.sln); * add a handful of other miscellaneous missing dependencies on various .vcproj definitions in chrome.sln (present in other .sln files). * remove stats_viewer.csproj from chrome.sln (sorry, mbelshe), which was complicating the solution configuration with unnecessary (for us) "Mixed Platform" types; * All MSVSFolder(), MSVSProject() and MSVSSolution() calls have hard-wired guid= values taken from our existing configuration, so we can: 1) verify generation of working configs; 2) minimize diffs when checking in generated .sln files. We can remove these in the future in favor of extracting them from existing .sln files if we wish. * Add ChromeMSVSFolder(), ChromeMSVSProject() and ChromeMSVSSolution() wrappers to chromium_builders.py, that gate the underlying call to the env.MSVS*() builders based on whether env.Bit('msvs') is set (i.e., we're in --mode=msvs). * Remove platform-specific gating of to-be-ported .scons files that we now need to load on any platform to generate coheren MSVS files. Move the env.Bit('windows') tests for actually building their executables into the individual .scons files. Review URL: http://codereview.chromium.org/14472 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sdch')
-rw-r--r--sdch/SConscript247
1 files changed, 125 insertions, 122 deletions
diff --git a/sdch/SConscript b/sdch/SConscript
index e931984..eaacaa3 100644
--- a/sdch/SConscript
+++ b/sdch/SConscript
@@ -1,122 +1,125 @@
-# Copyright (c) 2006-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.
-
-import re
-
-Import('env')
-
-env = env.Clone(OPEN_VCDIFF_DIR='open-vcdiff')
-
-cpppath = [
- '$OPEN_VCDIFF_DIR/src',
-]
-
-if env.Bit('windows'):
- cpppath.append('$OPEN_VCDIFF_DIR/vsprojects')
-
-env.Prepend(CPPPATH = cpppath)
-
-input_files = [
- '$OPEN_VCDIFF_DIR/src/addrcache.cc',
- '$OPEN_VCDIFF_DIR/src/adler32.c',
- '$OPEN_VCDIFF_DIR/src/blockhash.cc',
- '$OPEN_VCDIFF_DIR/src/codetable.cc',
- '$OPEN_VCDIFF_DIR/src/decodetable.cc',
- '$OPEN_VCDIFF_DIR/src/encodetable.cc',
- '$OPEN_VCDIFF_DIR/src/headerparser.cc',
- '$OPEN_VCDIFF_DIR/src/logging.cc',
- '$OPEN_VCDIFF_DIR/src/varint_bigendian.cc',
- '$OPEN_VCDIFF_DIR/src/vcdecoder.cc',
- '$OPEN_VCDIFF_DIR/src/vcdiffengine.cc',
-]
-
-env.ChromeStaticLibrary('sdch', input_files)
-
-if env.Bit('posix'):
-
- # Generate a target config.h file from a source config.h.in file.
- #
- # The list of defines has been taken empirically from Autoconf
- # (./configure) runs on Mac OS X and Ubuntu Hardy.
-
- defines = [
- 'HAVE_DLFCN_H',
- 'HAVE_FNMATCH_H',
- 'HAVE_GETOPT_H',
- 'HAVE_GETTIMEOFDAY',
- 'HAVE_INTTYPES_H',
- 'HAVE_MEMORY_H',
- 'HAVE_MPROTECT',
- 'HAVE_PTHREAD',
- 'HAVE_STDINT_H',
- 'HAVE_STDLIB_H',
- 'HAVE_STRINGS_H',
- 'HAVE_STRING_H',
- 'HAVE_STRTOLL',
- 'HAVE_STRTOQ',
- 'HAVE_SYS_MMAN_H',
- 'HAVE_SYS_STAT_H',
- 'HAVE_SYS_TIME_H',
- 'HAVE_SYS_TYPES_H',
- 'HAVE_UINT16_T',
- 'HAVE_UNISTD_H',
- 'HAVE_U_INT16_T',
- 'HAVE___ATTRIBUTE__',
- ('PACKAGE', '"open-vcdiff"'),
- ('PACKAGE_BUGREPORT', '"opensource@google.com"'),
- ('PACKAGE_NAME', '"open-vcdiff"'),
- ('PACKAGE_STRING', '"open-vcdiff 0.1"'),
- ('PACKAGE_TARNAME', '"open-vcdiff"'),
- ('PACKAGE_VERSION', '"0.1"'),
- ('VERSION', '"0.1"'),
- 'STDC_HEADERS',
- ]
-
- if env.Bit('linux'):
- defines.extend([
- 'HAVE_MALLOC_H',
- 'HAVE_MEMALIGN',
- 'HAVE_POSIX_MEMALIGN',
- ])
-
- if env.Bit('mac'):
- defines.extend([
- 'HAVE_WORKING_KQUEUE',
- ])
-
- def AutoConfig(target, source, env):
- """
- Action to generate a config.h file from an Autotools config.h.in file,
- given the list of definitions in the DEFINES construction variable.
-
- Each entry in DEFINES is either a string, in which case it
- will be enabled with a value of 1, or a tuple, in which case
- the first element is the #define name and the second its value.
-
- Any leftover #undef lines get commented out.
- """
- contents = open(str(source[0]), 'r').read()
-
- for d in env['DEFINES']:
- if isinstance(d, tuple):
- define, value = d
- else:
- define = d
- value = 1
- undef = '^#undef %s$' % re.escape(define)
- definition = '#define %s %s' % (define, value)
- contents = re.sub(undef, definition, contents)
-
- undef_re = re.compile(r'^(#undef .*)$', re.M)
- contents = undef_re.sub(r'/* \1 */', contents)
-
- header = '/* src/config.h. Generated by SCons. */\n'
- open(str(target[0]), 'w').write(header + contents)
-
- # varlist['DEFINES'] below makes the target config.h file depend
- # on the list of definitions in the passed-in $DEFINES variable.
- env.Command('$OPEN_VCDIFF_DIR/src/config.h',
- '$OPEN_VCDIFF_DIR/src/config.h.in',
- Action(AutoConfig, varlist=['DEFINES']),
- DEFINES=defines)
+# Copyright (c) 2006-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.
+
+import re
+
+Import('env')
+
+env = env.Clone(OPEN_VCDIFF_DIR='open-vcdiff')
+
+cpppath = [
+ '$OPEN_VCDIFF_DIR/src',
+]
+
+if env.Bit('windows'):
+ cpppath.append('$OPEN_VCDIFF_DIR/vsprojects')
+
+env.Prepend(CPPPATH = cpppath)
+
+input_files = [
+ '$OPEN_VCDIFF_DIR/src/addrcache.cc',
+ '$OPEN_VCDIFF_DIR/src/adler32.c',
+ '$OPEN_VCDIFF_DIR/src/blockhash.cc',
+ '$OPEN_VCDIFF_DIR/src/codetable.cc',
+ '$OPEN_VCDIFF_DIR/src/decodetable.cc',
+ '$OPEN_VCDIFF_DIR/src/encodetable.cc',
+ '$OPEN_VCDIFF_DIR/src/headerparser.cc',
+ '$OPEN_VCDIFF_DIR/src/logging.cc',
+ '$OPEN_VCDIFF_DIR/src/varint_bigendian.cc',
+ '$OPEN_VCDIFF_DIR/src/vcdecoder.cc',
+ '$OPEN_VCDIFF_DIR/src/vcdiffengine.cc',
+]
+
+env.ChromeStaticLibrary('sdch', input_files)
+
+env.ChromeMSVSProject('$SDCH_DIR/sdch.vcproj',
+ guid='{F54ABC59-5C00-414A-A9BA-BAF26D1699F0}')
+
+if env.Bit('posix'):
+
+ # Generate a target config.h file from a source config.h.in file.
+ #
+ # The list of defines has been taken empirically from Autoconf
+ # (./configure) runs on Mac OS X and Ubuntu Hardy.
+
+ defines = [
+ 'HAVE_DLFCN_H',
+ 'HAVE_FNMATCH_H',
+ 'HAVE_GETOPT_H',
+ 'HAVE_GETTIMEOFDAY',
+ 'HAVE_INTTYPES_H',
+ 'HAVE_MEMORY_H',
+ 'HAVE_MPROTECT',
+ 'HAVE_PTHREAD',
+ 'HAVE_STDINT_H',
+ 'HAVE_STDLIB_H',
+ 'HAVE_STRINGS_H',
+ 'HAVE_STRING_H',
+ 'HAVE_STRTOLL',
+ 'HAVE_STRTOQ',
+ 'HAVE_SYS_MMAN_H',
+ 'HAVE_SYS_STAT_H',
+ 'HAVE_SYS_TIME_H',
+ 'HAVE_SYS_TYPES_H',
+ 'HAVE_UINT16_T',
+ 'HAVE_UNISTD_H',
+ 'HAVE_U_INT16_T',
+ 'HAVE___ATTRIBUTE__',
+ ('PACKAGE', '"open-vcdiff"'),
+ ('PACKAGE_BUGREPORT', '"opensource@google.com"'),
+ ('PACKAGE_NAME', '"open-vcdiff"'),
+ ('PACKAGE_STRING', '"open-vcdiff 0.1"'),
+ ('PACKAGE_TARNAME', '"open-vcdiff"'),
+ ('PACKAGE_VERSION', '"0.1"'),
+ ('VERSION', '"0.1"'),
+ 'STDC_HEADERS',
+ ]
+
+ if env.Bit('linux'):
+ defines.extend([
+ 'HAVE_MALLOC_H',
+ 'HAVE_MEMALIGN',
+ 'HAVE_POSIX_MEMALIGN',
+ ])
+
+ if env.Bit('mac'):
+ defines.extend([
+ 'HAVE_WORKING_KQUEUE',
+ ])
+
+ def AutoConfig(target, source, env):
+ """
+ Action to generate a config.h file from an Autotools config.h.in file,
+ given the list of definitions in the DEFINES construction variable.
+
+ Each entry in DEFINES is either a string, in which case it
+ will be enabled with a value of 1, or a tuple, in which case
+ the first element is the #define name and the second its value.
+
+ Any leftover #undef lines get commented out.
+ """
+ contents = open(str(source[0]), 'r').read()
+
+ for d in env['DEFINES']:
+ if isinstance(d, tuple):
+ define, value = d
+ else:
+ define = d
+ value = 1
+ undef = '^#undef %s$' % re.escape(define)
+ definition = '#define %s %s' % (define, value)
+ contents = re.sub(undef, definition, contents)
+
+ undef_re = re.compile(r'^(#undef .*)$', re.M)
+ contents = undef_re.sub(r'/* \1 */', contents)
+
+ header = '/* src/config.h. Generated by SCons. */\n'
+ open(str(target[0]), 'w').write(header + contents)
+
+ # varlist['DEFINES'] below makes the target config.h file depend
+ # on the list of definitions in the passed-in $DEFINES variable.
+ env.Command('$OPEN_VCDIFF_DIR/src/config.h',
+ '$OPEN_VCDIFF_DIR/src/config.h.in',
+ Action(AutoConfig, varlist=['DEFINES']),
+ DEFINES=defines)