Document the new way of building with Borland Builder.
[openssl.git] / INSTALL
1
2  INSTALLATION ON THE UNIX PLATFORM
3  ---------------------------------
4
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.]
9
10  To install OpenSSL, you will need:
11
12   * make
13   * Perl 5
14   * an ANSI C compiler
15   * a development environment in form of development libraries and C
16     header files
17   * a supported Unix operating system
18
19  Quick Start
20  -----------
21
22  If you want to just get on with it, do:
23
24   $ ./config
25   $ make
26   $ make test
27   $ make install
28
29  [If any of these steps fails, see section Installation in Detail below.]
30
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,
33  run config like this:
34
35   $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
36
37
38  Configuration Options
39  ---------------------
40
41  There are several options to ./config (or ./Configure) to customize
42  the build:
43
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.
47
48   --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
49                 the library files and binaries are also installed there.
50
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
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
65                 of shared libraries is supported.  This is the default choice.
66
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
73   no-asm        Do not use assembler code.
74
75   386           Use the 80386 instruction set only (the default x86 code is
76                 more efficient, but requires at least a 486).
77
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
81                 "make depend".
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
88
89  Installation in Detail
90  ----------------------
91
92  1a. Configure OpenSSL for your operation system automatically:
93
94        $ ./config [options]
95
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.
101
102      On some systems, you can include debugging information as follows:
103
104        $ ./config -d [options]
105
106  1b. Configure OpenSSL for your operating system manually
107
108      OpenSSL knows about a range of different operating system, hardware and
109      compiler combinations. To see the ones it knows about, run
110
111        $ ./Configure
112
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:
118
119        $ ./Configure linux-elf [options]
120
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
124      systems.
125
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).
129
130   2. Build OpenSSL by running:
131
132        $ make
133
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.
137
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.
144
145      [If you encounter assembler error messages, try the "no-asm"
146      configuration option as an immediate fix.]
147
148      Compiling parts of OpenSSL with gcc and others with the system
149      compiler will result in unresolved symbols on some systems.
150
151   3. After a successful build, the libraries should be tested. Run:
152
153        $ make test
154
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
161      "make report".
162
163   4. If everything tests ok, install OpenSSL with
164
165        $ make install
166
167      This will create the installation directory (if it does not exist) and
168      then the following subdirectories:
169
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.
177
178      If you didn't choose a different installation prefix, the
179      following additional subdirectories will be created:
180
181        bin             Contains the openssl binary and a few other 
182                        utility programs. 
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.
186
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
190
191        $ make INSTALL_PREFIX=/tmp/package-root install
192
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.
196
197
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
203
204        #include <openssl/ssl.h>
205
206   instead of "#include <ssl.h>", which was used with library versions
207   up to OpenSSL 0.9.2b.
208
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.
211
212   Compatibility issues:
213
214   *  COMPILING existing applications
215
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
220
221           -I/usr/local/ssl/include/openssl
222
223      to it.
224
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.
228
229   *  WRITING applications
230
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:
235
236      -  Always use the new filename of OpenSSL header files,
237         e.g. #include <openssl/ssl.h>.
238
239      -  Create a directory "incl" that contains only a symbolic
240         link named "openssl", which points to the "include" directory
241         of OpenSSL.
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:
245
246         incl/openssl:
247                 -mkdir incl
248                 cd $(OPENSSLDIR) # Check whether the directory really exists
249                 -ln -s `cd $(OPENSSLDIR); pwd`/include incl/openssl
250
251         You will have to add "incl/openssl" to the dependencies
252         of those C files that include some OpenSSL header file.
253
254      -  Add "-Iincl" to your CFLAGS.
255
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>.
261
262
263  Note on multi-threading
264  -----------------------
265
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
270  necessary).
271
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.)
278
279
280  Note on shared libraries
281  ------------------------
282
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.
287
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.