2 INSTALLATION ON THE UNIX PLATFORM
3 ---------------------------------
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
10 To install OpenSSL, you will need:
15 * a development environment in form of development libraries and C
17 * a supported Unix operating system
22 If you want to just get on with it, do:
29 [If any of these steps fails, see section Installation in Detail below.]
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,
35 $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
41 There are several options to ./config (or ./Configure) to customize
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.
48 --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
49 the library files and binaries are also installed there.
51 no-threads Don't try to build with support for multi-threaded
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.
58 no-zlib Don't try to build with support for zlib compression and
61 zlib Build with support for zlib compression/decompression.
63 zlib-dynamic Like "zlib", but has OpenSSL load the zlib library dynamically
64 when needed. This is only supported on systems where loading
65 of shared libraries is supported. This is the default choice.
67 no-shared Don't try to create shared libraries.
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.
73 no-asm Do not use assembler code.
75 386 Use the 80386 instruction set only (the default x86 code is
76 more efficient, but requires at least a 486).
78 no-<cipher> Build without the specified cipher (bf, cast, des, dh, dsa,
79 hmac, md2, md5, mdc2, rc2, rc4, rc5, rsa, sha).
80 The crypto/<cipher> directory can be removed after running
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.
89 Installation in Detail
90 ----------------------
92 1a. Configure OpenSSL for your operation system automatically:
96 This guesses at your operating system (and compiler, if necessary) and
97 configures OpenSSL based on this guess. Run ./config -t to see
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.
102 On some systems, you can include debugging information as follows:
104 $ ./config -d [options]
106 1b. Configure OpenSSL for your operating system manually
108 OpenSSL knows about a range of different operating system, hardware and
109 compiler combinations. To see the ones it knows about, run
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
119 $ ./Configure linux-elf [options]
121 If your system is not available, you will have to edit the Configure
122 program and add the correct configuration for your system. The
123 generic configurations "cc" or "gcc" should usually work on 32 bit
126 Configure creates the file Makefile.ssl from Makefile.org and
127 defines various macros in crypto/opensslconf.h (generated from
128 crypto/opensslconf.h.in).
130 2. Build OpenSSL by running:
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.
138 If "make" fails, look at the output. There may be reasons for
139 the failure that aren't problems in OpenSSL itself (like missing
140 standard headers). If it is a problem with OpenSSL itself, please
141 report the problem to <openssl-bugs@openssl.org> (note that your
142 message will be forwarded to a public mailing list). Include the
143 output of "make report" in your message.
145 [If you encounter assembler error messages, try the "no-asm"
146 configuration option as an immediate fix.]
148 Compiling parts of OpenSSL with gcc and others with the system
149 compiler will result in unresolved symbols on some systems.
151 3. After a successful build, the libraries should be tested. Run:
155 If a test fails, look at the output. There may be reasons for
156 the failure that isn't a problem in OpenSSL itself (like a missing
157 or malfunctioning bc). If it is a problem with OpenSSL itself,
158 try removing any compiler optimization flags from the CFLAGS line
159 in Makefile.ssl and run "make clean; make". Please send a bug
160 report to <openssl-bugs@openssl.org>, including the output of
163 4. If everything tests ok, install OpenSSL with
167 This will create the installation directory (if it does not exist) and
168 then the following subdirectories:
170 certs Initially empty, this is the default location
171 for certificate files.
172 man/man1 Manual pages for the 'openssl' command line tool
173 man/man3 Manual pages for the libraries (very incomplete)
174 misc Various scripts.
175 private Initially empty, this is the default location
176 for private key files.
178 If you didn't choose a different installation prefix, the
179 following additional subdirectories will be created:
181 bin Contains the openssl binary and a few other
183 include/openssl Contains the header files needed if you want to
184 compile programs with libcrypto or libssl.
185 lib Contains the OpenSSL library files themselves.
187 Package builders who want to configure the library for standard
188 locations, but have the package installed somewhere else so that
189 it can easily be packaged, can use
191 $ make INSTALL_PREFIX=/tmp/package-root install
193 (or specify "--install_prefix=/tmp/package-root" as a configure
194 option). The specified prefix will be prepended to all
195 installation target filenames.
198 NOTE: The header files used to reside directly in the include
199 directory, but have now been moved to include/openssl so that
200 OpenSSL can co-exist with other libraries which use some of the
201 same filenames. This means that applications that use OpenSSL
202 should now use C preprocessor directives of the form
204 #include <openssl/ssl.h>
206 instead of "#include <ssl.h>", which was used with library versions
207 up to OpenSSL 0.9.2b.
209 If you install a new version of OpenSSL over an old library version,
210 you should delete the old header files in the include directory.
212 Compatibility issues:
214 * COMPILING existing applications
216 To compile an application that uses old filenames -- e.g.
217 "#include <ssl.h>" --, it will usually be enough to find
218 the CFLAGS definition in the application's Makefile and
219 add a C option such as
221 -I/usr/local/ssl/include/openssl
225 But don't delete the existing -I option that points to
226 the ..../include directory! Otherwise, OpenSSL header files
227 could not #include each other.
229 * WRITING applications
231 To write an application that is able to handle both the new
232 and the old directory layout, so that it can still be compiled
233 with library versions up to OpenSSL 0.9.2b without bothering
234 the user, you can proceed as follows:
236 - Always use the new filename of OpenSSL header files,
237 e.g. #include <openssl/ssl.h>.
239 - Create a directory "incl" that contains only a symbolic
240 link named "openssl", which points to the "include" directory
242 For example, your application's Makefile might contain the
243 following rule, if OPENSSLDIR is a pathname (absolute or
244 relative) of the directory where OpenSSL resides:
248 cd $(OPENSSLDIR) # Check whether the directory really exists
249 -ln -s `cd $(OPENSSLDIR); pwd`/include incl/openssl
251 You will have to add "incl/openssl" to the dependencies
252 of those C files that include some OpenSSL header file.
254 - Add "-Iincl" to your CFLAGS.
256 With these additions, the OpenSSL header files will be available
257 under both name variants if an old library version is used:
258 Your application can reach them under names like <openssl/foo.h>,
259 while the header files still are able to #include each other
260 with names of the form <foo.h>.
263 Note on multi-threading
264 -----------------------
266 For some systems, the OpenSSL Configure script knows what compiler options
267 are needed to generate a library that is suitable for multi-threaded
268 applications. On these systems, support for multi-threading is enabled
269 by default; use the "no-threads" option to disable (this should never be
272 On other systems, to enable support for multi-threading, you will have
273 to specify at least two options: "threads", and a system-dependent option.
274 (The latter is "-D_REENTRANT" on various systems.) The default in this
275 case, obviously, is not to include support for multi-threading (but
276 you can still use "no-threads" to suppress an annoying warning message
277 from the Configure script.)
280 Note on shared libraries
281 ------------------------
283 Shared library is currently an experimental feature. The only reason to
284 have them would be to conserve memory on systems where several program
285 are using OpenSSL. Binary backward compatibility can't be guaranteed
286 before OpenSSL version 1.0.
288 For some systems, the OpenSSL Configure script knows what is needed to
289 build shared libraries for libcrypto and libssl. On these systems,
290 the shared libraries are currently not created by default, but giving
291 the option "shared" will get them created. This method supports Makefile
292 targets for shared library creation, like linux-shared. Those targets
293 can currently be used on their own just as well, but this is expected
294 to change in future versions of OpenSSL.