forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps,build: add OpenSSL building of legacy module
This commit adds a configuration time flag to enable OpenSSL legacy module to be built. For example, the following will build the legacy module: $ ./configure --openssl-legacy-module To enable the default provider one has currently has to update the OpenSSL configuration file, openssl.cnf: [openssl_init] providers = provider_sect [provider_sect] default = default_sect legacy = legacy_sect [default_sect] activate = 1 [legacy_sect] activate = 1 This module can then be used by specifying the environment variable OPENSSL_MODULES like this: $ env OPENSSL_MODULES= \ $PWD/out/Release/obj.target/deps/openssl/lib/openssl-modules \ OPENSSL_CONF=out/Release/obj.target/deps/openssl/openssl.cnf \ ./node -p 'crypto.createHash("md4")' Hash { _options: undefined, [Symbol(kHandle)]: Hash {}, [Symbol(kState)]: { [Symbol(kFinalized)]: false } Refs: nodejs#40455
- Loading branch information
Showing
9 changed files
with
411 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
'variables': { | ||
'openssl_sources': [ | ||
%%- foreach $src (@liblegacy_srcs) { | ||
$OUT .= " 'openssl/$src',\n"; | ||
} -%% | ||
], | ||
'openssl_sources_%%-$arch-%%': [ | ||
%%- foreach $src (@generated_srcs) { | ||
$OUT .= " './config/archs/$arch/$asm/$src',\n"; | ||
} -%% | ||
], | ||
'openssl_defines_%%-$arch-%%': [ | ||
%%- foreach $define (@{$config{defines}}) { | ||
$OUT .= " '$define',\n"; | ||
} | ||
foreach $define (@lib_cppflags) { | ||
$OUT .= " '$define',\n"; | ||
} | ||
foreach $define (@{$target{defines}}) { | ||
$OUT .= " '$define',\n"; | ||
} | ||
foreach $define (@{liblegacy_defines}) { | ||
$OUT .= " '$define',\n"; | ||
} | ||
foreach $define (@{$config{liblegacy_defines}}) { | ||
$OUT .= " '$define',\n"; | ||
} -%% ], | ||
'openssl_cflags_%%-$arch-%%': [ | ||
%%- foreach $cflag (@cflags) { | ||
$OUT .= " '$cflag',\n"; | ||
} -%% ], | ||
'openssl_ex_libs_%%-$arch-%%': [ | ||
'%%-$target{ex_libs}-%%', | ||
], | ||
'version_script': '%%-$version_script-%%' | ||
}, | ||
'include_dirs': [ | ||
'.', | ||
'./include', | ||
'./crypto', | ||
'./crypto/include/internal', | ||
'./providers/common/include', | ||
], | ||
'defines': ['<@(openssl_defines_%%-$arch-%%)'], | ||
%%- if (!$is_win) { | ||
$OUT .= " 'cflags': ['<@(openssl_cflags_$arch)'],\n"; | ||
$OUT .= " 'libraries': ['<@(openssl_ex_libs_$arch)'],\n"; | ||
if ($version_script ne "") { | ||
$OUT .= " 'ldflags': ['-Wl,--version-script=<@(version_script)'],"; | ||
} | ||
} -%% | ||
'sources': ['<@(openssl_sources)', '<@(openssl_sources_%%-$arch-%%)'], | ||
'direct_dependent_settings': { | ||
'include_dirs': ['./include', '.'], | ||
'defines': ['<@(openssl_defines_%%-$arch-%%)'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
'conditions': [ | ||
['target_arch=="ppc" and OS=="aix"', { | ||
'includes': ['config/archs/aix-gcc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ppc" and OS=="linux"', { | ||
'includes': ['config/archs/linux-ppc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ppc64" and OS=="aix"', { | ||
'includes': ['config/archs/aix64-gcc-as/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', { | ||
'includes': ['config/archs/linux-ppc64le/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ppc64" and OS=="linux"', { | ||
'includes': ['config/archs/linux-ppc64/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="s390x" and OS=="linux"', { | ||
'includes': ['config/archs/linux64-s390x/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="arm" and OS=="linux"', { | ||
'includes': ['config/archs/linux-armv4/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="arm64" and OS=="linux"', { | ||
'includes': ['config/archs/linux-aarch64/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="arm64" and OS=="mac"', { | ||
'includes': ['config/archs/darwin64-arm64-cc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ia32" and OS=="freebsd"', { | ||
'includes': ['config/archs/BSD-x86/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ia32" and OS=="linux"', { | ||
'includes': ['config/archs/linux-elf/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ia32" and OS=="mac"', { | ||
'includes': ['config/archs/darwin-i386-cc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ia32" and OS=="solaris"', { | ||
'includes': ['config/archs/solaris-x86-gcc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="ia32" and OS=="win"', { | ||
'includes': ['config/archs/VC-WIN32/asm/openssl-legacy.gypi'], | ||
'rules': [ | ||
{ | ||
'rule_name': 'Assemble', | ||
'extension': 'asm', | ||
'inputs': [], | ||
'outputs': [ | ||
'<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj', | ||
], | ||
'action': [ | ||
'nasm.exe', | ||
'-f win32', | ||
'-o', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj', | ||
'<(RULE_INPUT_PATH)', | ||
], | ||
} | ||
], | ||
}, 'target_arch=="ia32"', { | ||
'includes': ['config/archs/linux-elf/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="x64" and OS=="freebsd"', { | ||
'includes': ['config/archs/BSD-x86_64/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="x64" and OS=="mac"', { | ||
'includes': ['config/archs/darwin64-x86_64-cc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="x64" and OS=="solaris"', { | ||
'includes': ['config/archs/solaris64-x86_64-gcc/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="x64" and OS=="win"', { | ||
'includes': ['config/archs/VC-WIN64A/asm/openssl-legacy.gypi'], | ||
'rules': [ | ||
{ | ||
'rule_name': 'Assemble', | ||
'extension': 'asm', | ||
'inputs': [], | ||
'outputs': [ | ||
'<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj', | ||
], | ||
'action': [ | ||
'nasm.exe', | ||
'-f win64', | ||
'-DNEAR', | ||
'-Ox', | ||
'-g', | ||
'-o', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj', | ||
'<(RULE_INPUT_PATH)', | ||
], | ||
} | ||
], | ||
}, 'target_arch=="x64" and OS=="linux"', { | ||
'includes': ['config/archs/linux-x86_64/asm/openssl-legacy.gypi'], | ||
}, 'target_arch=="mips64el" and OS=="linux"', { | ||
'includes': ['config/archs/linux64-mips64/asm/openssl-legacy.gypi'], | ||
}, { | ||
# Other architectures don't use assembly | ||
'includes': ['config/archs/linux-x86_64/asm/openssl-legacy.gypi'], | ||
}], | ||
], | ||
} |
Oops, something went wrong.