summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl.gyp
blob: f6b157f8d60813c603a04c9d3d7b8172b0269005 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
  'variables': {
    'gas_version%': '0.0',
    'llvm_version%': '0.0',
    'nasm_version%': '0.0',
    'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)',
    'conditions': [
      ['OS == "win"', {
        'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj',
      }],
      ['GENERATOR == "ninja"', {
        'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj',
        'modules_dir': '<(PRODUCT_DIR_ABS)/obj/lib/openssl-modules',
      }, {
        'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target',
        'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules',
      }],
      ['OS=="mac"', {
        'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target',
        'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules',
      }],
    ],
  },
  'targets': [
    {
      'target_name': 'openssl',
      'type': '<(library)',
      'includes': ['./openssl_common.gypi'],
      'defines': [
        # Compile out hardware engines.  Most are stubs that dynamically load
        # the real driver but that poses a security liability when an attacker
        # is able to create a malicious DLL in one of the default search paths.
        'OPENSSL_NO_HW',
        'OPENSSL_API_COMPAT=0x10100001L',
        'STATIC_LEGACY',
        #'OPENSSL_NO_DEPRECATED',
      ],
      'conditions': [
        [ 'openssl_no_asm==1', {
          'includes': ['./openssl_no_asm.gypi'],
        }, 'target_arch=="arm64" and OS=="win"', {
          # VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
          'includes': ['./openssl_no_asm.gypi'],
        }, 'gas_version and v(gas_version) >= v("2.26") or '
           'nasm_version and v(nasm_version) >= v("2.11.8")', {
           # Require AVX512IFMA supported. See
           # https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html
           # Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA.
          'includes': ['./openssl_asm.gypi'],
        }, {
          'includes': ['./openssl_asm_avx2.gypi'],
        }],
        ['node_shared_openssl=="false"', {
          'defines': [
            'MODULESDIR="<(modules_dir)"',
          ]
        }],
      ],
      'direct_dependent_settings': {
        'include_dirs': [ 'openssl/include', 'openssl/crypto/include']
      }
    }, {
      # openssl-cli target
      'target_name': 'openssl-cli',
      'type': 'executable',
      'dependencies': ['openssl'],
      'includes': ['./openssl_common.gypi'],
      'include_dirs+': ['openssl/apps/include'],
      'defines': [
        'OPENSSL_API_COMPAT=0x10100001L',
        #'OPENSSL_NO_DEPRECATED',
      ],
      'conditions': [
        ['openssl_no_asm==1', {
          'includes': ['./openssl-cl_no_asm.gypi'],
        }, 'target_arch=="arm64" and OS=="win"', {
          # VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
          'includes': ['./openssl-cl_no_asm.gypi'],
        }, {
          'includes': ['./openssl-cl_asm.gypi'],
        }],
        # Avoid excessive LTO
        ['enable_lto=="true"', {
          'ldflags': [ '-fno-lto' ],
        }],
     ]
    }, {
      # openssl-fipsmodule target
      'target_name': 'openssl-fipsmodule',
      'type': 'shared_library',
      'dependencies': ['openssl-cli'],
      'includes': ['./openssl_common.gypi'],
      'include_dirs+': ['openssl/apps/include'],
      'cflags': [ '-fPIC' ],
      #'ldflags': [ '-o', 'fips.so' ],
      #'ldflags': [ '-Wl,--version-script=providers/fips.ld',],
      'conditions': [
        [ 'openssl_no_asm==1', {
          'includes': ['./openssl-fips_no_asm.gypi'],
        }, 'target_arch=="arm64" and OS=="win"', {
          # VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
          'includes': ['./openssl-fips_no_asm.gypi'],
        }, 'gas_version and v(gas_version) >= v("2.26") or '
           'nasm_version and v(nasm_version) >= v("2.11.8")', {
           # Require AVX512IFMA supported. See
           # https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html
           # Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA.
          'includes': ['./openssl-fips_asm.gypi'],
        }, {
          'includes': ['./openssl-fips_asm_avx2.gypi'],
        }],
     ],
     'direct_dependent_settings': {
       'include_dirs': [ 'openssl/include', 'openssl/crypto/include']
     }
   },
  ]
}