Add working Node artifact builder for all platforms
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
index a913585..055c088 100644
--- a/templates/binding.gyp.template
+++ b/templates/binding.gyp.template
@@ -46,7 +46,10 @@
       ],
       'conditions': [
         ['OS == "win"', {
-          "include_dirs": [ "third_party/boringssl/include" ],
+          "include_dirs": [
+            "third_party/boringssl/include",
+            "third_party/zlib"
+          ],
           "defines": [
             '_WIN32_WINNT=0x0600',
             'WIN32_LEAN_AND_MEAN',
@@ -65,19 +68,20 @@
             "ws2_32"
           ]
         }, { # OS != "win"
+          'variables': {
+            'config': '<!(echo $CONFIG)',
+            # The output of "node --version" is "v[version]". We use cut to
+            # remove the first character.
+            'target%': '<!(node --version | cut -c2-)'
+          },
             # Empirically, Node only exports ALPN symbols if its major version is >0.
             # io.js always reports versions >0 and always exports ALPN symbols.
             # Therefore, Node's major version will be truthy if and only if it
-            # supports ALPN. The output of "node -v" is v[major].[minor].[patch],
-            # like "v4.1.1" in a recent version. We use cut to split by period and
-            # take the first field (resulting in "v[major]"), then use cut again
-            # to take all but the first character, removing the "v".
+            # supports ALPN. The target is "[major].[minor].[patch]". We split by
+            # periods and take the first field to get the major version.
           'defines': [
-            'TSI_OPENSSL_ALPN_SUPPORT=<!(node --version | cut -d. -f1 | cut -c2-)'
+            'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)'
           ],
-          'variables': {
-            'config': '<!(echo $CONFIG)'
-          },
           'include_dirs': [
             '<(node_root_dir)/deps/openssl/openssl/include',
             '<(node_root_dir)/deps/zlib'
@@ -218,7 +222,8 @@
             'xcode_settings': {
               'MACOSX_DEPLOYMENT_TARGET': '10.9',
               'OTHER_CFLAGS': [
-                '-stdlib=libc++'
+                '-stdlib=libc++',
+                '-std=c++11'
               ]
             }
           }],