| 1 |
from distutils.core import setup, Extension |
| 2 |
import os |
| 3 |
import sys |
| 4 |
|
| 5 |
|
| 6 |
pj_inc_dirs = [] |
| 7 |
f = os.popen("make -f helper.mak inc_dir") |
| 8 |
for line in f: |
| 9 |
pj_inc_dirs.append(line.rstrip("\r\n")) |
| 10 |
f.close() |
| 11 |
|
| 12 |
|
| 13 |
pj_lib_dirs = [] |
| 14 |
f = os.popen("make -f helper.mak lib_dir") |
| 15 |
for line in f: |
| 16 |
pj_lib_dirs.append(line.rstrip("\r\n")) |
| 17 |
f.close() |
| 18 |
|
| 19 |
|
| 20 |
pj_libs = [] |
| 21 |
f = os.popen("make -f helper.mak libs") |
| 22 |
for line in f: |
| 23 |
pj_libs.append(line.rstrip("\r\n")) |
| 24 |
f.close() |
| 25 |
|
| 26 |
|
| 27 |
if sys.platform == 'darwin': |
| 28 |
extra_link_args = ["-framework", "CoreFoundation", |
| 29 |
"-framework", "AudioToolbox"] |
| 30 |
else: |
| 31 |
extra_link_args = [] |
| 32 |
|
| 33 |
|
| 34 |
setup(name="py_pjsua", version="0.8", |
| 35 |
ext_modules = [ |
| 36 |
Extension("py_pjsua", |
| 37 |
["py_pjsua.c"], |
| 38 |
define_macros=[('PJ_AUTOCONF', '1'),], |
| 39 |
include_dirs=pj_inc_dirs, |
| 40 |
library_dirs=pj_lib_dirs, |
| 41 |
libraries=pj_libs, |
| 42 |
extra_link_args=extra_link_args), |
| 43 |
]) |
| 44 |
|