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