]>
Commit | Line | Data |
---|---|---|
26abc8f0 | 1 | |
b32b8961 RL |
2 | NOTES FOR THE WINDOWS PLATFORMS |
3 | =============================== | |
26abc8f0 | 4 | |
b32b8961 | 5 | [Notes for Windows CE can be found in INSTALL.WCE] |
26abc8f0 | 6 | |
b32b8961 RL |
7 | Requirement details for native (Visual C++) builds |
8 | -------------------------------------------------- | |
26abc8f0 | 9 | |
b32b8961 RL |
10 | - You need Perl. We recommend ActiveState Perl, available from |
11 | http://www.activestate.com/ActivePerl. | |
d36ab9ce RL |
12 | You also need the perl module Text::Template, available on CPAN. |
13 | Please read README.PERL for more information. | |
3189772e | 14 | |
b32b8961 | 15 | - You need a C compiler. OpenSSL has been tested to build with these: |
26abc8f0 | 16 | |
b32b8961 | 17 | * Visual C++ |
26abc8f0 | 18 | |
b32b8961 RL |
19 | - Netwide Assembler, a.k.a. NASM, available from http://www.nasm.us, |
20 | is required if you intend to utilize assembler modules. Note that NASM | |
21 | is the only supported assembler. The Microsoft provided assembler is NOT | |
22 | supported. | |
26abc8f0 | 23 | |
b32b8961 RL |
24 | |
25 | GNU C (Cygwin) | |
26 | -------------- | |
27 | ||
28 | Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of the | |
29 | Windows subsystem and provides a bash shell and GNU tools environment. | |
30 | Consequently, a make of OpenSSL with Cygwin is virtually identical to the | |
31 | Unix procedure. It is also possible to create Windows binaries that only | |
32 | use the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using | |
33 | MinGW. MinGW can be used in the Cygwin development environment or in a | |
34 | standalone setup as described in the following section. | |
35 | ||
36 | To build OpenSSL using Cygwin, you need to: | |
37 | ||
38 | * Install Cygwin (see http://cygwin.com/) | |
39 | ||
40 | * Install Perl and ensure it is in the path. Both Cygwin perl | |
41 | (5.6.1-2 or newer) and ActivePerl work. | |
42 | ||
43 | * Run the Cygwin bash shell | |
44 | ||
45 | Apart from that, follow the Unix instructions in INSTALL. | |
46 | ||
47 | NOTE: "make test" and normal file operations may fail in directories | |
48 | mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin | |
49 | stripping of carriage returns. To avoid this ensure that a binary | |
50 | mount is used, e.g. mount -b c:\somewhere /home. | |
51 | ||
52 | ||
53 | GNU C (MinGW/MSYS) | |
54 | ------------- | |
55 | ||
56 | * Compiler and shell environment installation: | |
57 | ||
58 | MinGW and MSYS are available from http://www.mingw.org/, both are | |
59 | required. Run the installers and do whatever magic they say it takes | |
60 | to start MSYS bash shell with GNU tools on its PATH. | |
61 | ||
62 | Alternativelly, one can use MSYS2 from http://msys2.github.io/, | |
63 | which includes MingW (32-bit and 64-bit). | |
64 | ||
65 | * It is also possible to cross-compile it on Linux by configuring | |
66 | with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'. | |
67 | Other possible cross compile prefixes include x86_64-w64-mingw32- | |
68 | and i686-w64-mingw32-. | |
69 | ||
70 | ||
71 | Linking your application | |
72 | ------------------------ | |
73 | ||
74 | If you link with static OpenSSL libraries then you're expected to | |
75 | additionally link your application with WS2_32.LIB, ADVAPI32.LIB, | |
76 | GDI32.LIB and USER32.LIB. Those developing non-interactive service | |
77 | applications might feel concerned about linking with the latter two, | |
78 | as they are justly associated with interactive desktop, which is not | |
79 | available to service processes. The toolkit is designed to detect in | |
80 | which context it's currently executed, GUI, console app or service, | |
81 | and act accordingly, namely whether or not to actually make GUI calls. | |
82 | Additionally those who wish to /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL | |
83 | and actually keep them off service process should consider | |
84 | implementing and exporting from .exe image in question own | |
85 | _OPENSSL_isservice not relying on USER32.DLL. | |
86 | E.g., on Windows Vista and later you could: | |
87 | ||
88 | __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void) | |
89 | { DWORD sess; | |
90 | if (ProcessIdToSessionId(GetCurrentProcessId(),&sess)) | |
91 | return sess==0; | |
92 | return FALSE; | |
93 | } | |
94 | ||
95 | If you link with OpenSSL .DLLs, then you're expected to include into | |
96 | your application code small "shim" snippet, which provides glue between | |
97 | OpenSSL BIO layer and your compiler run-time. See the OPENSSL_Applink | |
98 | manual page for further details. | |
99 | ||
100 | ||
101 | "Classic" builds (Visual C++) | |
102 | ---------------- | |
103 | ||
104 | [OpenSSL was classically built using a script called mk1mf. This is | |
105 | still available by configuring with --classic. The notes below are | |
106 | using this flag, and are tentative. Use with care. | |
107 | ||
108 | NOTE: this won't be available for long.] | |
26abc8f0 | 109 | |
3189772e | 110 | If you want to compile in the assembly language routines with Visual |
7a77bd9d MC |
111 | C++, then you will need the Netwide Assembler binary, nasmw.exe or nasm.exe, to |
112 | be available on your %PATH%. | |
26abc8f0 | 113 | |
7a77bd9d MC |
114 | Firstly you should run Configure and generate the Makefiles. If you don't want |
115 | the assembly language files then add the "no-asm" option (without quotes) to | |
116 | the Configure lines below. | |
26abc8f0 | 117 | |
7a77bd9d | 118 | For Win32: |
df8dae1d | 119 | |
b32b8961 | 120 | > perl Configure VC-WIN32 --classic --prefix=c:\some\openssl\dir |
7a77bd9d | 121 | > ms\do_nasm |
26abc8f0 | 122 | |
7a77bd9d | 123 | Note: replace the last line above with the following if not using the assembly |
3189772e | 124 | language files: |
26abc8f0 | 125 | |
7a77bd9d | 126 | > ms\do_ms |
26abc8f0 | 127 | |
7a77bd9d | 128 | For Win64/x64: |
26abc8f0 | 129 | |
b32b8961 | 130 | > perl Configure VC-WIN64A --classic --prefix=c:\some\openssl\dir |
7a77bd9d | 131 | > ms\do_win64a |
26abc8f0 | 132 | |
7a77bd9d | 133 | For Win64/IA64: |
26abc8f0 | 134 | |
b32b8961 | 135 | > perl Configure VC-WIN64I --classic --prefix=c:\some\openssl\dir |
7a77bd9d | 136 | > ms\do_win64i |
26abc8f0 | 137 | |
7a77bd9d MC |
138 | Where the prefix argument specifies where OpenSSL will be installed to. |
139 | ||
140 | Then from the VC++ environment at a prompt do the following. Note, your %PATH% | |
141 | and other environment variables should be set up for 32-bit or 64-bit | |
142 | development as appropriate. | |
26abc8f0 RL |
143 | |
144 | > nmake -f ms\ntdll.mak | |
145 | ||
3189772e AP |
146 | If all is well it should compile and you will have some DLLs and |
147 | executables in out32dll. If you want to try the tests then do: | |
df8dae1d | 148 | |
7a77bd9d | 149 | > nmake -f ms\ntdll.mak test |
df8dae1d | 150 | |
3189772e | 151 | To install OpenSSL to the specified location do: |
df8dae1d | 152 | |
3189772e | 153 | > nmake -f ms\ntdll.mak install |
26abc8f0 RL |
154 | |
155 | Tweaks: | |
156 | ||
7a77bd9d | 157 | There are various changes you can make to the Windows compile |
3189772e | 158 | environment. By default the library is not compiled with debugging |
7a77bd9d MC |
159 | symbols. If you add --debug to the Configure lines above then debugging symbols |
160 | will be compiled in. | |
26abc8f0 | 161 | |
7a77bd9d MC |
162 | By default in 1.1.0 OpenSSL will compile builtin ENGINES into separate shared |
163 | libraries. If you specify the "enable-static-engine" option on the command line | |
164 | to Configure the shared library build (ms\ntdll.mak) will compile the engines | |
6928b617 | 165 | into libcrypto32.dll instead. |
26abc8f0 RL |
166 | |
167 | You can also build a static version of the library using the Makefile | |
168 | ms\nt.mak |