Comment changed.
[openssl.git] / INSTALL
1
2  INSTALLATION ON THE UNIX PLATFORM
3  ---------------------------------
4
5  [For instructions for compiling OpenSSL on Windows systems, see INSTALL.W32].
6
7  To install OpenSSL, you will need:
8
9   * Perl 5
10   * ANSI C compiler
11   * a supported Unix operating system
12
13  Quick Start
14  -----------
15
16  If you want to just get on with it, do:
17
18   $ ./config                  [if this fails, go to step 1b below]
19   $ make
20   $ make rehash
21   $ make test
22   $ make install
23
24  This will build and install OpenSSL in the default location, which is (for
25  historical reasons) /usr/local/ssl. If you want to install it anywhere else,
26  run config like this:
27
28   $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
29
30  There are several options to ./config to customize the build:
31
32   --prefix=DIR  Install in DIR/bin, DIR/lib, DIR/include. Configuration
33                 files used by OpenSSL will be in DIR/ssl or the directory
34                 specified by --openssldir.
35
36   --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
37                 the library files and binaries are also installed there.
38
39   rsaref        Build with RSADSI's RSAREF toolkit.
40
41   no-asm        Build with no assembler code.
42
43   386           Use the 80386 instruction set only (the default x86 code is
44                 more efficient, but requires at least a 486).
45
46  If anything goes wrong, follow the detailed instructions below. If your
47  operating system is not (yet) supported by OpenSSL, see the section on
48  porting to a new system.
49
50  Installation in Detail
51  ----------------------
52
53  1a. Configure OpenSSL for your operation system automatically:
54
55        $ ./config
56
57      This guesses at your operating system (and compiler, if necessary) and
58      configures OpenSSL based on this guess. Run ./config -t -v to see
59      if it guessed correctly. If it did not get it correct or you want to
60      use a different compiler then go to step 1b. Otherwise go to step 2.
61
62  1b. Configure OpenSSL for your operating system manually
63
64      OpenSSL knows about a range of different operating system, hardware and
65      compiler combinations. To see the ones it knows about, run
66
67        $ ./Configure
68
69      Pick a suitable name from the list that matches your system. For most
70      operating systems there is a choice between using "cc" or "gcc".  When
71      you have identified your system (and if necessary compiler) use this name
72      as the argument to ./Configure. For example, a "linux-elf" user would
73      run:
74
75        $ ./Configure linux-elf [--prefix=DIR] [--openssldir=OPENSSLDIR]
76
77      If your system is not available, you will have to edit the Configure
78      program and add the correct configuration for your system.
79
80      Configure creates the Makefile.ssl from Makefile.org and defines
81      various macros in crypto/opensslconf.h (generated from
82      crypto/opensslconf.h.in).
83
84   2. Build OpenSSL by running:
85
86        $ make
87
88      This will build the OpenSSL libraries (libcrypto.a and libssl.a) and the
89      OpenSSL binary ("openssl"). The libraries will be built in the top-level
90      directory, and the binary will be in the "apps" directory.
91
92   3. After a successful build, the libraries should be tested. Run:
93
94        $ make rehash
95        $ make test
96
97      (The first line makes the test certificates in the "certs" directory
98      accessable via an hash name, which is required for some of the tests).
99
100   4. If everything tests ok, install OpenSSL with
101
102        $ make install
103
104      This will create the installation directory (if it does not exist) and
105      then create the following subdirectories:
106
107        certs           Initially empty, this is the default location
108                        for certificate files.
109        private         Initially empty, this is the default location
110                        for private key files.
111        lib             Contains the OpenSSL configuration file "openssl.cnf".
112
113      If you didn't chose a different installation prefix, lib also contains
114      the library files themselves, and the following additional subdirectories
115      will be created:
116
117        bin             Contains the openssl binary and a few other 
118                        utility programs. 
119        include/openssl Contains the header files needed if you want to
120                        compile programs with libcrypto or libssl.
121
122   NOTE: The header files used to reside directly in the include
123   directory, but have now been moved to include/openssl so that
124   OpenSSL can co-exist with other libraries which use some of the
125   same filenames.  This means that applications that use OpenSSL
126   should now use C preprocessor directives of the form
127
128        #include <openssl/ssl.h>
129
130   instead of "#include <ssl.h>", which was used with library versions
131   up to OpenSSL 0.9.2b.
132
133   If you install a new version of OpenSSL over an old library version,
134   you should delete the old header files in the include directory.
135
136   Compatibility issues:
137
138   *  COMPILING existing applications
139
140      To compile an application that uses old filenames -- e.g.
141      "#include <ssl.h>" --, it will usually be enough to find
142      the CFLAGS definition in the application's Makefile and
143      add a C option such as
144
145           -I/usr/local/ssl/include/openssl
146
147      to it.
148
149      But don't delete the existing -I option that points to
150      the ..../include directory!  Otherwise, OpenSSL header files
151      could not #include each other.
152
153   *  WRITING applications
154
155      To write an application that is able to handle both the new
156      and the old directory layout, so that it can still be compiled
157      with library versions up to OpenSSL 0.9.2b without bothering
158      the user, you can proceed as follows:
159
160      -  Always use the new filename of OpenSSL header files,
161         e.g. #include <openssl/ssl.h>.
162
163      -  Create a directory "incl" that contains only a symbolic
164         link named "openssl", which points to the "include" directory
165         of OpenSSL.
166         For example, your application's Makefile might contain the
167         following rule, if OPENSSLDIR is a pathname (absolute or
168         relative) of the directory where OpenSSL resides:
169
170         incl/openssl:
171                 -mkdir incl
172                 cd $(OPENSSLDIR) # Check whether the directory really exists
173                 -ln -s `cd $(OPENSSLDIR); pwd`/include incl/openssl
174
175         You will have to add "incl/openssl" to the dependencies
176         of those C files that include some OpenSSL header file.
177
178      -  Add "-Iincl" to your CFLAGS.
179
180      With these additions, the OpenSSL header files will be available
181      under both name variants if an old library version is used:
182      Your application can reach them under names like <openssl/foo.h>,
183      while the header files still are able to #include each other
184      with names of the form <foo.h>.
185
186
187
188 --------------------------------------------------------------------------------
189 The orignal Unix build instructions from SSLeay follow. 
190 Note: some of this may be out of date and no longer applicable
191 --------------------------------------------------------------------------------
192
193 # When bringing the SSLeay distribution back from the evil intel world
194 # of Windows NT, do the following to make it nice again under unix :-)
195 # You don't normally need to run this.
196 sh util/fixNT.sh        # This only works for NT now - eay - 21-Jun-1996
197
198 # If you have perl, and it is not in /usr/local/bin, you can run
199 perl util/perlpath.pl /new/path
200 # and this will fix the paths in all the scripts.  DO NOT put
201 # /new/path/perl, just /new/path. The build
202 # environment always run scripts as 'perl perlscript.pl' but some of the
203 # 'applications' are easier to usr with the path fixed.
204
205 # Edit crypto/cryptlib.h, tools/c_rehash, and Makefile.ssl
206 # to set the install locations if you don't like
207 # the default location of /usr/local/ssl
208 # Do this by running
209 perl util/ssldir.pl /new/ssl/home
210 # if you have perl, or by hand if not.
211
212 # If things have been stuffed up with the sym links, run
213 make -f Makefile.ssl links
214 # This will re-populate lib/include with symlinks and for each
215 # directory, link Makefile to Makefile.ssl
216
217 # Setup the machine dependent stuff for the top level makefile
218 # and some select .h files
219 # If you don't have perl, this will bomb, in which case just edit the
220 # top level Makefile.ssl
221 ./Configure 'system type'
222
223 # The 'Configure' command contains default configuration parameters
224 # for lots of machines.  Configure edits 5 lines in the top level Makefile
225 # It modifies the following values in the following files
226 Makefile.ssl            CC CFLAG EX_LIBS BN_MULW
227 crypto/des/des.h        DES_LONG
228 crypto/des/des_locl.h   DES_PTR
229 crypto/md2/md2.h        MD2_INT
230 crypto/rc4/rc4.h        RC4_INT
231 crypto/rc4/rc4_enc.c    RC4_INDEX
232 crypto/rc2/rc2.h        RC2_INT
233 crypto/bf/bf_locl.h     BF_INT
234 crypto/idea/idea.h      IDEA_INT
235 crypto/bn/bn.h          BN_LLONG (and defines one of SIXTY_FOUR_BIT,
236                                   SIXTY_FOUR_BIT_LONG, THIRTY_TWO_BIT,
237                                   SIXTEEN_BIT or EIGHT_BIT)
238 Please remember that all these files are actually copies of the file with
239 a .org extention.  So if you change crypto/des/des.h, the next time
240 you run Configure, it will be runover by a 'configured' version of
241 crypto/des/des.org.  So to make the changer the default, change the .org
242 files.  The reason these files have to be edited is because most of
243 these modifications change the size of fundamental data types.
244 While in theory this stuff is optional, it often makes a big
245 difference in performance and when using assember, it is importaint
246 for the 'Bignum bits' match those required by the assember code.
247 A warning for people using gcc with sparc cpu's.  Gcc needs the -mv8
248 flag to use the hardware multiply instruction which was not present in
249 earlier versions of the sparc CPU.  I define it by default.  If you
250 have an old sparc, and it crashes, try rebuilding with this flag
251 removed.  I am leaving this flag on by default because it makes
252 things run 4 times faster :-)
253
254 # clean out all the old stuff
255 make clean
256
257 # Do a make depend only if you have the makedepend command installed
258 # This is not needed but it does make things nice when developing.
259 make depend
260
261 # make should build everything
262 make
263
264 # fix up the demo certificate hash directory if it has been stuffed up.
265 make rehash
266
267 # test everything
268 make test
269
270 # install the lot
271 make install
272
273 # It is worth noting that all the applications are built into the one
274 # program, ssleay, which is then has links from the other programs
275 # names to it.
276 # The applicatons can be built by themselves, just don't define the
277 # 'MONOLITH' flag.  So to build the 'enc' program stand alone,
278 gcc -O2 -Iinclude apps/enc.c apps/apps.c libcrypto.a
279
280 # Other useful make options are
281 make makefile.one
282 # which generate a 'makefile.one' file which will build the complete
283 # SSLeay distribution with temp. files in './tmp' and 'installable' files
284 # in './out'
285
286 # Have a look at running
287 perl util/mk1mf.pl help
288 # this can be used to generate a single makefile and is about the only
289 # way to generate makefiles for windows.
290
291 # There is actually a final way of building SSLeay.
292 gcc -O2 -c -Icrypto -Iinclude crypto/crypto.c
293 gcc -O2 -c -Issl -Iinclude ssl/ssl.c
294 # and you now have the 2 libraries as single object files :-).
295 # If you want to use the assember code for your particular platform
296 # (DEC alpha/x86 are the main ones, the other assember is just the
297 # output from gcc) you will need to link the assember with the above generated
298 # object file and also do the above compile as
299 gcc -O2 -DBN_ASM -c -Icrypto -Iinclude crypto/crypto.c
300
301 This last option is probably the best way to go when porting to another
302 platform or building shared libraries.  It is not good for development so
303 I don't normally use it.
304
305 To build shared libararies under unix, have a look in shlib, basically 
306 you are on your own, but it is quite easy and all you have to do
307 is compile 2 (or 3) files.
308
309 For mult-threading, have a read of doc/threads.doc.  Again it is quite
310 easy and normally only requires some extra callbacks to be defined
311 by the application.
312 The examples for solaris and windows NT/95 are in the mt directory.
313
314 have fun
315
316 eric 25-Jun-1997
317
318 IRIX 5.x will build as a 32 bit system with mips1 assember.
319 IRIX 6.x will build as a 64 bit system with mips3 assember.  It conforms
320 to n32 standards. In theory you can compile the 64 bit assember under
321 IRIX 5.x but you will have to have the correct system software installed.