]>
Commit | Line | Data |
---|---|---|
26abc8f0 | 1 | |
b32b8961 RL |
2 | NOTES FOR THE WINDOWS PLATFORMS |
3 | =============================== | |
26abc8f0 | 4 | |
b32b8961 RL |
5 | Requirement details for native (Visual C++) builds |
6 | -------------------------------------------------- | |
26abc8f0 | 7 | |
07930a75 RL |
8 | In addition to the requirements and instructions listed in INSTALL, |
9 | this are required as well: | |
10 | ||
b32b8961 | 11 | - You need Perl. We recommend ActiveState Perl, available from |
497e9863 | 12 | https://www.activestate.com/ActivePerl. |
d36ab9ce | 13 | You also need the perl module Text::Template, available on CPAN. |
07930a75 | 14 | Please read NOTES.PERL for more information. |
3189772e | 15 | |
b32b8961 | 16 | - You need a C compiler. OpenSSL has been tested to build with these: |
26abc8f0 | 17 | |
b32b8961 | 18 | * Visual C++ |
26abc8f0 | 19 | |
b32b8961 RL |
20 | - Netwide Assembler, a.k.a. NASM, available from http://www.nasm.us, |
21 | is required if you intend to utilize assembler modules. Note that NASM | |
22 | is the only supported assembler. The Microsoft provided assembler is NOT | |
23 | supported. | |
26abc8f0 | 24 | |
b32b8961 | 25 | |
8c16829e RL |
26 | Visual C++ (native Windows) |
27 | --------------------------- | |
28 | ||
29 | Installation directories | |
30 | ||
31 | The default installation directories are derived from environment | |
32 | variables. | |
33 | ||
34 | For VC-WIN32, the following defaults are use: | |
35 | ||
36 | PREFIX: %ProgramFiles(86)%\OpenSSL | |
37 | OPENSSLDIR: %CommonProgramFiles(86)%\SSL | |
38 | ||
e7b69227 | 39 | For VC-WIN64, the following defaults are use: |
8c16829e RL |
40 | |
41 | PREFIX: %ProgramW6432%\OpenSSL | |
42 | OPENSSLDIR: %CommonProgramW6432%\SSL | |
43 | ||
44 | Should those environment variables not exist (on a pure Win32 | |
45 | installation for examples), these fallbacks are used: | |
46 | ||
47 | PREFIX: %ProgramFiles%\OpenSSL | |
48 | OPENSSLDIR: %CommonProgramFiles%\SSL | |
49 | ||
1c7bfec5 RL |
50 | ALSO NOTE that those directories are usually write protected, even if |
51 | your account is in the Administrators group. To work around that, | |
52 | start the command prompt by right-clicking on it and choosing "Run as | |
53 | Administrator" before running 'nmake install'. The other solution | |
54 | is, of course, to choose a different set of directories by using | |
55 | --prefix and --openssldir when configuring. | |
8c16829e | 56 | |
b32b8961 RL |
57 | GNU C (Cygwin) |
58 | -------------- | |
59 | ||
60 | Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of the | |
61 | Windows subsystem and provides a bash shell and GNU tools environment. | |
62 | Consequently, a make of OpenSSL with Cygwin is virtually identical to the | |
ad839325 | 63 | Unix procedure. |
b32b8961 RL |
64 | |
65 | To build OpenSSL using Cygwin, you need to: | |
66 | ||
497e9863 | 67 | * Install Cygwin (see https://cygwin.com/) |
b32b8961 | 68 | |
ad839325 AP |
69 | * Install Cygwin Perl and ensure it is in the path. Recall that |
70 | as least 5.10.0 is required. | |
b32b8961 RL |
71 | |
72 | * Run the Cygwin bash shell | |
73 | ||
74 | Apart from that, follow the Unix instructions in INSTALL. | |
75 | ||
76 | NOTE: "make test" and normal file operations may fail in directories | |
77 | mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin | |
78 | stripping of carriage returns. To avoid this ensure that a binary | |
79 | mount is used, e.g. mount -b c:\somewhere /home. | |
80 | ||
ad839325 AP |
81 | It is also possible to create "conventional" Windows binaries that use |
82 | the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using MinGW | |
83 | development add-on for Cygwin. MinGW is supported even as a standalone | |
84 | setup as described in the following section. In the context you should | |
85 | recognize that binaries targeting Cygwin itself are not interchangeable | |
86 | with "conventional" Windows binaries you generate with/for MinGW. | |
b32b8961 | 87 | |
3e67b333 | 88 | |
b32b8961 | 89 | GNU C (MinGW/MSYS) |
8c16829e | 90 | ------------------ |
b32b8961 RL |
91 | |
92 | * Compiler and shell environment installation: | |
93 | ||
94 | MinGW and MSYS are available from http://www.mingw.org/, both are | |
95 | required. Run the installers and do whatever magic they say it takes | |
ad839325 AP |
96 | to start MSYS bash shell with GNU tools and matching Perl on its PATH. |
97 | "Matching Perl" refers to chosen "shell environment", i.e. if built | |
8c4f8039 | 98 | under MSYS, then Perl compiled for MSYS must be used. |
b32b8961 | 99 | |
f430ba31 | 100 | Alternatively, one can use MSYS2 from https://msys2.github.io/, |
b32b8961 RL |
101 | which includes MingW (32-bit and 64-bit). |
102 | ||
103 | * It is also possible to cross-compile it on Linux by configuring | |
104 | with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'. | |
105 | Other possible cross compile prefixes include x86_64-w64-mingw32- | |
106 | and i686-w64-mingw32-. | |
107 | ||
108 | ||
ad839325 AP |
109 | Linking your application |
110 | ------------------------ | |
111 | ||
112 | This section applies to non-Cygwin builds. | |
113 | ||
114 | If you link with static OpenSSL libraries then you're expected to | |
531e9dcc RL |
115 | additionally link your application with WS2_32.LIB, GDI32.LIB, |
116 | ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those developing | |
117 | non-interactive service applications might feel concerned about | |
118 | linking with GDI32.LIB and USER32.LIB, as they are justly associated | |
119 | with interactive desktop, which is not available to service | |
120 | processes. The toolkit is designed to detect in which context it's | |
121 | currently executed, GUI, console app or service, and act accordingly, | |
122 | namely whether or not to actually make GUI calls. Additionally those | |
123 | who wish to /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and | |
124 | actually keep them off service process should consider implementing | |
125 | and exporting from .exe image in question own _OPENSSL_isservice not | |
126 | relying on USER32.DLL. E.g., on Windows Vista and later you could: | |
ad839325 AP |
127 | |
128 | __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void) | |
129 | { DWORD sess; | |
130 | if (ProcessIdToSessionId(GetCurrentProcessId(),&sess)) | |
131 | return sess==0; | |
132 | return FALSE; | |
133 | } | |
134 | ||
135 | If you link with OpenSSL .DLLs, then you're expected to include into | |
136 | your application code small "shim" snippet, which provides glue between | |
137 | OpenSSL BIO layer and your compiler run-time. See the OPENSSL_Applink | |
138 | manual page for further details. |