source: TI12-security/branches/Dependencies/m2crypto/INSTALL @ 2172

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/branches/Dependencies/m2crypto/INSTALL@2237
Revision 2172, 3.3 KB checked in by pjkersha, 13 years ago (diff)
Line 
1====================
2 Installing M2Crypto
3====================
4
5:Maintainer: Heikki Toivonen
6:Web-Site: http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto
7
8.. contents::
9
10
11Pre-requisites
12----------------
13
14The following software packages are pre-requisites:
15
16- **Python 2.3 or newer**
17- **OpenSSL 0.9.7 or newer**
18- **SWIG 1.3.24 or newer**
19
20
21Installing on Unix-like systems, including Cygwin
22-------------------------------------------------
23
24::
25
26    $ tar zxf m2crypto-0.16.tar.gz
27    $ cd m2crypto-0.16
28    $ python setup.py build
29    $ python setup.py install
30    $ cd tests
31    $ python alltests.py
32
33This assumes OpenSSL is installed in /usr. You can provide an alternate
34OpenSSL prefix location with --openssl option to build command. Other
35commands accept standard options if you need them.
36
37
38Differences when installing on Windows
39--------------------------------------
40
41Before building from source, you need to install OpenSSL's include files,
42import libraries and DLLs. By default setup.py assumes that OpenSSL include
43files are in ``c:\pkg\openssl\include``, and the import libraries
44in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
45OpenSSL location with --openssl option.
46
47
48MSVC++
49~~~~~~~~
50
51setup.py is already configured to work with MSVC++ by default.
52
53With MSVC++, the OpenSSL DLLs, as built, are named ``libeay32.dll``
54and ``ssleay32.dll``. Install these somewhere on your PATH; for example
55in ``c:\bin``, together with ``openssl.exe``.
56
57For MSVC++, the import libraries, as built by OpenSSL, are named
58``libeay32.lib`` and ``ssleay32.lib``.
59
60
61MINGW
62~~~~~~~
63
64.. NOTE::
65   The following instructions for building M2Crypto with MINGW are from
66   M2Crypto 0.12. These instructions should continue to work for this release,
67   although I have not tested them.
68
69Read Sebastien Sauvage's webpage:
70
71     http://sebsauvage.net/python/mingw.html
72
73For mingw32, the OpenSSL import libraries are named ``libeay32.a`` and
74``libssl32.a``. You may need to edit setup.py file for these.
75
76You'll also need to create ``libpython2[123].a``, depending on your version
77of Python.
78
79OpenSSL DLLs for mingw32 are named ``libeay32.dll`` and ``libssl32.dll``.
80Install these somewhere on your PATH; for example in
81``c:\bin``, together with ``openssl.exe``.
82
83Build M2Crypto:
84
85    python setup.py build -cmingw32
86    python setup.py install
87    cd tests
88    python alltests.py
89
90
91BC++
92~~~~~~
93
94.. NOTE::
95   The following instructions for building M2Crypto with MSVC++ 6.0 and
96   BC++ 5.5 free compiler suite are from M2Crypto 0.10. These instructions
97   should continue to work for this release, although I have not tested
98   them.
99
100For BC++ these files are created from the MSVC++-built ones using the
101tool ``coff2omf.exe``. I call them ``libeay32_bc.lib`` and
102``ssleay32_bc.lib``, respectively. You will need to edit setup.py file
103for these.
104
105You'll also need Python's import library, e.g., ``python22.lib``, to
106be the BC++-compatible version; i.e., create ``python22_bc.lib`` from
107``python22.lib``, save a copy of ``python22.lib`` (as ``python22_vc.lib``,
108say), then rename ``python22_bc.lib`` to ``python22.lib``.
109
110
111Now you are ready to build M2Crypto. Do one of the following::
112
113    python setup.py build
114    python setup.py build -cbcpp
115
116Then,
117
118::
119
120    python setup.py install
121    cd tests
122    python alltests.py
Note: See TracBrowser for help on using the repository browser.