summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorHeikki Toivonen <heikki@heikkitoivonen.net>2005-05-13 23:39:07 +0000
committerHeikki Toivonen <heikki@heikkitoivonen.net>2005-05-13 23:39:07 +0000
commit0cd771904396f5d0a1581ae4be177f47f6f44987 (patch)
tree8abb06f01f7facdebb9b1bd1e529e33287166301 /setup.py
parentbc3bdcaed68bb8c46fc6a468f34c2ec50a14082e (diff)
downloadm2crypto-0cd771904396f5d0a1581ae4be177f47f6f44987.tar.gz
Make swig_opts work on pre-2.4 python.
git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@269 2715db39-9adf-0310-9c64-84f055769b4b
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py48
1 files changed, 26 insertions, 22 deletions
diff --git a/setup.py b/setup.py
index d1bb2bb..7d6d25a 100644
--- a/setup.py
+++ b/setup.py
@@ -12,6 +12,29 @@ import os, sys
from distutils.core import setup, Extension
from distutils.command import build_ext
+my_inc = os.path.join(os.getcwd(), 'SWIG')
+
+if os.name == 'nt':
+ openssl_dir = 'c:\\pkg\\openssl'
+ include_dirs = [my_inc, openssl_dir + '/include']
+ swig_opts_str = '-I"' + openssl_dir + os.sep + 'include"'
+ library_dirs = [openssl_dir + '\\lib']
+ libraries = ['ssleay32', 'libeay32']
+
+elif os.name == 'posix':
+ include_dirs = [my_inc, '/usr/include']
+ swig_opts_str = '-I/usr/include'
+ library_dirs = ['/usr/lib']
+ if sys.platform == 'cygwin':
+ # Cygwin SHOULD work (there's code in distutils), but
+ # if one first starts a Windows command prompt, then bash,
+ # the distutils code does not seem to work. If you start
+ # Cygwin directly, then it would work even without this change.
+ # Someday distutils will be fixed and this won't be needed.
+ library_dirs += ['/usr/bin']
+ libraries = ['ssl', 'crypto']
+
+
if sys.version_info < (2,4):
# This copy of swig_sources is from Python 2.2.
@@ -55,6 +78,8 @@ if sys.version_info < (2,4):
if self.swig_cpp:
swig_cmd.append("-c++")
+ swig_cmd.append(swig_opts_str)
+
for source in swig_sources:
target = swig_targets[source]
self.announce("swigging %s to %s" % (source, target))
@@ -64,27 +89,6 @@ if sys.version_info < (2,4):
build_ext.build_ext.swig_sources = swig_sources
-my_inc = os.path.join(os.getcwd(), 'SWIG')
-
-if os.name == 'nt':
- openssl_dir = 'c:\\pkg\\openssl'
- include_dirs = [my_inc, openssl_dir + '/include']
- swig_opts = ['-I"' + openssl_dir + os.sep + 'include"']
- library_dirs = [openssl_dir + '\\lib']
- libraries = ['ssleay32', 'libeay32']
-
-elif os.name == 'posix':
- include_dirs = [my_inc, '/usr/include']
- swig_opts = ['-I/usr/include']
- library_dirs = ['/usr/lib']
- if sys.platform == 'cygwin':
- # Cygwin SHOULD work (there's code in distutils), but
- # if one first starts a Windows command prompt, then bash,
- # the distutils code does not seem to work. If you start
- # Cygwin directly, then it would work even without this change.
- # Someday distutils will be fixed and this won't be needed.
- library_dirs += ['/usr/bin']
- libraries = ['ssl', 'crypto']
m2crypto = Extension(name = '__m2crypto',
sources = ['SWIG/_m2crypto.i'],
@@ -93,7 +97,7 @@ m2crypto = Extension(name = '__m2crypto',
libraries = libraries,
extra_compile_args = ['-DTHREADING',
'-DSWIG_COBJECT_PYTHON'],
- swig_opts = swig_opts
+ swig_opts = [swig_opts_str]
)
setup(name = 'M2Crypto',