Index: common.gypi --- common.gypi.orig 2016-10-25 15:25:58.000000000 +0200 +++ common.gypi 2016-10-25 20:51:36.807387368 +0200 @@ -270,7 +270,7 @@ 'ldflags': [ '-pthread' ], }], [ 'OS in "linux freebsd openbsd solaris android aix"', { - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], + 'cflags': [ '-Wno-unused-parameter', ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ], 'ldflags': [ '-rdynamic' ], 'target_conditions': [ @@ -358,10 +358,7 @@ '-fno-strict-aliasing', ], 'WARNING_CFLAGS': [ - '-Wall', - '-Wendif-labels', - '-W', - '-Wno-unused-parameter', + '-Wno-unused-parameter' ], }, 'target_conditions': [ Index: deps/uv/uv.gyp --- deps/uv/uv.gyp.orig 2016-10-25 15:26:02.000000000 +0200 +++ deps/uv/uv.gyp 2016-10-25 20:51:36.807387368 +0200 @@ -157,7 +157,7 @@ 'src/unix/udp.c', ], 'link_settings': { - 'libraries': [ '-lm' ], + 'libraries': [ '-lz', '-lm' ], 'conditions': [ ['OS=="solaris"', { 'ldflags': [ '-pthreads' ], Index: deps/v8/gypfiles/toolchain.gypi --- deps/v8/gypfiles/toolchain.gypi.orig 2016-10-25 15:26:03.000000000 +0200 +++ deps/v8/gypfiles/toolchain.gypi 2016-10-25 20:51:36.807387368 +0200 @@ -1101,12 +1101,6 @@ ['OS=="solaris"', { 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. }], - ['OS=="freebsd" or OS=="openbsd"', { - 'cflags': [ '-I/usr/local/include' ], - }], - ['OS=="netbsd"', { - 'cflags': [ '-I/usr/pkg/include' ], - }], ['OS=="aix"', { 'defines': [ # Support for malloc(0) Index: deps/v8/src/base/platform/platform-freebsd.cc --- deps/v8/src/base/platform/platform-freebsd.cc.orig 2016-10-25 15:26:03.000000000 +0200 +++ deps/v8/src/base/platform/platform-freebsd.cc 2016-10-25 20:51:36.807387368 +0200 @@ -25,6 +25,7 @@ #include // index #include +#include #undef MAP_TYPE Index: deps/v8/src/log-utils.cc --- deps/v8/src/log-utils.cc.orig 2016-10-25 15:26:04.000000000 +0200 +++ deps/v8/src/log-utils.cc 2016-10-25 20:51:36.807387368 +0200 @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include +#include + #include "src/log-utils.h" #include "src/assert-scope.h" Index: deps/v8/src/log-utils.h --- deps/v8/src/log-utils.h.orig 2016-10-25 15:26:04.000000000 +0200 +++ deps/v8/src/log-utils.h 2016-10-25 20:51:36.807387368 +0200 @@ -9,6 +9,7 @@ #include +#include #include "src/allocation.h" #include "src/base/compiler-specific.h" #include "src/base/platform/mutex.h" Index: deps/v8/src/v8.gyp --- deps/v8/src/v8.gyp.orig 2016-10-25 15:26:05.000000000 +0200 +++ deps/v8/src/v8.gyp 2016-10-25 20:51:36.807387368 +0200 @@ -1907,7 +1907,7 @@ ['OS=="freebsd"', { 'link_settings': { 'libraries': [ - '-L/usr/local/lib -lexecinfo', + '-lexecinfo', ]}, 'sources': [ 'base/debug/stack_trace_posix.cc', @@ -1919,7 +1919,7 @@ ['OS=="openbsd"', { 'link_settings': { 'libraries': [ - '-L/usr/local/lib -lexecinfo', + '-lexecinfo', ]}, 'sources': [ 'base/platform/platform-openbsd.cc', @@ -1930,7 +1930,7 @@ ['OS=="netbsd"', { 'link_settings': { 'libraries': [ - '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo', + '-lexecinfo', ]}, 'sources': [ 'base/debug/stack_trace_posix.cc', Index: lib/dns.js --- lib/dns.js.orig 2016-10-25 15:26:12.000000000 +0200 +++ lib/dns.js 2016-10-25 20:51:36.817891845 +0200 @@ -161,6 +161,10 @@ req.hostname = hostname; req.oncomplete = all ? onlookupall : onlookup; + /* FreeBSD getaddrinfo(3) knows AI_V4MAPPED, but dislikes it */ + if (process.platform === "freebsd") + hints &= ~(exports.V4MAPPED); + var err = cares.getaddrinfo(req, hostname, family, hints); if (err) { callback(errnoException(err, 'getaddrinfo', hostname)); Index: lib/module.js --- lib/module.js.orig 2016-10-25 15:26:12.000000000 +0200 +++ lib/module.js 2016-10-25 20:51:36.817891845 +0200 @@ -619,7 +619,10 @@ homeDir = process.env.HOME; } - var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')]; + var paths = [ + path.resolve(process.execPath, '..', '..', '..', 'lib', 'node', 'usr'), + path.resolve(process.execPath, '..', '..', '..', 'lib', 'node', 'pkg') + ]; if (homeDir) { paths.unshift(path.resolve(homeDir, '.node_libraries')); Index: src/inspector_agent.cc --- src/inspector_agent.cc.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/inspector_agent.cc 2016-10-25 20:51:36.817891845 +0200 @@ -34,7 +34,7 @@ const char TAG_CONNECT[] = "#connect"; const char TAG_DISCONNECT[] = "#disconnect"; -static const uint8_t PROTOCOL_JSON[] = { +static uint8_t PROTOCOL_JSON[] = { #include "v8_inspector_protocol_json.h" // NOLINT(build/include_order) }; Index: src/node_constants.cc --- src/node_constants.cc.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/node_constants.cc 2016-10-25 20:51:36.817891845 +0200 @@ -16,10 +16,10 @@ #include #if HAVE_OPENSSL -# include -# include +# include "openssl/ec.h" +# include "openssl/ssl.h" # ifndef OPENSSL_NO_ENGINE -# include +# include "openssl/engine.h" # endif // !OPENSSL_NO_ENGINE #endif Index: src/node_crypto.cc --- src/node_crypto.cc.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/node_crypto.cc 2016-10-25 20:51:36.817891845 +0200 @@ -24,6 +24,8 @@ #include #include +#include + #define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \ do { \ if (!Buffer::HasInstance(val) && !val->IsString()) { \ @@ -5281,7 +5283,7 @@ } raw_keylen = args[3]->NumberValue(); - if (raw_keylen < 0.0 || isnan(raw_keylen) || isinf(raw_keylen) || + if (raw_keylen < 0.0 || std::isnan(raw_keylen) || std::isinf(raw_keylen) || raw_keylen > INT_MAX) { type_error = "Bad key length"; goto err; Index: src/node_crypto.h --- src/node_crypto.h.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/node_crypto.h 2016-10-25 20:51:36.817891845 +0200 @@ -17,20 +17,20 @@ #include "v8.h" -#include -#include -#include +#include "openssl/ssl.h" +#include "openssl/ec.h" +#include "openssl/ecdh.h" #ifndef OPENSSL_NO_ENGINE -# include +# include "openssl/engine.h" #endif // !OPENSSL_NO_ENGINE -#include -#include -#include -#include -#include -#include -#include -#include +#include "openssl/err.h" +#include "openssl/evp.h" +#include "openssl/pem.h" +#include "openssl/x509.h" +#include "openssl/x509v3.h" +#include "openssl/hmac.h" +#include "openssl/rand.h" +#include "openssl/pkcs12.h" #define EVP_F_EVP_DECRYPTFINAL 101 Index: src/node_internals.h --- src/node_internals.h.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/node_internals.h 2016-10-25 20:51:36.817891845 +0200 @@ -113,6 +113,7 @@ # define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) #endif +# undef MUST_USE_RESULT #ifdef __GNUC__ # define MUST_USE_RESULT __attribute__((warn_unused_result)) #else Index: src/tls_wrap.h --- src/tls_wrap.h.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/tls_wrap.h 2016-10-25 20:51:36.817891845 +0200 @@ -12,7 +12,7 @@ #include "util.h" #include "v8.h" -#include +#include "openssl/ssl.h" namespace node { Index: src/util.h --- src/util.h.orig 2016-10-25 15:26:12.000000000 +0200 +++ src/util.h 2016-10-25 20:51:36.817891845 +0200 @@ -63,9 +63,11 @@ template using remove_reference = std::remove_reference; +#undef FIXED_ONE_BYTE_STRING #define FIXED_ONE_BYTE_STRING(isolate, string) \ (node::OneByteString((isolate), (string), sizeof(string) - 1)) +#undef DISALLOW_COPY_AND_ASSIGN #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ void operator=(const TypeName&) = delete; \ void operator=(TypeName&&) = delete; \ @@ -111,12 +113,19 @@ #define CHECK assert #endif +#undef ASSERT #ifdef NDEBUG #define ASSERT(expr) #else #define ASSERT(expr) CHECK(expr) #endif +#undef ASSERT_EQ +#undef ASSERT_GE +#undef ASSERT_GT +#undef ASSERT_LE +#undef ASSERT_LT +#undef ASSERT_NE #define ASSERT_EQ(a, b) ASSERT((a) == (b)) #define ASSERT_GE(a, b) ASSERT((a) >= (b)) #define ASSERT_GT(a, b) ASSERT((a) > (b)) @@ -124,13 +133,20 @@ #define ASSERT_LT(a, b) ASSERT((a) < (b)) #define ASSERT_NE(a, b) ASSERT((a) != (b)) +#undef CHECK_EQ #define CHECK_EQ(a, b) CHECK((a) == (b)) +#undef CHECK_GE #define CHECK_GE(a, b) CHECK((a) >= (b)) +#undef CHECK_GT #define CHECK_GT(a, b) CHECK((a) > (b)) +#undef CHECK_LE #define CHECK_LE(a, b) CHECK((a) <= (b)) +#undef CHECK_LT #define CHECK_LT(a, b) CHECK((a) < (b)) +#undef CHECK_NE #define CHECK_NE(a, b) CHECK((a) != (b)) +#undef UNREACHABLE #define UNREACHABLE() ABORT() #define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ Index: tools/install.py --- tools/install.py.orig 2016-10-25 15:26:21.000000000 +0200 +++ tools/install.py 2016-10-25 20:51:36.817891845 +0200 @@ -134,10 +134,7 @@ action(['deps/v8/tools/gdbinit'], 'share/doc/node/') - if 'freebsd' in sys.platform or 'openbsd' in sys.platform: - action(['doc/node.1'], 'man/man1/') - else: - action(['doc/node.1'], 'share/man/man1/') + action(['doc/node.1'], 'man/man1/') if 'true' == variables.get('node_install_npm'): npm_files(action)