2 NOTES FOR THE WINDOWS PLATFORMS
3 ===============================
5 [Notes for Windows CE can be found in INSTALL.WCE]
7 Requirement details for native (Visual C++) builds
8 --------------------------------------------------
10 - You need Perl. We recommend ActiveState Perl, available from
11 http://www.activestate.com/ActivePerl.
12 You also need the perl module Text::Template, available on CPAN.
13 Please read README.PERL for more information.
15 - You need a C compiler. OpenSSL has been tested to build with these:
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
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.
36 To build OpenSSL using Cygwin, you need to:
38 * Install Cygwin (see http://cygwin.com/)
40 * Install Perl and ensure it is in the path. Both Cygwin perl
41 (5.6.1-2 or newer) and ActivePerl work.
43 * Run the Cygwin bash shell
45 Apart from that, follow the Unix instructions in INSTALL.
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.
56 * Compiler and shell environment installation:
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.
62 Alternativelly, one can use MSYS2 from http://msys2.github.io/,
63 which includes MingW (32-bit and 64-bit).
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-.
71 Linking your application
72 ------------------------
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:
88 __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
90 if (ProcessIdToSessionId(GetCurrentProcessId(),&sess))
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.
101 "Classic" builds (Visual C++)
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.
108 NOTE: this won't be available for long.]
110 If you want to compile in the assembly language routines with Visual
111 C++, then you will need the Netwide Assembler binary, nasmw.exe or nasm.exe, to
112 be available on your %PATH%.
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.
120 > perl Configure VC-WIN32 --classic --prefix=c:\some\openssl\dir
123 Note: replace the last line above with the following if not using the assembly
130 > perl Configure VC-WIN64A --classic --prefix=c:\some\openssl\dir
135 > perl Configure VC-WIN64I --classic --prefix=c:\some\openssl\dir
138 Where the prefix argument specifies where OpenSSL will be installed to.
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.
144 > nmake -f ms\ntdll.mak
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:
149 > nmake -f ms\ntdll.mak test
151 To install OpenSSL to the specified location do:
153 > nmake -f ms\ntdll.mak install
157 There are various changes you can make to the Windows compile
158 environment. By default the library is not compiled with debugging
159 symbols. If you add --debug to the Configure lines above then debugging symbols
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
165 into libcrypto32.dll instead.
167 You can also build a static version of the library using the Makefile