1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
$NetBSD: patch-gyp_common.gypi,v 1.12 2021/02/27 19:13:26 ryoon Exp $
* NetBSD support
--- gyp/common.gypi.orig 2021-02-15 05:04:33.000000000 +0000
+++ gyp/common.gypi
@@ -93,6 +93,14 @@
'-fstack-protector',
'--param=ssp-buffer-size=4',
],
+ # netbsd_cflags will be used for NetBSD.
+ 'netbsd_cflags': [
+ '<@(gcc_cflags)',
+ '-fPIC',
+ '-D_NETBSD_SOURCE',
+ '-fno-exceptions',
+ '<!(echo $CFLAGS)',
+ ],
# mac_cflags will be used in Mac.
# Xcode 4.5 which we are currently using does not support ssp-buffer-size.
# TODO(horo): When we can use Xcode 4.6 which supports ssp-buffer-size,
@@ -128,6 +136,12 @@
'compiler_host': 'clang',
'compiler_host_version_int': 304, # Clang 3.4 or higher
}],
+ ['target_platform=="NetBSD"', {
+ 'compiler_target': 'gcc',
+ 'compiler_target_version_int': 409, # GCC 4.9 or higher
+ 'compiler_host': 'gcc',
+ 'compiler_host_version_int': 409, # GCC 4.9 or higher
+ }],
],
},
'target_defaults': {
@@ -318,6 +332,24 @@
}],
],
}],
+ ['OS=="netbsd"', {
+ 'defines': [
+ 'OS_NETBSD',
+ ],
+ 'cflags': [
+ '<@(netbsd_cflags)',
+ '-fPIC',
+ '-fno-exceptions',
+ ],
+ 'cflags_cc': [
+ # We use deprecated <hash_map> and <hash_set> instead of upcoming
+ # <unordered_map> and <unordered_set>.
+ '-Wno-deprecated',
+ ],
+ 'ldflags': [
+ '-pthread',
+ ],
+ }],
['OS=="mac"', {
'defines': [
'__APPLE__',
@@ -410,7 +442,7 @@
],
},
'conditions': [
- ['target_platform=="Linux"', {
+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
'make_global_settings': [
['AR', '<!(which ar)'],
['CC', '<!(which clang)'],
|