1
# $Id: setup.py 4232 2012-08-20 06:01:41Z ming $
5
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
from distutils.core import setup, Extension
32
f = open('../../../version.mak', 'r')
34
if line.find("export PJ_VERSION_MAJOR") != -1:
35
tokens=line.split("=")
37
pj_version_major= tokens[1].strip()
38
elif line.find("export PJ_VERSION_MINOR") != -1:
39
tokens=line.split("=")
41
pj_version_minor= line.split("=")[1].strip()
42
elif line.find("export PJ_VERSION_REV") != -1:
43
tokens=line.split("=")
45
pj_version_rev= line.split("=")[1].strip()
46
elif line.find("export PJ_VERSION_SUFFIX") != -1:
47
tokens=line.split("=")
49
pj_version_suffix= line.split("=")[1].strip()
52
if not pj_version_major:
53
print 'Unable to get PJ_VERSION_MAJOR'
56
pj_version = pj_version_major + "." + pj_version_minor
58
pj_version += "." + pj_version_rev
60
pj_version += "-" + pj_version_suffix
62
#print 'PJ_VERSION = "'+ pj_version + '"'
67
f = os.popen("make -f helper.mak inc_dir")
69
pj_inc_dirs.append(line.rstrip("\r\n"))
74
f = os.popen("make -f helper.mak lib_dir")
76
pj_lib_dirs.append(line.rstrip("\r\n"))
81
f = os.popen("make -f helper.mak libs")
83
pj_libs.append(line.rstrip("\r\n"))
86
# Mac OS X depedencies
87
if platform.system() == 'Darwin':
88
extra_link_args = ["-framework", "CoreFoundation",
89
"-framework", "AudioToolbox"]
90
version = platform.mac_ver()[0].split(".")
91
# OS X Lion (10.7.x) or above support
92
if version[0] == '10' and int(version[1]) >= 7:
93
extra_link_args += ["-framework", "AudioUnit"]
100
description='SIP User Agent Library based on PJSIP',
101
url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial',
102
ext_modules = [Extension("_pjsua",
104
define_macros=[('PJ_AUTOCONF', '1'),],
105
include_dirs=pj_inc_dirs,
106
library_dirs=pj_lib_dirs,
108
extra_link_args=extra_link_args