blob: f5257261fce6030b6dc6d9fe70d95eba9ab4415e [file] [log] [blame]
Jonathan Balletadd44ae2011-07-16 14:39:36 +09001.. _building:
2
3Building and Installing
4=======================
5
Jonathan Balletadd44ae2011-07-16 14:39:36 +09006These instructions can also be found in the file ``INSTALL``.
7
8I have tested this on Debian Linux systems (woody and sid), Solaris 2.6 and
92.7. Others have successfully compiled it on Windows and NT.
10
11.. _building-unix:
12
13Building the Module on a Unix System
14------------------------------------
15
16pyOpenSSL uses distutils, so there really shouldn't be any problems. To build
17the library::
18
19 python setup.py build
20
21If your OpenSSL header files aren't in ``/usr/include``, you may need to supply
22the ``-I`` flag to let the setup script know where to look. The same goes for
23the libraries of course, use the ``-L`` flag. Note that ``build`` won't accept
24these flags, so you have to run first ``build_ext`` and then ``build``!
25Example::
26
27 python setup.py build_ext -I/usr/local/ssl/include -L/usr/local/ssl/lib
28 python setup.py build
29
30Now you should have a directory called ``OpenSSL`` that contains e.g.
31``SSL.so`` and ``__init__.py`` somewhere in the build dicrectory,
32so just::
33
34 python setup.py install
35
36If you, for some arcane reason, don't want the module to appear in the
37``site-packages`` directory, use the ``--prefix`` option.
38
39You can, of course, do::
40
41 python setup.py --help
42
43to find out more about how to use the script.
44
45.. _building-windows:
46
47Building the Module on a Windows System
48---------------------------------------
49
50Big thanks to Itamar Shtull-Trauring and Oleg Orlov for their help with
51Windows build instructions. Same as for Unix systems, we have to separate
52the ``build_ext`` and the ``build``.
53
54Building the library::
55
56 setup.py build_ext -I ...\openssl\inc32 -L ...\openssl\out32dll
57 setup.py build
58
59Where ``...\openssl`` is of course the location of your OpenSSL installation.
60
61Installation is the same as for Unix systems::
62
63 setup.py install
64
65And similarily, you can do::
66
67 setup.py --help
68
69to get more information.