2 INSTALLATION ON THE UNIX PLATFORM
3 ---------------------------------
5 [For instructions for compiling OpenSSL on Windows systems, see INSTALL.W32].
7 To install OpenSSL, you will need:
11 * a supported Unix operating system
16 If you want to just get on with it, do:
18 $ ./config [if this fails, go to step 1b below]
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,
28 $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
30 There are several options to ./config to customize the build:
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.
36 --openssldir=DIR Directory for OpenSSL files. If no prefix is specified,
37 the library files and binaries are also installed there.
39 rsaref Build with RSADSI's RSAREF toolkit.
41 no-asm Build with no assembler code.
43 386 Use the 80386 instruction set only (the default x86 code is
44 more efficient, but requires at least a 486).
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.
50 Installation in Detail
51 ----------------------
53 1a. Configure OpenSSL for your operation system automatically:
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.
62 1b. Configure OpenSSL for your operating system manually
64 OpenSSL knows about a range of different operating system, hardware and
65 compiler combinations. To see the ones it knows about, run
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
75 $ ./Configure linux-elf [--prefix=DIR] [--openssldir=OPENSSLDIR]
77 If your system is not available, you will have to edit the Configure
78 program and add the correct configuration for your system.
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).
84 2. Build OpenSSL by running:
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.
92 3. After a successful build, the libraries should be tested. Run:
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).
100 4. If everything tests ok, install OpenSSL with
104 This will create the installation directory (if it does not exist) and
105 then create the following subdirectories:
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".
113 If you didn't chose a different installation prefix, lib also contains
114 the library files themselves, and the following additional subdirectories
117 bin Contains the openssl binary and a few other
119 include/openssl Contains the header files needed if you want to
120 compile programs with libcrypto or libssl.
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
128 #include <openssl/ssl.h>
130 instead of "#include <ssl.h>", which was used with library versions
131 up to OpenSSL 0.9.2b.
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.
136 Compatibility issues:
138 * COMPILING existing applications
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
145 -I/usr/local/ssl/include/openssl
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.
153 * WRITING applications
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:
160 - Always use the new filename of OpenSSL header files,
161 e.g. #include <openssl/ssl.h>.
163 - Create a directory "incl" that contains only a symbolic
164 link named "openssl", which points to the "include" directory
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:
172 cd $(OPENSSLDIR) # Check whether the directory really exists
173 -ln -s `cd $(OPENSSLDIR); pwd`/include incl/openssl
175 You will have to add "incl/openssl" to the dependencies
176 of those C files that include some OpenSSL header file.
178 - Add "-Iincl" to your CFLAGS.
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>.
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 --------------------------------------------------------------------------------
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
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.
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
209 perl util/ssldir.pl /new/ssl/home
210 # if you have perl, or by hand if not.
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
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'
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 :-)
254 # clean out all the old stuff
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.
261 # make should build everything
264 # fix up the demo certificate hash directory if it has been stuffed up.
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
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
280 # Other useful make options are
282 # which generate a 'makefile.one' file which will build the complete
283 # SSLeay distribution with temp. files in './tmp' and 'installable' files
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.
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
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.
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.
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
312 The examples for solaris and windows NT/95 are in the mt directory.
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.