build: first set of updates to enable PPC support
[platform/upstream/nodejs.git] / deps / openssl / config / opensslconf.h
1 /*
2   In OpenSSL, opensslconf.h was generated by Configure script with
3   specifying a target argument, where it includes several defines that
4   depend on OS and architecture platform.
5
6   In iojs, we statically mapped --dest-os and --dest-cpu options in
7   configure to the target of Configure in OpenSSL and make
8   `deps/openssl/conf/openssconf.h` so as to include each file
9   according to its target by checking pre-defined compiler macros.
10
11   Included opnesslconf.h files for supported target architectures can
12   be generated by `Makefile` and stored under
13   `archs/{target}/opensslconf.h`. The Makefile also fixes several
14   defines to meet iojs build requirements.
15
16   Here is a map table of configure options in iojs, target arch of
17   Configure in OpenSSL and CI support.
18
19   | --dest-os | --dest-cpu | OpenSSL target arch  | CI  |
20   | --------- | ---------- | -------------------- | --- |
21   | linux     | ia32       | linux-elf            | o   |
22   | linux     | x32        | linux-x32            | -   |
23   | linux     | x64        | linux-x86_64         | o   |
24   | linux     | arm        | linux-armv4          | o   |
25   | linux     | arm64      | linux-aarch64        | o   |
26   | linux     | ppc        | linux-ppc            | o   |
27   | linux     | ppc64      | linux-ppc64          | o   |
28   | mac       | ia32       | darwin-i386-cc       | o   |
29   | mac       | x64        | darwin64-x86-cc      | o   |
30   | win       | ia32       | VC-WIN32             | -   |
31   | win       | x64        | VC-WIN64A            | o   |
32   | solaris   | ia32       | solaris-x86-gcc      | o   |
33   | solaris   | x64        | solaris64-x86_64-gcc | o   |
34   | freebsd   | ia32       | BSD-x86              | o   |
35   | freebsd   | x64        | BSD-x86_64           | o   |
36   | openbsd   | ia32       | BSD-x86              | -   |
37   | openbsd   | x64        | BSD-x86_64           | -   |
38   | others    | others     | linux-elf            | -   |
39
40   --dest-os and --dest-cpu are mapped to pre-defined macros.
41
42   | --dest-os          | pre-defined macro         |
43   | ------------------ | ------------------------- |
44   | win                | _WIN32                    |
45   | win(64bit)         | _WIN64                    |
46   | mac                | __APPLE__ && __MACH__     |
47   | solaris            | __sun                     |
48   | freebsd            | __FreeBSD__               |
49   | openbsd            | __OpenBSD__               |
50   | linux (not andorid)| __linux__ && !__ANDROID__ |
51   | android            | __ANDROID__               |
52
53   | --dest-cpu | pre-defined macro |
54   | ---------- | ----------------- |
55   | arm        | __arm__           |
56   | arm64      | __aarch64__       |
57   | ia32       | __i386__          |
58   | ia32(win)  | _M_IX86           |
59   | mips       | __mips__          |
60   | mipsel     | __MIPSEL__        |
61   | x32        | __ILP32__         |
62   | x64        | __x86_64__        |
63   | x64(win)   | _M_X64            |
64   | ppc        | __PPC__           |
65   | ppc64      | __PPC64__         |
66
67   These are the list which is not implemented yet.
68
69   | --dest-os | --dest-cpu | OpenSSL target arch  | CI  |
70   | --------- | ---------- | -------------------- | --- |
71   | linux     | mips       | linux-mips32,linux-mips64,linux64-mips64? | --- |
72   | linux     | mipsel     | ?                    | --- |
73   | android   | ia32       | android-x86          | --- |
74   | android   | arm        | android-armv7        | --- |
75   | android   | mips       | android-mips         | --- |
76   | android   | mipsel     | ?                    | --- |
77
78   Supported target arch list in OpenSSL can be obtained by typing
79   `deps/openssl/openssl/Configure LIST`.
80
81 */
82
83 #undef OPENSSL_LINUX
84 #if defined(__linux) && !defined(__ANDROID__)
85 # define OPENSSL_LINUX 1
86 #endif
87
88 #if defined(OPENSSL_LINUX) && defined(__i386__)
89 # include "./archs/linux-elf/opensslconf.h"
90 #elif defined(OPENSSL_LINUX) && defined(__ILP32__)
91 # include "./archs/linux-x32/opensslconf.h"
92 #elif defined(OPENSSL_LINUX) && defined(__x86_64__)
93 # include "./archs/linux-x86_64/opensslconf.h"
94 #elif defined(OPENSSL_LINUX) && defined(__arm__)
95 # include "./archs/linux-armv4/opensslconf.h"
96 #elif defined(OPENSSL_LINUX) && defined(__aarch64__)
97 # include "./archs/linux-aarch64/opensslconf.h"
98 #elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
99 # include "./archs/darwin-i386-cc/opensslconf.h"
100 #elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)
101 # include "./archs/darwin64-x86_64-cc/opensslconf.h"
102 #elif defined(_WIN32) && defined(_M_IX86)
103 # include "./archs/VC-WIN32/opensslconf.h"
104 #elif defined(_WIN32) && defined(_M_X64)
105 # include "./archs/VC-WIN64A/opensslconf.h"
106 #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
107 # include "./archs/BSD-x86/opensslconf.h"
108 #elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)
109 # include "./archs/BSD-x86_64/opensslconf.h"
110 #elif defined(__sun) && defined(__i386__)
111 # include "./archs/solaris-x86-gcc/opensslconf.h"
112 #elif defined(__sun) && defined(__x86_64__)
113 # include "./archs/solaris64-x86_64-gcc/opensslconf.h"
114 #elif defined(OPENSSL_LINUX) && defined(__PPC64__)
115 # include "./archs/linux-ppc64/opensslconf.h"
116 #elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__)
117 # include "./archs/linux-ppc/opensslconf.h"
118 #else
119 # include "./archs/linux-elf/opensslconf.h"
120 #endif
121
122 /* GOST is not included in all platform */
123 #ifndef OPENSSL_NO_GOST
124 # define OPENSSL_NO_GOST
125 #endif
126 /* HW_PADLOCK is not included in all platform */
127 #ifndef OPENSSL_NO_HW_PADLOCK
128 # define OPENSSL_NO_HW_PADLOCK
129 #endif