1{ 2 'variables': { 3 'gas_version%': '0.0', 4 'llvm_version%': '0.0', 5 'nasm_version%': '0.0', 6 'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)', 7 'conditions': [ 8 ['OS == "win"', { 9 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', 10 }], 11 ['GENERATOR == "ninja"', { 12 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', 13 'modules_dir': '<(PRODUCT_DIR_ABS)/obj/lib/openssl-modules', 14 }, { 15 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', 16 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', 17 }], 18 ['OS=="mac"', { 19 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', 20 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', 21 }], 22 ], 23 }, 24 'targets': [ 25 { 26 'target_name': 'openssl', 27 'type': '<(library)', 28 'includes': ['./openssl_common.gypi'], 29 'defines': [ 30 # Compile out hardware engines. Most are stubs that dynamically load 31 # the real driver but that poses a security liability when an attacker 32 # is able to create a malicious DLL in one of the default search paths. 33 'OPENSSL_NO_HW', 34 'OPENSSL_API_COMPAT=0x10100001L', 35 'STATIC_LEGACY', 36 #'OPENSSL_NO_DEPRECATED', 37 ], 38 'conditions': [ 39 [ 'openssl_no_asm==1', { 40 'includes': ['./openssl_no_asm.gypi'], 41 }, 'target_arch=="arm64" and OS=="win"', { 42 # VC-WIN64-ARM inherits from VC-noCE-common that has no asms. 43 'includes': ['./openssl_no_asm.gypi'], 44 }, 'gas_version and v(gas_version) >= v("2.26") or ' 45 'nasm_version and v(nasm_version) >= v("2.11.8")', { 46 # Require AVX512IFMA supported. See 47 # https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html 48 # Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA. 49 'includes': ['./openssl_asm.gypi'], 50 }, { 51 'includes': ['./openssl_asm_avx2.gypi'], 52 }], 53 ['node_shared_openssl=="false"', { 54 'defines': [ 55 'MODULESDIR="<(modules_dir)"', 56 ] 57 }], 58 ], 59 'direct_dependent_settings': { 60 'include_dirs': [ 'openssl/include', 'openssl/crypto/include'] 61 } 62 }, { 63 # openssl-cli target 64 'target_name': 'openssl-cli', 65 'type': 'executable', 66 'dependencies': ['openssl'], 67 'includes': ['./openssl_common.gypi'], 68 'include_dirs+': ['openssl/apps/include'], 69 'defines': [ 70 'OPENSSL_API_COMPAT=0x10100001L', 71 #'OPENSSL_NO_DEPRECATED', 72 ], 73 'conditions': [ 74 ['openssl_no_asm==1', { 75 'includes': ['./openssl-cl_no_asm.gypi'], 76 }, 'target_arch=="arm64" and OS=="win"', { 77 # VC-WIN64-ARM inherits from VC-noCE-common that has no asms. 78 'includes': ['./openssl-cl_no_asm.gypi'], 79 }, { 80 'includes': ['./openssl-cl_asm.gypi'], 81 }], 82 # Avoid excessive LTO 83 ['enable_lto=="true"', { 84 'ldflags': [ '-fno-lto' ], 85 }], 86 ] 87 }, { 88 # openssl-fipsmodule target 89 'target_name': 'openssl-fipsmodule', 90 'type': 'shared_library', 91 'dependencies': ['openssl-cli'], 92 'includes': ['./openssl_common.gypi'], 93 'include_dirs+': ['openssl/apps/include'], 94 'cflags': [ '-fPIC' ], 95 #'ldflags': [ '-o', 'fips.so' ], 96 #'ldflags': [ '-Wl,--version-script=providers/fips.ld',], 97 'conditions': [ 98 [ 'openssl_no_asm==1', { 99 'includes': ['./openssl-fips_no_asm.gypi'], 100 }, 'target_arch=="arm64" and OS=="win"', { 101 # VC-WIN64-ARM inherits from VC-noCE-common that has no asms. 102 'includes': ['./openssl-fips_no_asm.gypi'], 103 }, 'gas_version and v(gas_version) >= v("2.26") or ' 104 'nasm_version and v(nasm_version) >= v("2.11.8")', { 105 # Require AVX512IFMA supported. See 106 # https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html 107 # Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA. 108 'includes': ['./openssl-fips_asm.gypi'], 109 }, { 110 'includes': ['./openssl-fips_asm_avx2.gypi'], 111 }], 112 ], 113 'direct_dependent_settings': { 114 'include_dirs': [ 'openssl/include', 'openssl/crypto/include'] 115 } 116 }, 117 ] 118} 119