Add android makefile generator backend to gyp.

Add a new backend to gyp, "android", which creates Android.mk style 
makefiles. This can be used to build gyp projects as part of the full 
Android system build, to incorporate them into the ROM image. 

Android's existing compilation rules are used where possible, and gyp 
targets are mapped 1:1 onto Android modules (via a name mangling scheme 
to ensure uniqueness). Dependencies are preserved to the best of the 
Android build system's ability (some order-only deps have become full 
deps). 

gyp tests have been updated to work with the Android backend and all 
either pass or are skipped for being inappropriate; however, there is 
currently no support in the test harness for actually running any 
generated executables (as this would require an Android device or 
emulator), and thus the test framework just checks that the executable 
exists and if so, claims success. 

BUG=gyp:275

git-svn-id: http://gyp.googlecode.com/svn/trunk@1428 78cadc50-ecff-11dd-a971-7dbc132099af
Fix Make and Android backend to improve printing of lists

- Avoid trailing whitespace when list is empty
- Use new line for every entry, including first entry

No functional change to generated output.
Review URL: https://chromiumcodereview.appspot.com/10700106

git-svn-id: http://gyp.googlecode.com/svn/trunk@1429 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: make solib avoid-relinking test work

Fix symbol export and exe extension to work on Windows. Enable incremental
linking which makes the import lib timestamp be maintained when exports are
unchanged.

See also http://codereview.chromium.org/10704054

R=thakis@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10786019

git-svn-id: http://gyp.googlecode.com/svn/trunk@1430 78cadc50-ecff-11dd-a971-7dbc132099af
Fix how quotes are rendered in ninja and msvs under cygwin.

Specifically, action strings would render like:
   'action': ['python', '-c', 'print \'Hello world!\'']  ->
     bash -c "'python' '-c' 'print \'Hello world!\''" ->
       python -c 'print 'Hello world!'' ->
         print Hello world!

   'action': ['python', '-c', 'print "Hello world"] ->
     bash -c "'python' '-c' 'print "Hello world!"'" ->
       python -c 'print Hello world!' ->
         print Hello world!

Now they'll render as:
   'action': ['python', '-c', 'print \'Hello world!\'']  ->
     bash -c "'python' '-c' 'print '\''Hello world!'\'''" ->
       python -c 'print '\''Hello world!'\''' ->
         print 'Hello world'!

   'action': ['python', '-c', 'print "Hello world"] ->
     bash -c "'python' '-c' 'print \"Hello world!\"'" ->
       python -c 'print \"Hello world!\"' ->
         print "Hello world!"

This will preserve the intent of the original command.

Msvs was failing on the double-quotes test case because contained
quotes were not properly escaped when constructing the
cmd-runs-bash-runs-command line.

There's probably a higher-level bug here which is that quoting needs
to be done in a deterministic (and common) way across all the
generators.

BUG=132157

Review URL: https://chromiumcodereview.appspot.com/10782040

git-svn-id: http://gyp.googlecode.com/svn/trunk@1431 78cadc50-ecff-11dd-a971-7dbc132099af
Modify RegenerateAppendFlag() to skip duplicate values in environment values

This is useful in cases where environment variables are updated by scripts and
so may contain duplicate entries. This change prevents those duplicates from
appearing in the makefile regeneration rule.
Review URL: https://chromiumcodereview.appspot.com/10709007

git-svn-id: http://gyp.googlecode.com/svn/trunk@1432 78cadc50-ecff-11dd-a971-7dbc132099af
When linking an executable, add the -F options.

When linking an executable, every directory in mac_framework_dirs must be
added as a -F option.

Patch from Benjamin Lerman <qsr@chromium.org>!
Review URL: https://chromiumcodereview.appspot.com/10792018/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1433 78cadc50-ecff-11dd-a971-7dbc132099af
Add support for CONFIGURATION_NAME to ninja.

Patch from Benjamin Lerman <qsr@chromium.org>!
Review URL: https://chromiumcodereview.appspot.com/10778037/

git-svn-id: http://gyp.googlecode.com/svn/trunk@1434 78cadc50-ecff-11dd-a971-7dbc132099af
Fixing failing gyp-test-multiple-values.

Hermetic cygwin isn't part of the gyp checkout.
Bare actions can't be tested, without using msvs_cygwin_shell: 0.

Additionally msvs doesn't detect changes in build rules that
aren't reflected in timestamps on the filesytem.
Adding rebuild=True to make the test pass.

BUG=None
TEST=None
R=steveblock@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10790130

git-svn-id: http://gyp.googlecode.com/svn/trunk@1435 78cadc50-ecff-11dd-a971-7dbc132099af
Make sure OutputDirectory, IntermediateDirectory, and TargetPath have their slashes
oriented correctly.

I'm not sure if this is the 'best' way to accomplish this. A better way might be to
rationalize all paths to unix-style on input, and then rationalize them back to whatever
is most appropriate for the selected generator (I believe only msvs needs them in windows-
form... ninja can handle posix paths on non-posix systems, I think). However, that would
have been a much more significant change.

R=cmp,nsylvain,scottmg,sgk,thakis
TEST=test/builddir
Review URL: https://chromiumcodereview.appspot.com/10805078

git-svn-id: http://gyp.googlecode.com/svn/trunk@1436 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: support basic generation of manifests at link time

Basic support of manifest files being generated. There's two steps to this,
the first is to have the linker generate an intermediate manifest based on
what runtime library is in use (this is a temporary file). As a post process,
the manifest tool combines the intermediate manifest file with any
user-provided manifests (the AdditionalManifestFiles setting) and generates
the final manifest that sits next to the binary.

We currently do not support embedding the manifest as it's not currently
needed for dev builds, and is complicated by the fact that the final binary
must be linked twice to support embedding the mainfest.

R=thakis@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10827010

git-svn-id: http://gyp.googlecode.com/svn/trunk@1437 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: check correct condition for manifest warning

Was warning when value set to 'false'. Herp derp. :(

TBR=thakis@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10826020

git-svn-id: http://gyp.googlecode.com/svn/trunk@1438 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: don't use /allowisolation with a .def file

Apparently (per http://build.chromium.org/f/client/gyp/) using a .def file
makes the linker think it's linking a DLL when it's actually an exe, which
means it errors out due to the just-added /ALLOWISOLATION flag for manifests.
So, if we have a def file, don't add that flag. This appears to match what the
IDE does implicitly.

TBR=thakis@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10827024

git-svn-id: http://gyp.googlecode.com/svn/trunk@1439 78cadc50-ecff-11dd-a971-7dbc132099af
ninja/mac: allow path-based specification of SDKROOT

This matches the Xcode behavior of SDKROOT treatment. For SDKROOT values that
don’t begin with macosx, SDKROOT is treated as a path. When a relative path,
it is taken as relative to the .xcodeproj's containing directory, although
that isn't duplicated here because it's not likely to be of use. When SDKROOT
is an absolute path, it points to the root directory of the SDK itself, such
as /Developer/SDKs/MacOSX10.6.sdk or
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk .
Review URL: https://chromiumcodereview.appspot.com/10821053

git-svn-id: http://gyp.googlecode.com/svn/trunk@1440 78cadc50-ecff-11dd-a971-7dbc132099af
Fix bug: non-cygwin actions incorrectly run options through _FixPath.

This adds an additional heuristic to the existing one. Now if an option begins
with either a '/' OR a '-', it assumes it's not a strict path.

Added a TODO which notes that the existing (and new) behavior will miss options
such as '--opt=a/posix/path', and '/opt:a/posix/path'.
Review URL: https://chromiumcodereview.appspot.com/10829049

git-svn-id: http://gyp.googlecode.com/svn/trunk@1441 78cadc50-ecff-11dd-a971-7dbc132099af
Allow <(CONFIGURATION_NAME) to be used in path for ninja.

The handling of $! variable was supposing that the path was starting with the
variable, and was incorrect for CONFIGURATION_NAME. Updating GypPathToNinja to
handle the case where the variable is not a prefix of the path.

Review URL: http://codereview.chromium.org/10825013/
Patch from Benjamin Lerman <qsr@chromium.org>

git-svn-id: http://gyp.googlecode.com/svn/trunk@1442 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: don't spam reg.exe calls if we can't find DirectX installation

R=thakis@chromium.org
BUG=gyp:289

Review URL: https://chromiumcodereview.appspot.com/10837010

git-svn-id: http://gyp.googlecode.com/svn/trunk@1443 78cadc50-ecff-11dd-a971-7dbc132099af
make unitests less fragile in the face of debug output changes.  This is achieved by ignoring line number differences when comparing gyp output.

Don't report backtrace of skipped tests by default.

Use dict.pop() to retrieve and remove elements from dicts without a try/catch block.

BUG=

Review URL: https://chromiumcodereview.appspot.com/10829079

git-svn-id: http://gyp.googlecode.com/svn/trunk@1444 78cadc50-ecff-11dd-a971-7dbc132099af
 Fixing issues with path.

 For XCode: Fixing problem when 2 sources have the same normalize path, but not
            the same exact path.
 For Make: Fixing problem when a source path contain a variable.
Review URL: https://chromiumcodereview.appspot.com/10833047

git-svn-id: http://gyp.googlecode.com/svn/trunk@1445 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: unfork back to 'depfile' name rather than 'deplist'

Windows ninja binary in depot_tools currently supports both as synonyms. One
suggestion Evan had for upstreaming was to use 'depfile' everywhere and make
depdb usage a global switch that interpreted that name differently.

This switches gyp to generate 'depfile' entries rather than 'deplist' entries.

R=thakis@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10824124

git-svn-id: http://gyp.googlecode.com/svn/trunk@1446 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: Add build.ninja variable to turn on dep_database

Part of upstreaming, adding top-level ninja flag indicating that 'depfile'
entry is a key for the dep_database.

R=thakis@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10834116

git-svn-id: http://gyp.googlecode.com/svn/trunk@1447 78cadc50-ecff-11dd-a971-7dbc132099af