From 99eb744842462bad1c1c112d7994ffc6f65b06d9 Mon Sep 17 00:00:00 2001 From: Shigeki Ohtsu Date: Wed, 7 Mar 2018 21:38:23 +0900 Subject: deps: add gyp, header and Makefile for openssl110 This commit has a new binding scheme in builing OpenSSL-1.1.0 library with Node. OpenSSL-1.1.0 uses a new build system with perl for various supported platforms. See `Configurations/README` and `Configurations/README.design` in the OpenSSL source for details. In order to build OpenSSL library without perl in the build of Node for various supported platforms, platform dependent files (e.g. asm and header files ) are pre-generated and stored into the `config/arch` directory. - Makefile and generate_gypi.pl Makefile has supported platform list and generates and copies platform dependent files (e.g. asm files) into arch directory with generate_gypi.pl. Platform dependent gypi files also created obtaining build information from `configdata.pm` that is generated with `Configure` in the OpenSSL build system. For Windows, `Configure` generates makefile that is only available to nmake command. Since nmake is not supported in Linux, `Makefile_VC-WIN32` and `Makefile_VC-WIN64A` are made created by hand for the use of GNU make. If make rules or targets are changed in the version up of OpenSSL, they should be also updated. The following files are used in upgrading openssl-1.1.0. - gyp and gypi files openssl.gyp has two targets of openssl and openssl-cli referred from node.gyp. They includes asm and no_asm gypi files with arch dependent gypi according to its build options and platforms . The gyp data which is common with asm and no_asm are stored in openssl_common.gypi. - header files bn_conf.h, dso_conf.h and opensslconf.h are platform dependent in the OpenSSL sources. They are replaced with *.h.tmpl files to include the file in the `../../../config/` and referred to each arch files that depends on asm and no-asm option. Fixes: https://github.com/nodejs/node/issues/4270 PR-URL: https://github.com/nodejs/node/pull/19794 Reviewed-By: James M Snell Reviewed-By: Rod Vagg Reviewed-By: Michael Dawson --- deps/openssl/openssl_common.gypi | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 deps/openssl/openssl_common.gypi (limited to 'deps/openssl/openssl_common.gypi') diff --git a/deps/openssl/openssl_common.gypi b/deps/openssl/openssl_common.gypi new file mode 100644 index 0000000000..252570006a --- /dev/null +++ b/deps/openssl/openssl_common.gypi @@ -0,0 +1,68 @@ +{ + 'include_dirs': [ + 'openssl/', + 'openssl/include/', + 'openssl/crypto/', + 'openssl/crypto/include/', + 'openssl/crypto/modes/', + 'config/', + ], + # build options specific to OS + 'conditions': [ + [ 'OS=="aix"', { + # AIX is missing /usr/include/endian.h + 'defines': [ + '__LITTLE_ENDIAN=1234', + '__BIG_ENDIAN=4321', + '__BYTE_ORDER=__BIG_ENDIAN', + '__FLOAT_WORD_ORDER=__BIG_ENDIAN', + 'OPENSSLDIR="/etc/ssl"', + 'ENGINESDIR="/dev/null"', + ], + }, 'OS=="win"', { + 'defines': [ + ## default of Win. See INSTALL in openssl repo. + 'OPENSSLDIR="C:\Program Files\Common Files\SSL"', + 'ENGINESDIR="NUL"', + 'OPENSSL_SYS_WIN32', 'WIN32_LEAN_AND_MEAN', 'L_ENDIAN', + '_CRT_SECURE_NO_DEPRECATE', 'UNICODE', '_UNICODE', + ], + 'cflags': [ + '-W3', '-wd4090', '-Gs0', '-GF', '-Gy', '-nologo','/O2', + ], + 'link_settings': { + 'libraries': [ + '-lws2_32.lib', + '-lgdi32.lib', + '-ladvapi32.lib', + '-lcrypt32.lib', + '-luser32.lib', + ], + }, + }, 'OS=="mac"', { + 'xcode_settings': { + 'WARNING_CFLAGS': ['-Wno-missing-field-initializers'] + }, + 'defines': [ + 'OPENSSLDIR="/System/Library/OpenSSL/"', + 'ENGINESDIR="/dev/null"', + ], + }, 'OS=="solaris"', { + 'defines': [ + 'OPENSSLDIR="/etc/ssl"', + 'ENGINESDIR="/dev/null"', + '__EXTENSIONS__' + ], + }, { + # linux and others + 'cflags': ['-Wno-missing-field-initializers', + ## TODO: check gcc_version>=4.3 + '-Wno-old-style-declaration'], + 'defines': [ + 'OPENSSLDIR="/etc/ssl"', + 'ENGINESDIR="/dev/null"', + 'TERMIOS', + ], + }], + ] +} -- cgit v1.2.3