Revise unittest for 'LD' in 'make_global_settings'

This is a follow up CL for r1937. This is just a revise of a unittest and does not changes existing functionality.

It turned out that we need to specify GYP_CROSSCOMPILE=1 to test 'LD'/'LD.host' properly. Expected results, which are expected to be describing the current behavior, are updated accordingly.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/338523003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1939 78cadc50-ecff-11dd-a971-7dbc132099af
Revise unittest for 'AR' in 'make_global_settings'

This is a follow up CL for r1931 and r1935. This is just a revise of a unittest and does not changes existing functionality.

It turned out that we need to specify GYP_CROSSCOMPILE=1 to test 'AR'/'AR.host'
properly. Expected results, which correspond to the current behavior atually, are updated accordingly.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/336953002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1940 78cadc50-ecff-11dd-a971-7dbc132099af
Teach Ninja generator about 'LD'/'LD.host' specified in 'make_global_settings_ld'.

With this CL, Ninja generator starts recognizing 'LD'/'LD.host' specified in 'make_global_settings', like Make generator.  This makes it easier for you to share the code among host/NaCl/NDK/Emscripten build targets.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/335443007

git-svn-id: http://gyp.googlecode.com/svn/trunk@1941 78cadc50-ecff-11dd-a971-7dbc132099af
Teach Ninja generator about 'AR.host' specified in 'make_global_settings'.

With this CL, Ninja generator starts recognizing 'AR.host' specified in 'make_global_settings', like Make generator.

BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/333353002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1942 78cadc50-ecff-11dd-a971-7dbc132099af
[gyp][Android] Implement TestGypAndroid.run_built_executable.

Note that this includes buildbot steps to start and stop an Android emulator
for testing.

BUG=gyp:324
R=bradnelson@google.com, torne@chromium.org

Review URL: https://codereview.chromium.org/321953005

git-svn-id: http://gyp.googlecode.com/svn/trunk@1943 78cadc50-ecff-11dd-a971-7dbc132099af
ninja: Pass .so files outside of --start-group/--end-group.

When doing 32bit release component builds of chromium, nacl_helper fails to
link like so:

g++ [...] -Wl,--as-needed -o nacl_helper -Wl,--start-group [...] obj/components/libnacl_linux.a [...] lib/libppapi_shared.so -Wl,--end-group [...]

  /usr/bin/ld: .../nacl_linux.plugin_main.o: undefined reference to symbol '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions'
  /usr/bin/ld: note: '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions' is defined in DSO lib/libppapi_shared.so so try adding it to the linker command line

Note that libppapi_shared.so is on the link line.  The error goes away if
--as-needed isn't passed, if I use gold, or if the .so file is moved after
--end-group.  http://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed
suggests that --as-needed has additional constraints on library ordering, and
I'm guessing that this error depends on how the implementations of
--as-needed and --start-group/--end-group in ld.bfd interact.

Moving $solibs out of --start-group/--end-group seems to work, so just do that.
No test because we have no 32bit linux gyp bot.

BUG=none (but found while working on 368384 / 385472)
TEST=Build nacl_test on a 32bit release bot using the components build. links correctly
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/341613003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1944 78cadc50-ecff-11dd-a971-7dbc132099af
msvs: ensure that failing actions make the build fail with multiple actions

The old way of joining multiple commands would take care of failing correctly
when there are multiple actions associated with a single file. However, for
multiple actions associated with different files (but within the same target),
Visual Studio will still create just one .bat file for them all, so we must
make sure that each command errors out correctly when it fails.

Strictly speaking, the %errorlevel% check is unnecessary for the last command
in a target (because the .bat file created by VS contains it already); but it
doesn't hurt either, and makes the logic much simpler.

Patch from Stefan Haller <stk.haller@googlemail.com>.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/335273006

git-svn-id: http://gyp.googlecode.com/svn/trunk@1945 78cadc50-ecff-11dd-a971-7dbc132099af
Makes analyzer strip off a leading path separator

When running in chrome paths are absolute.

Also makes chrome build work with analyzer on windows. The specific define I
ran into was MSVS_OS_BITS, but I'm sure there are more.

BUG=chromium:383609
R=mark@chromium.org

Patch by Scott Violet <sky@chromium.org>
Review URL: https://codereview.chromium.org/347193005/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1946 78cadc50-ecff-11dd-a971-7dbc132099af
Introduce '--no-duplicate-basename-check' option to disable the check of duplicate basenames

With this CL, the check of duplicate basenames in the same source list can be disabled with '--no-duplicate-basename-check' option.

Now GYP generators can handle duplicate basenames except for VCProj generator for Visual C++ 2008 and Makefile generator on Mac. Given that these two generators are no longer actively used, and supposed to be deprecated in future, providing an option to disable this validation should be helpful for some GYP users.

Note that these two generators continue to treat duplicate basenames continue as an error regardless of '--no-duplicate-basename-check'.

BUG=gyp:264, gyp:384
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/344573002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1947 78cadc50-ecff-11dd-a971-7dbc132099af
Xcode: Add xcdatamodeld = wrapper.xcdatamodeld in extension_map 

.xcdatamodeld documents are used for Model File Format. 
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmModelFormat.html 

Note that .xcdatamodel has already been supported since gyp r1529. 

BUG=303

Patch from Roberto Cosenza <robcos@google.com>
via Yohei Yukawa <yukawa@chromium.org>

Review URL: https://codereview.chromium.org/351223002/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1948 78cadc50-ecff-11dd-a971-7dbc132099af
Fixes two bugs in analyzer

Wasn't delaing with relative paths outside the repo. NACL does this
for things like /usr/include/...
When combining relative paths I was missing adding a '/'. This result
in paths like baseobserver_list.h instead of base/observer_list.h.

BUG=383609
TEST=covered by unit tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/383893003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1949 78cadc50-ecff-11dd-a971-7dbc132099af
Fixes bug in path handling of analyzer

Was using os.getcwd when it needs to use options.toplevel_dir

R=mark@chromium.org
BUG=383609
TEST=none

Review URL: https://codereview.chromium.org/395483002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1951 78cadc50-ecff-11dd-a971-7dbc132099af
Add test files for https://codereview.chromium.org/406523005/

Maybe the try failures are due to the try server not adding the new files
correctly, since the test passes for me locally. Add the test files in a
separate commit (not used by anything yet) to test this theory.


git-svn-id: http://gyp.googlecode.com/svn/trunk@1952 78cadc50-ecff-11dd-a971-7dbc132099af
ninja/win: Put common msvs_system_include_dirs into %INCLUDE% 

Paths in INCLUDE are considered system headers by clang-cl and it will suppress 
warnings from system headers. 

BUG=chromium:395405
Review URL: https://codereview.chromium.org/406523005/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1953 78cadc50-ecff-11dd-a971-7dbc132099af
This CL adds support for extension in GYP.

This CL adds the extension target type and adds the link flags to
compile .appex extensions.

BUG=gyp:435
R=justincohen@chromium.org, mark@chromium.org, pkl@chromium.org, sdefresne@chromium.org

Review URL: https://codereview.chromium.org/376603002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1954 78cadc50-ecff-11dd-a971-7dbc132099af
ninja: Add support for 'ninja_use_console' in actions/rules

Setting this to 1 will make ninja use 'pool = console' for the action/rule.

BUG=
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/412283002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1955 78cadc50-ecff-11dd-a971-7dbc132099af
Changes analyzer to search for targets

Here's a list of the changes:
. I'm changing input file to be a JSON file. This allows for passing
  in more information, such as the set of targets to search for.
. Changing output format to be JSON as well. This allows for more
  structure in outputting other random data. I'm a bit iffy on whether
  this is good, but it's requested by the recipes side of things which
  uses analyzer.
. You can now specify a set of targets to search for in addition to
  files. This is intended for things like 'unittests' so that only the
  set of targets that are effected by the change get run.

To enable the new functionality you have to pass in a new switch. Once
I integrate these changes into the rest of the stack. I'll remove the
old flow.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/420383002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1956 78cadc50-ecff-11dd-a971-7dbc132099af
Enable custom suffixes for Mac bundles.

Patch by Johannes Sartisohn <jsartisohn@google.com>

Review URL: https://codereview.chromium.org/401633002/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1957 78cadc50-ecff-11dd-a971-7dbc132099af
Avoid infinite recursion with identity variables.

Some generators like gypd and gypsh define the generator_default_variables
as an identity expansion. For example, the variable 'INTERMEDIATE_DIR'
would expand to '<(INTERMEDIATE_DIR)' which lends to an infinite recursion
if a .gyp file uses any of those variables.

This patch detects trivial infinite recursive variable expansions like
this one and leaves them that way.

Patch by Alejandro Deymonnaz <deymo@chromium.org>

BUG=141
TEST=`gyp --debug=variables --format=gypd test.gyp` shows avoiding
infinite recursion message when test.gyp has an INTERMEDIATE_DIR
variable expansion.

Review URL: https://codereview.chromium.org/417113009/


git-svn-id: http://gyp.googlecode.com/svn/trunk@1958 78cadc50-ecff-11dd-a971-7dbc132099af
Updates analyzer to output to a file

File is specified by way of analyzer_output_path. I'm also changing
from a hard error if a target can't be found to a warning.

I'm also including a new set of tests. I forgot to svn add this last
time around.

BUG=109173
TEST=covered by tests
R=mark@chromium.org

Review URL: https://codereview.chromium.org/429243003

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