5
5
[Instructions for building for Windows CE can be found in INSTALL.WCE]
6
6
[Instructions for building for Win64 can be found in INSTALL.W64]
8
Heres a few comments about building OpenSSL in Windows environments. Most
9
of this is tested on Win32 but it may also work in Win 3.1 with some
12
You need Perl for Win32. Unless you will build on Cygwin, you will need
13
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
15
and one of the following C compilers:
8
Here are a few comments about building OpenSSL for Win32 environments,
9
such as Windows NT and Windows 9x. It should be noted though that
10
Windows 9x are not ordinarily tested. Its mention merely means that we
11
attempt to maintain certain programming discipline and pay attention
12
to backward compatibility issues, in other words it's kind of expected
13
to work on Windows 9x, but no regression tests are actually performed.
15
On additional note newer OpenSSL versions are compiled and linked with
16
Winsock 2. This means that minimum OS requirement was elevated to NT 4
17
and Windows 98 [there is Winsock 2 update for Windows 95 though].
19
- you need Perl for Win32. Unless you will build on Cygwin, you will need
20
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
22
- one of the following C compilers:
19
26
* GNU C (Cygwin or MinGW)
28
- Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/
29
is required if you intend to utilize assembler modules. Note that NASM
30
is now the only supported assembler.
21
32
If you are compiling from a tarball or a CVS snapshot then the Win32 files
22
33
may well be not up to date. This may mean that some "tweaking" is required to
23
34
get it all to work. See the trouble shooting section later on for if (when?)
29
If you want to compile in the assembly language routines with Visual C++ then
30
you will need an assembler. This is worth doing because it will result in
31
faster code: for example it will typically result in a 2 times speedup in the
32
RSA routines. Currently the following assemblers are supported:
34
* Microsoft MASM (aka "ml")
35
* Free Netwide Assembler NASM.
37
MASM is distributed with most versions of VC++. For the versions where it is
38
not included in VC++, it is also distributed with some Microsoft DDKs, for
39
example the Windows NT 4.0 DDK and the Windows 98 DDK. If you do not have
40
either of these DDKs then you can just download the binaries for the Windows
41
98 DDK and extract and rename the two files XXXXXml.exe and XXXXXml.err, to
42
ml.exe and ml.err and install somewhere on your PATH. Both DDKs can be
43
downloaded from the Microsoft developers site www.msdn.com.
45
NASM is freely available. Version 0.98 was used during testing: other versions
46
may also work. It is available from many places, see for example:
47
http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
48
The NASM binary nasmw.exe needs to be installed anywhere on your PATH.
50
Firstly you should run Configure:
52
> perl Configure VC-WIN32 --prefix=c:/some/openssl/dir
54
Where the prefix argument specifies where OpenSSL will be installed to.
56
Next you need to build the Makefiles and optionally the assembly language
59
- If you are using MASM then run:
40
If you want to compile in the assembly language routines with Visual
41
C++, then you will need already mentioned Netwide Assembler binary,
42
nasmw.exe or nasm.exe, to be available on your %PATH%.
44
Firstly you should run Configure with platform VC-WIN32:
46
> perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
48
Where the prefix argument specifies where OpenSSL will be installed to.
50
Next you need to build the Makefiles and optionally the assembly
63
53
- If you are using NASM then run:
77
68
> nmake -f ms\ntdll.mak
79
If all is well it should compile and you will have some DLLs and executables
80
in out32dll. If you want to try the tests then do:
70
If all is well it should compile and you will have some DLLs and
71
executables in out32dll. If you want to try the tests then do:
82
73
> nmake -f ms\ntdll.mak test
85
To install OpenSSL to the specified location do:
76
To install OpenSSL to the specified location do:
87
> nmake -f ms\ntdll.mak install
78
> nmake -f ms\ntdll.mak install
91
There are various changes you can make to the Win32 compile environment. By
92
default the library is not compiled with debugging symbols. If you add 'debug'
93
to the mk1mf.pl lines in the do_* batch file then debugging symbols will be
94
compiled in. Note that mk1mf.pl expects the platform to be the last argument
95
on the command line, so 'debug' must appear before that, as all other options.
98
By default in 0.9.8 OpenSSL will compile builtin ENGINES into the libeay32.dll
99
shared library. If you specify the "no-static-engine" option on the command
100
line to Configure the shared library build (ms\ntdll.mak) will compile the
101
engines as separate DLLs.
82
There are various changes you can make to the Win32 compile
83
environment. By default the library is not compiled with debugging
84
symbols. If you use the platform debug-VC-WIN32 instead of VC-WIN32
85
then debugging symbols will be compiled in.
87
By default in 1.0.0 OpenSSL will compile builtin ENGINES into the
88
separate shared librariesy. If you specify the "enable-static-engine"
89
option on the command line to Configure the shared library build
90
(ms\ntdll.mak) will compile the engines into libeay32.dll instead.
103
92
The default Win32 environment is to leave out any Windows NT specific
106
If you want to enable the NT specific features of OpenSSL (currently only the
107
logging BIO) follow the instructions above but call the batch file do_nt.bat
108
instead of do_ms.bat.
95
If you want to enable the NT specific features of OpenSSL (currently
96
only the logging BIO) follow the instructions above but call the batch
97
file do_nt.bat instead of do_ms.bat.
110
99
You can also build a static version of the library using the Makefile
115
103
Borland C++ builder 5
116
104
---------------------
140
Cygwin provides a bash shell and GNU tools environment running
141
on NT 4.0, Windows 9x, Windows ME, Windows 2000, and Windows XP.
142
Consequently, a make of OpenSSL with Cygwin is closer to a GNU
143
bash environment such as Linux than to other the other Win32
146
Cygwin implements a Posix/Unix runtime system (cygwin1.dll).
147
It is also possible to create Win32 binaries that only use the
148
Microsoft C runtime system (msvcrt.dll or crtdll.dll) using
149
MinGW. MinGW can be used in the Cygwin development environment
150
or in a standalone setup as described in the following section.
128
Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of
129
Win32 subsystem and provides a bash shell and GNU tools environment.
130
Consequently, a make of OpenSSL with Cygwin is virtually identical to
131
Unix procedure. It is also possible to create Win32 binaries that only
132
use the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using
133
MinGW. MinGW can be used in the Cygwin development environment or in a
134
standalone setup as described in the following section.
152
136
To build OpenSSL using Cygwin:
192
176
non-fatal error in "make test" but is otherwise harmless. If
193
177
desired and needed, GNU bc can be built with Cygwin without change.
198
* Compiler installation:
200
MinGW is available from http://www.mingw.org. Run the installer and
201
set the MinGW bin directory to the PATH in "System Properties" or
182
* Compiler and shell environment installation:
184
MinGW and MSYS are available from http://www.mingw.org/, both are
185
required. Run the installers and do whatever magic they say it takes
186
to start MSYS bash shell with GNU tools on its PATH.
188
N.B. Since source tar-ball can contain symbolic links, it's essential
189
that you use accompanying MSYS tar to unpack the source. It will
190
either handle them in one way or another or fail to extract them,
191
which does the trick too. Latter means that you may safely ignore all
192
"cannot create symlink" messages, as they will be "re-created" at
193
configure stage by copying corresponding files. Alternative programs
194
were observed to create empty files instead, which results in build
204
197
* Compile OpenSSL:
208
This will create the library and binaries in out. In case any problems
205
This will create the library and binaries in root source directory
206
and openssl.exe application in apps directory.
208
It is also possible to cross-compile it on Linux by configuring
209
with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'.
210
'make test' is naturally not applicable then.
213
212
libcrypto.a and libssl.a are the static libraries. To use the DLLs,
214
213
link with libeay32.a and libssl32.a instead.
216
See troubleshooting if you get error messages about functions not having
219
* You can now try the tests:
215
See troubleshooting if you get error messages about functions not
216
having a number assigned.
308
301
If you link with static OpenSSL libraries [those built with ms/nt.mak],
309
302
then you're expected to additionally link your application with
310
WSOCK32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing
303
WS2_32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing
311
304
non-interactive service applications might feel concerned about linking
312
with latter two, as they are justly associated with interactive desktop,
313
which is not available to service processes. The toolkit is designed
314
to detect in which context it's currently executed, GUI, console app
315
or service, and act accordingly, namely whether or not to actually make
305
with the latter two, as they are justly associated with interactive
306
desktop, which is not available to service processes. The toolkit is
307
designed to detect in which context it's currently executed, GUI,
308
console app or service, and act accordingly, namely whether or not to
309
actually make GUI calls. Additionally those who wish to
310
/DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and actually keep them
311
off service process should consider implementing and exporting from
312
.exe image in question own _OPENSSL_isservice not relying on USER32.DLL.
313
E.g., on Windows Vista and later you could:
315
__declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
317
if (ProcessIdToSessionId(GetCurrentProcessId(),&sess))
318
322
If you link with OpenSSL .DLLs, then you're expected to include into
319
323
your application code small "shim" snippet, which provides glue between