joyent/node — pull request #2571 by shigeki (2012-01-18 09:47:11+00:00)
Title: build: Fix default_configuration of GYP to be consistent with BUILDTYPE

Fix default_configuration of GYP to be consistent with BUILDTYPE by moving it into config.gypi.
I also change tools/gyp_addon to include config.gypi to lookup default_configuration in building addon modules.

The test results of building addon module in both Debug and Release show below.

as BUILDTYPE is Release

```
unix:~/tmp/github/node> ./configure
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': ['-lz']},
'variables': { 'host_arch': 'ia32',
'node_install_npm': 'true',
'node_install_waf': 'true',
'node_prefix': '',
'node_shared_cares': 'false',
'node_shared_v8': 'false',
'node_use_dtrace': 'false',
'node_use_isolates': 'true',
'node_use_openssl': 'true',
'node_use_system_openssl': 'false',
'target_arch': 'ia32',
'v8_use_snapshot': 'true'}}
creating ./config.gypi
creating ./config.mk
unix:~/tmp/github/node/test/addons/hello-world> ../../../tools/gyp_addon; make
CXX(target) out/Release/obj.target/binding/binding.o
SOLINK_MODULE(target) out/Release/obj.target/binding.node
SOLINK_MODULE(target) out/Release/obj.target/binding.node: Finished
COPY out/Release/binding.node
```

as BUILDTYPE is Debug

```
unix:~/tmp/github/node> ./configure --debug
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Debug',
'defines': [],
'include_dirs': [],
'libraries': ['-lz']},
'variables': { 'host_arch': 'ia32',
'node_install_npm': 'true',
'node_install_waf': 'true',
'node_prefix': '',
'node_shared_cares': 'false',
'node_shared_v8': 'false',
'node_use_dtrace': 'false',
'node_use_isolates': 'true',
'node_use_openssl': 'true',
'node_use_system_openssl': 'false',
'target_arch': 'ia32',
'v8_use_snapshot': 'true'}}
creating ./config.gypi
creating ./config.mk
unix:~/tmp/github/node/test/addons/hello-world> ../../../tools/gyp_addon ; make
CXX(target) out/Debug/obj.target/binding/binding.o
SOLINK_MODULE(target) out/Debug/obj.target/binding.node
SOLINK_MODULE(target) out/Debug/obj.target/binding.node: Finished
COPY out/Debug/binding.node
```