ninja windows: output set_environment.bat to export desired environment

Along with https://chromiumcodereview.appspot.com/9967020, fixes requirement
to have run vcvarsall/vsvars32 in shell where ninja is run.

Also minor refactor of toplevel build dir to simplify some repeated os.path.joins.

R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1324 78cadc50-ecff-11dd-a971-7dbc132099af
ninja and make mac: Absolutize sectcreate paths.

Make the linker flag matching a more general, add tests,
and support unexported_symbols_list and reexported_symbols_list
for symmetry with the existing exported_symbols_list support.
Review URL: https://chromiumcodereview.appspot.com/10052022

git-svn-id: http://gyp.googlecode.com/svn/trunk@1325 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: fix wrappers not outputting with newlines

splitlines strips newlines, and I wasn't readding them when writing to stdout.

R=thakis@chromium.org
BUG=chromium:122674

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1326 78cadc50-ecff-11dd-a971-7dbc132099af
Support for freebsd 9

Patch from Myles C. Maxfield <mmaxfield@google.com>!

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



git-svn-id: http://gyp.googlecode.com/svn/trunk@1327 78cadc50-ecff-11dd-a971-7dbc132099af
mac make/ninja: Add limited support for OTHER_CPLUSPLUSFLAGS.

Allow expanding $OTHER_CFLAGS and $inherited in OTHER_CPLUSPLUSFLAGS,
since these are probably common values.

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



git-svn-id: http://gyp.googlecode.com/svn/trunk@1328 78cadc50-ecff-11dd-a971-7dbc132099af
mac make&ninja: Temporarily accept strings instead of lists for OTHER_CPLUSPLUSFLAGS.
Review URL: https://chromiumcodereview.appspot.com/10106003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1329 78cadc50-ecff-11dd-a971-7dbc132099af
Let the code from the last revision actually have an effect.

git-svn-id: http://gyp.googlecode.com/svn/trunk@1330 78cadc50-ecff-11dd-a971-7dbc132099af
Adding support for "latelate" variables that get expanded after
sources + sources! + sources/ are appleid.

This allows greater use of gyp-isms in cross compile type situtations.
Ideally this will not be a widely used syntax.

R=mark@chromium.org,bbudge@chromium.org
BUG=http://code.google.com/p/chromium/issues/detail?id=120214
TEST=latelate,external-cross-compile
Review URL: https://chromiumcodereview.appspot.com/10069024

git-svn-id: http://gyp.googlecode.com/svn/trunk@1331 78cadc50-ecff-11dd-a971-7dbc132099af
Allow GYP to detect VC++ compiler when only SDK is installed.

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


git-svn-id: http://gyp.googlecode.com/svn/trunk@1332 78cadc50-ecff-11dd-a971-7dbc132099af
Default to VS installation and fallback to SDK setenv, rather than the opposite.

That is, only use Express/SDK if our registry detection determined that the Express version is desired, rather than simply if the WindowsSdkDir environment variable exists.

See https://chromiumcodereview.appspot.com/10127012/

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1334 78cadc50-ecff-11dd-a971-7dbc132099af
Make missing files a fatal error for the MSVS generator 

Missing input files cause MSVS 2010 to constantly think the 
target is dirty and mark it for recompilation. Change the 
current warning text to become a fatal exception, so that 
GYP is seen as failing if this happens. 

This is disabled by default and keyed on a generator flag 
called 'msvs_error_on_missing_sources' 

This is not needed on other build systems as missing object 
files error out and header dependencies are calculated based 
on GCC/Clang dependency info, rather than the GYP files, and 
thus do not suffer silent slowdown. 

BUG=chromium:119511
TEST=test/msvs/missing_sources/gyptest-missing.py 
Patch from Ryan Sleevi <rsleevi@chromium.org>!

Review URL: http://codereview.chromium.org/10205007/



git-svn-id: http://gyp.googlecode.com/svn/trunk@1335 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: support Use Library Dependency Inputs linking

aka actually make /INCREMENTAL flag do something useful.

When ULDI is on, the objs making up of static_librarys are linked against,
rather than the .lib itself. This allows the linker to link those files
incrementally.

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1336 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: fix not-touched import library causing spurious rebuilds

Import lib doesn't update timestamp if exports haven't changed when incremental linking is on, which causes ninja to think that the lib is still dirty. Use restat to avoid this.

Some background discussion here: https://groups.google.com/forum/#!msg/ninja-build/L5jyWJFOAuM/UOtln9axueEJ

Also, fix up_to_date in gyp test lib for MSVS case (was previously not handling multiple projects, or projects with dependencies).

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1337 78cadc50-ecff-11dd-a971-7dbc132099af
Avoid a compiler warning in test/hard_dependency

Without this, if -Wimplicit-function-declaration is enabled, the test fails
with a warning from the build step.

warning: implicit declaration of function 'funcB'
Review URL: http://codereview.chromium.org/10234010/

Patch from Steve Block <steveblock@chromium.org>!



git-svn-id: http://gyp.googlecode.com/svn/trunk@1338 78cadc50-ecff-11dd-a971-7dbc132099af
Fix flakiness in test/intermediate_dir

This test is flaky because it expects the shared_intermediate action to be
re-run when target2 is built, despite the fact that it has no inputs and its
output should still exist from when target1 was built.

This change adds an input to the shared_intermediate action and touches it
between building target1 and target2. This ensures that the shared_intermediate
action is re-run.

See http://codereview.chromium.org/8664001
Review URL: http://codereview.chromium.org/10233012/

Patch from Steve Block <steveblock@chromium.org>!



git-svn-id: http://gyp.googlecode.com/svn/trunk@1339 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: fix for not closing quotes on command line properly

R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1340 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: don't print blank lines in RC wrapper

R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1341 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: don't use copy /y nul $out for STAMP

I really can't figure out why, but using copy /y nul $out for stamp doesn't cause the changes to be visible to the Change Journal (i.e. no update to timestamp is logged). It appears it's doing some sort of hardlink to the nul device which isn't tracked by the file system (but that's mostly a guess). Since this seems to be the only thing it doesn't see, just avoid the problem by using a gyp-win-tool command to STAMP instead.

Basic stamp functionality covered by existing tests. There's no obvious way to confirm that the new version works as desired though (i.e. "normally").

R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1342 78cadc50-ecff-11dd-a971-7dbc132099af
ninja windows: fix expansion of some VS macros

Fix expansion of $(OutDir). Also, make sure there's no redundant path contents (.., etc.) when expanding VS macros + gyp variables in the paths. Ninja can be more efficient if it doesn't need to re-canonicalize paths.

(removed the 'normalization' of converting to lower case that was previously in this CL)

R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1343 78cadc50-ecff-11dd-a971-7dbc132099af
Exclude problematic formats from tests, rather than including all other platforms

This is more robust to changes in the set of available platforms.
Review URL: http://codereview.chromium.org/10198031/

Patch from Steve Block <steveblock@chromium.org>!



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