]> git.ipfire.org Git - thirdparty/openssl.git/blame - INSTALL
Force the removal.
[thirdparty/openssl.git] / INSTALL
CommitLineData
79e259e3 1
4109b97c
RE
2 INSTALLATION ON THE UNIX PLATFORM
3 ---------------------------------
79e259e3 4
d5492d9b
RL
5 [Installation on DOS (with djgpp), Windows, OpenVMS and MacOS (before MacOS X)
6 is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.
7 This document describes installation on operating systems in the Unix
8 family.]
4109b97c
RE
9
10 To install OpenSSL, you will need:
79e259e3 11
d57d85ff 12 * make
abb3e53f 13 * Perl 5
73bfb9ad 14 * an ANSI C compiler
d57d85ff
RL
15 * a development environment in form of development libraries and C
16 header files
80611577 17 * a supported Unix operating system
79e259e3 18
4109b97c
RE
19 Quick Start
20 -----------
79e259e3 21
4109b97c 22 If you want to just get on with it, do:
79e259e3 23
b1fe6b43 24 $ ./config
4109b97c 25 $ make
4109b97c
RE
26 $ make test
27 $ make install
79e259e3 28
d872c55c 29 [If any of these steps fails, see section Installation in Detail below.]
b1fe6b43 30
4109b97c
RE
31 This will build and install OpenSSL in the default location, which is (for
32 historical reasons) /usr/local/ssl. If you want to install it anywhere else,
462ba4f6 33 run config like this:
79e259e3 34
462ba4f6 35 $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
79e259e3 36
b1fe6b43
UM
37
38 Configuration Options
39 ---------------------
40
2d99cee7
BM
41 There are several options to ./config (or ./Configure) to customize
42 the build:
2613c1fa 43
b1fe6b43
UM
44 --prefix=DIR Install in DIR/bin, DIR/lib, DIR/include/openssl.
45 Configuration files used by OpenSSL will be in DIR/ssl
46 or the directory specified by --openssldir.
462ba4f6
UM
47
48 --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
49 the library files and binaries are also installed there.
50
5f8d5c96
BM
51 no-threads Don't try to build with support for multi-threaded
52 applications.
53
54 threads Build with support for multi-threaded applications.
55 This will usually require additional system-dependent options!
56 See "Note on multi-threading" below.
57
e452de9d
RL
58 no-zlib Don't try to build with support for zlib compression and
59 decompression.
60
61 zlib Build with support for zlib compression/decompression.
62
63 zlib-dynamic Like "zlib", but has OpenSSL load the zlib library dynamically
64 when needed. This is only supported on systems where loading
f1ca5f5b 65 of shared libraries is supported. This is the default choice.
e452de9d 66
fcc6a1c4
RL
67 no-shared Don't try to create shared libraries.
68
69 shared In addition to the usual static libraries, create shared
70 libraries on platforms where it's supported. See "Note on
71 shared libraries" below.
72
b1fe6b43 73 no-asm Do not use assembler code.
462ba4f6
UM
74
75 386 Use the 80386 instruction set only (the default x86 code is
76 more efficient, but requires at least a 486).
2613c1fa 77
b1fe6b43
UM
78 no-<cipher> Build without the specified cipher (bf, cast, des, dh, dsa,
79 hmac, md2, md5, mdc2, rc2, rc4, rc5, rsa, sha).
92afda6c
UM
80 The crypto/<cipher> directory can be removed after running
81 "make depend".
b1fe6b43
UM
82
83 -Dxxx, -lxxx, -Lxxx, -fxxx, -Kxxx These system specific options will
84 be passed through to the compiler to allow you to
85 define preprocessor symbols, specify additional libraries,
86 library directories or other compiler options.
87
79e259e3 88
4109b97c
RE
89 Installation in Detail
90 ----------------------
c9f06e7f 91
4109b97c 92 1a. Configure OpenSSL for your operation system automatically:
c9f06e7f 93
b1fe6b43 94 $ ./config [options]
c9f06e7f 95
4109b97c 96 This guesses at your operating system (and compiler, if necessary) and
b1fe6b43 97 configures OpenSSL based on this guess. Run ./config -t to see
db209ec2
UM
98 if it guessed correctly. If you want to use a different compiler, you
99 are cross-compiling for another platform, or the ./config guess was
100 wrong for other reasons, go to step 1b. Otherwise go to step 2.
c9f06e7f 101
b1fe6b43
UM
102 On some systems, you can include debugging information as follows:
103
104 $ ./config -d [options]
105
c9f06e7f 106 1b. Configure OpenSSL for your operating system manually
79e259e3 107
4109b97c
RE
108 OpenSSL knows about a range of different operating system, hardware and
109 compiler combinations. To see the ones it knows about, run
79e259e3 110
4109b97c 111 $ ./Configure
79e259e3 112
4109b97c
RE
113 Pick a suitable name from the list that matches your system. For most
114 operating systems there is a choice between using "cc" or "gcc". When
115 you have identified your system (and if necessary compiler) use this name
116 as the argument to ./Configure. For example, a "linux-elf" user would
117 run:
79e259e3 118
b1fe6b43 119 $ ./Configure linux-elf [options]
79e259e3
PS
120
121 If your system is not available, you will have to edit the Configure
73bfb9ad 122 program and add the correct configuration for your system. The
db209ec2
UM
123 generic configurations "cc" or "gcc" should usually work on 32 bit
124 systems.
79e259e3 125
b1fe6b43
UM
126 Configure creates the file Makefile.ssl from Makefile.org and
127 defines various macros in crypto/opensslconf.h (generated from
80611577 128 crypto/opensslconf.h.in).
79e259e3 129
462ba4f6 130 2. Build OpenSSL by running:
79e259e3 131
4109b97c 132 $ make
79e259e3 133
4109b97c
RE
134 This will build the OpenSSL libraries (libcrypto.a and libssl.a) and the
135 OpenSSL binary ("openssl"). The libraries will be built in the top-level
136 directory, and the binary will be in the "apps" directory.
79e259e3 137
a652ffc4 138 If "make" fails, look at the output. There may be reasons for
9020b862 139 the failure that aren't problems in OpenSSL itself (like missing
a652ffc4
RL
140 standard headers). If it is a problem with OpenSSL itself, please
141 report the problem to <openssl-bugs@openssl.org> (note that your
7650934f 142 message will be recorded in the request tracker publicly readable
123e5dfc
LJ
143 via http://www.openssl.org/support/rt2.html and will be forwarded to a
144 public mailing list). Include the output of "make report" in your message.
7650934f
LJ
145 Please check out the request tracker. Maybe the bug was already
146 reported or has already been fixed.
b1fe6b43 147
436a376b 148 [If you encounter assembler error messages, try the "no-asm"
b82ccbb7 149 configuration option as an immediate fix.]
436a376b 150
91174a91
UM
151 Compiling parts of OpenSSL with gcc and others with the system
152 compiler will result in unresolved symbols on some systems.
153
462ba4f6 154 3. After a successful build, the libraries should be tested. Run:
79e259e3 155
4109b97c 156 $ make test
79e259e3 157
a652ffc4
RL
158 If a test fails, look at the output. There may be reasons for
159 the failure that isn't a problem in OpenSSL itself (like a missing
160 or malfunctioning bc). If it is a problem with OpenSSL itself,
161 try removing any compiler optimization flags from the CFLAGS line
162 in Makefile.ssl and run "make clean; make". Please send a bug
163 report to <openssl-bugs@openssl.org>, including the output of
7650934f 164 "make report" in order to be added to the request tracker at
123e5dfc 165 http://www.openssl.org/support/rt2.html.
b1fe6b43 166
462ba4f6 167 4. If everything tests ok, install OpenSSL with
79e259e3 168
4109b97c 169 $ make install
79e259e3 170
4109b97c 171 This will create the installation directory (if it does not exist) and
33d50ef6 172 then the following subdirectories:
79e259e3 173
462ba4f6
UM
174 certs Initially empty, this is the default location
175 for certificate files.
435b72dd
BM
176 man/man1 Manual pages for the 'openssl' command line tool
177 man/man3 Manual pages for the libraries (very incomplete)
7e05db95 178 misc Various scripts.
b1fe6b43
UM
179 private Initially empty, this is the default location
180 for private key files.
462ba4f6 181
f4e723f3 182 If you didn't choose a different installation prefix, the
33d50ef6 183 following additional subdirectories will be created:
79e259e3 184
462ba4f6
UM
185 bin Contains the openssl binary and a few other
186 utility programs.
187 include/openssl Contains the header files needed if you want to
188 compile programs with libcrypto or libssl.
33d50ef6 189 lib Contains the OpenSSL library files themselves.
79e259e3 190
e5f3045f
BM
191 Package builders who want to configure the library for standard
192 locations, but have the package installed somewhere else so that
193 it can easily be packaged, can use
194
195 $ make INSTALL_PREFIX=/tmp/package-root install
196
7e05db95 197 (or specify "--install_prefix=/tmp/package-root" as a configure
e5f3045f
BM
198 option). The specified prefix will be prepended to all
199 installation target filenames.
200
201
4fd53220
BM
202 NOTE: The header files used to reside directly in the include
203 directory, but have now been moved to include/openssl so that
204 OpenSSL can co-exist with other libraries which use some of the
205 same filenames. This means that applications that use OpenSSL
206 should now use C preprocessor directives of the form
207
208 #include <openssl/ssl.h>
209
210 instead of "#include <ssl.h>", which was used with library versions
211 up to OpenSSL 0.9.2b.
212
213 If you install a new version of OpenSSL over an old library version,
214 you should delete the old header files in the include directory.
215
216 Compatibility issues:
217
218 * COMPILING existing applications
219
220 To compile an application that uses old filenames -- e.g.
221 "#include <ssl.h>" --, it will usually be enough to find
222 the CFLAGS definition in the application's Makefile and
223 add a C option such as
224
225 -I/usr/local/ssl/include/openssl
226
227 to it.
228
229 But don't delete the existing -I option that points to
230 the ..../include directory! Otherwise, OpenSSL header files
231 could not #include each other.
232
233 * WRITING applications
234
235 To write an application that is able to handle both the new
236 and the old directory layout, so that it can still be compiled
237 with library versions up to OpenSSL 0.9.2b without bothering
238 the user, you can proceed as follows:
239
240 - Always use the new filename of OpenSSL header files,
241 e.g. #include <openssl/ssl.h>.
242
243 - Create a directory "incl" that contains only a symbolic
244 link named "openssl", which points to the "include" directory
245 of OpenSSL.
246 For example, your application's Makefile might contain the
247 following rule, if OPENSSLDIR is a pathname (absolute or
248 relative) of the directory where OpenSSL resides:
249
250 incl/openssl:
251 -mkdir incl
252 cd $(OPENSSLDIR) # Check whether the directory really exists
253 -ln -s `cd $(OPENSSLDIR); pwd`/include incl/openssl
254
255 You will have to add "incl/openssl" to the dependencies
256 of those C files that include some OpenSSL header file.
257
258 - Add "-Iincl" to your CFLAGS.
259
260 With these additions, the OpenSSL header files will be available
261 under both name variants if an old library version is used:
262 Your application can reach them under names like <openssl/foo.h>,
263 while the header files still are able to #include each other
264 with names of the form <foo.h>.
265
266
5f8d5c96
BM
267 Note on multi-threading
268 -----------------------
269
270 For some systems, the OpenSSL Configure script knows what compiler options
271 are needed to generate a library that is suitable for multi-threaded
272 applications. On these systems, support for multi-threading is enabled
273 by default; use the "no-threads" option to disable (this should never be
274 necessary).
275
276 On other systems, to enable support for multi-threading, you will have
33d50ef6 277 to specify at least two options: "threads", and a system-dependent option.
5f8d5c96
BM
278 (The latter is "-D_REENTRANT" on various systems.) The default in this
279 case, obviously, is not to include support for multi-threading (but
280 you can still use "no-threads" to suppress an annoying warning message
281 from the Configure script.)
282
fcc6a1c4
RL
283
284 Note on shared libraries
285 ------------------------
286
c1c97165
RL
287 Shared library is currently an experimental feature. The only reason to
288 have them would be to conserve memory on systems where several program
289 are using OpenSSL. Binary backward compatibility can't be guaranteed
290 before OpenSSL version 1.0.
291
fcc6a1c4
RL
292 For some systems, the OpenSSL Configure script knows what is needed to
293 build shared libraries for libcrypto and libssl. On these systems,
294 the shared libraries are currently not created by default, but giving
295 the option "shared" will get them created. This method supports Makefile
296 targets for shared library creation, like linux-shared. Those targets
297 can currently be used on their own just as well, but this is expected
298 to change in future versions of OpenSSL.
96c930dd
LJ
299
300 Note on random number generation
301 --------------------------------
302
303 Availability of cryptographically secure random numbers is required for
304 secret key generation. OpenSSL provides several options to seed the
305 internal PRNG. If not properly seeded, the internal PRNG will refuse
306 to deliver random bytes and a "PRNG not seeded error" will occur.
307 On systems without /dev/urandom (or similar) device, it may be necessary
308 to install additional support software to obtain random seed.
309 Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
310 and the FAQ for more information.