11cb0ef41Sopenharmony_ci/* 21cb0ef41Sopenharmony_ci In OpenSSL, opensslconf.h was generated by Configure script with 31cb0ef41Sopenharmony_ci specifying a target argument, where it includes several defines that 41cb0ef41Sopenharmony_ci depend on OS and architecture platform. 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci In node, we statically mapped --dest-os and --dest-cpu options in 71cb0ef41Sopenharmony_ci configure to the target of Configure in OpenSSL and make 81cb0ef41Sopenharmony_ci `deps/openssl/conf/openssconf.h` so as to include each file 91cb0ef41Sopenharmony_ci according to its target by checking pre-defined compiler macros. 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci Included opnesslconf.h files for supported target architectures can 121cb0ef41Sopenharmony_ci be generated by `Makefile` and stored under 131cb0ef41Sopenharmony_ci `archs/{target}/asm/opensslconf.h`. The Makefile also fixes several 141cb0ef41Sopenharmony_ci defines to meet node build requirements. 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci Here is a map table of configure options in node, target arch of 171cb0ef41Sopenharmony_ci Configure in OpenSSL and CI support. 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ci | --dest-os | --dest-cpu | OpenSSL target arch | CI | 201cb0ef41Sopenharmony_ci | --------- | ---------- | -------------------- | --- | 211cb0ef41Sopenharmony_ci | aix | ppc | aix-gcc | o | 221cb0ef41Sopenharmony_ci | aix | ppc64 | aix64-gcc-as | o | 231cb0ef41Sopenharmony_ci | linux | ia32 | linux-elf | o | 241cb0ef41Sopenharmony_ci | linux | x32 | linux-x32 | - | 251cb0ef41Sopenharmony_ci | linux | x64 | linux-x86_64 | o | 261cb0ef41Sopenharmony_ci | linux | arm | linux-armv4 | o | 271cb0ef41Sopenharmony_ci | linux | arm64 | linux-aarch64 | o | 281cb0ef41Sopenharmony_ci | linux | ppc | linux-ppc | o | 291cb0ef41Sopenharmony_ci | linux | ppc64 | linux-ppc64 | o | 301cb0ef41Sopenharmony_ci | linux | ppc64 | linux-ppc64le | o | (node_byteoder: little) 311cb0ef41Sopenharmony_ci | linux | s390 | linux32-s390x | o | 321cb0ef41Sopenharmony_ci | linux | s390x | linux64-s390x | o | 331cb0ef41Sopenharmony_ci | mac | ia32 | darwin-i386-cc | - | 341cb0ef41Sopenharmony_ci | mac | x64 | darwin64-x86-cc | o | 351cb0ef41Sopenharmony_ci | mac | arm64 | darwin64-arm64-cc | - | 361cb0ef41Sopenharmony_ci | win | ia32 | VC-WIN32 | - | 371cb0ef41Sopenharmony_ci | win | x64 | VC-WIN64A | o | 381cb0ef41Sopenharmony_ci | solaris | ia32 | solaris-x86-gcc | o | 391cb0ef41Sopenharmony_ci | solaris | x64 | solaris64-x86_64-gcc | o | 401cb0ef41Sopenharmony_ci | freebsd | ia32 | BSD-x86 | - | 411cb0ef41Sopenharmony_ci | freebsd | x64 | BSD-x86_64 | o | 421cb0ef41Sopenharmony_ci | openbsd | ia32 | BSD-x86 | - | 431cb0ef41Sopenharmony_ci | openbsd | x64 | BSD-x86_64 | - | 441cb0ef41Sopenharmony_ci | others | others | linux-elf | - | 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci --dest-os and --dest-cpu are mapped to pre-defined macros. 471cb0ef41Sopenharmony_ci 481cb0ef41Sopenharmony_ci | --dest-os | pre-defined macro | 491cb0ef41Sopenharmony_ci | ------------------ | ------------------------- | 501cb0ef41Sopenharmony_ci | aix | _AIX | 511cb0ef41Sopenharmony_ci | win | _WIN32 | 521cb0ef41Sopenharmony_ci | win(64bit) | _WIN64 | 531cb0ef41Sopenharmony_ci | mac | __APPLE__ && __MACH__ | 541cb0ef41Sopenharmony_ci | solaris | __sun | 551cb0ef41Sopenharmony_ci | freebsd | __FreeBSD__ | 561cb0ef41Sopenharmony_ci | openbsd | __OpenBSD__ | 571cb0ef41Sopenharmony_ci | linux (not andorid)| __linux__ && !__ANDROID__ | 581cb0ef41Sopenharmony_ci | android | __ANDROID__ | 591cb0ef41Sopenharmony_ci 601cb0ef41Sopenharmony_ci | --dest-cpu | pre-defined macro | 611cb0ef41Sopenharmony_ci | ---------- | ----------------- | 621cb0ef41Sopenharmony_ci | arm | __arm__ | 631cb0ef41Sopenharmony_ci | arm64 | __aarch64__ | 641cb0ef41Sopenharmony_ci | ia32 | __i386__ | 651cb0ef41Sopenharmony_ci | ia32(win) | _M_IX86 | 661cb0ef41Sopenharmony_ci | mips | __mips__ | 671cb0ef41Sopenharmony_ci | mipsel | __MIPSEL__ | 681cb0ef41Sopenharmony_ci | x32 | __ILP32__ | 691cb0ef41Sopenharmony_ci | x64 | __x86_64__ | 701cb0ef41Sopenharmony_ci | x64(win) | _M_X64 | 711cb0ef41Sopenharmony_ci | ppc | __PPC__ | 721cb0ef41Sopenharmony_ci | | _ARCH_PPC | 731cb0ef41Sopenharmony_ci | ppc64 | __PPC64__ | 741cb0ef41Sopenharmony_ci | | _ARCH_PPC64 | 751cb0ef41Sopenharmony_ci | s390 | __s390__ | 761cb0ef41Sopenharmony_ci | s390x | __s390x__ | 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ci These are the list which is not implemented yet. 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ci | --dest-os | --dest-cpu | OpenSSL target arch | CI | 811cb0ef41Sopenharmony_ci | --------- | ---------- | -------------------- | --- | 821cb0ef41Sopenharmony_ci | linux | mips | linux-mips32,linux-mips64,linux64-mips64? | --- | 831cb0ef41Sopenharmony_ci | linux | mipsel | ? | --- | 841cb0ef41Sopenharmony_ci | android | ia32 | android-x86 | --- | 851cb0ef41Sopenharmony_ci | android | arm | android-armv7 | --- | 861cb0ef41Sopenharmony_ci | android | mips | android-mips | --- | 871cb0ef41Sopenharmony_ci | android | mipsel | ? | --- | 881cb0ef41Sopenharmony_ci 891cb0ef41Sopenharmony_ci Supported target arch list in OpenSSL can be obtained by typing 901cb0ef41Sopenharmony_ci `deps/openssl/openssl/Configure LIST`. 911cb0ef41Sopenharmony_ci 921cb0ef41Sopenharmony_ci*/ 931cb0ef41Sopenharmony_ci 941cb0ef41Sopenharmony_ci#if defined(OPENSSL_LINUX) && defined(__i386__) 951cb0ef41Sopenharmony_ci# include "./archs/linux-elf/asm/include/openssl/opensslconf.h" 961cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__x86_64__) 971cb0ef41Sopenharmony_ci# include "./archs/linux-x86_64/asm/include/openssl/opensslconf.h" 981cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__arm__) 991cb0ef41Sopenharmony_ci# include "./archs/linux-armv4/asm/include/openssl/opensslconf.h" 1001cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__aarch64__) 1011cb0ef41Sopenharmony_ci# include "./archs/linux-aarch64/asm/include/openssl/opensslconf.h" 1021cb0ef41Sopenharmony_ci#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__) 1031cb0ef41Sopenharmony_ci# include "./archs/darwin-i386-cc/asm/include/openssl/opensslconf.h" 1041cb0ef41Sopenharmony_ci#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) 1051cb0ef41Sopenharmony_ci# include "./archs/darwin64-x86_64-cc/asm/include/openssl/opensslconf.h" 1061cb0ef41Sopenharmony_ci#elif defined(__APPLE__) && defined(__MACH__) && defined(__arm64__) 1071cb0ef41Sopenharmony_ci# include "./archs/darwin64-arm64-cc/asm/include/openssl/opensslconf.h" 1081cb0ef41Sopenharmony_ci#elif defined(_WIN32) && defined(_M_IX86) 1091cb0ef41Sopenharmony_ci# include "./archs/VC-WIN32/asm/include/openssl/opensslconf.h" 1101cb0ef41Sopenharmony_ci#elif defined(_WIN32) && defined(_M_X64) 1111cb0ef41Sopenharmony_ci# include "./archs/VC-WIN64A/asm/include/openssl/opensslconf.h" 1121cb0ef41Sopenharmony_ci#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__) 1131cb0ef41Sopenharmony_ci# include "./archs/BSD-x86/asm/include/openssl/opensslconf.h" 1141cb0ef41Sopenharmony_ci#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__) 1151cb0ef41Sopenharmony_ci# include "./archs/BSD-x86_64/asm/include/openssl/opensslconf.h" 1161cb0ef41Sopenharmony_ci#elif defined(__sun) && defined(__i386__) 1171cb0ef41Sopenharmony_ci# include "./archs/solaris-x86-gcc/asm/include/openssl/opensslconf.h" 1181cb0ef41Sopenharmony_ci#elif defined(__sun) && defined(__x86_64__) 1191cb0ef41Sopenharmony_ci# include "./archs/solaris64-x86_64-gcc/asm/include/openssl/opensslconf.h" 1201cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__PPC64__) && defined(L_ENDIAN) 1211cb0ef41Sopenharmony_ci# include "./archs/linux-ppc64le/asm/include/openssl/opensslconf.h" 1221cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__PPC64__) 1231cb0ef41Sopenharmony_ci# include "./archs/linux-ppc64/asm/include/openssl/opensslconf.h" 1241cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) 1251cb0ef41Sopenharmony_ci# include "./archs/linux-ppc/asm/include/openssl/opensslconf.h" 1261cb0ef41Sopenharmony_ci#elif defined(_AIX) && defined(_ARCH_PPC64) 1271cb0ef41Sopenharmony_ci# include "./archs/aix64-gcc-as/asm/include/openssl/opensslconf.h" 1281cb0ef41Sopenharmony_ci#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) 1291cb0ef41Sopenharmony_ci# include "./archs/aix-gcc/asm/include/openssl/opensslconf.h" 1301cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__s390x__) 1311cb0ef41Sopenharmony_ci# include "./archs/linux64-s390x/asm/include/openssl/opensslconf.h" 1321cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__s390__) 1331cb0ef41Sopenharmony_ci# include "./archs/linux32-s390x/asm/include/openssl/opensslconf.h" 1341cb0ef41Sopenharmony_ci#elif defined(OPENSSL_LINUX) && defined(__mips64) && defined(__MIPSEL__) 1351cb0ef41Sopenharmony_ci# include "./archs/linux64-mips64/asm/include/openssl/opensslconf.h" 1361cb0ef41Sopenharmony_ci#else 1371cb0ef41Sopenharmony_ci# include "./archs/linux-elf/asm/include/openssl/opensslconf.h" 1381cb0ef41Sopenharmony_ci#endif 139