diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-09-17 12:55:05 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-09-17 12:55:05 +0000 |
commit | 256d36fb49a1aebcea8d63dbb65f3597ddc2cb3c (patch) | |
tree | d88da4626c5a05d1665f79c2f8b30826c341a6ee /pjsip-apps/src | |
parent | 3958e2dbefc4f2db0b17de30ccff2bfa4d78f741 (diff) |
Fixed broken Python module build script
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1437 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/py_pjsua/helper.mak | 17 | ||||
-rw-r--r-- | pjsip-apps/src/py_pjsua/setup.py | 56 |
2 files changed, 39 insertions, 34 deletions
diff --git a/pjsip-apps/src/py_pjsua/helper.mak b/pjsip-apps/src/py_pjsua/helper.mak new file mode 100644 index 00000000..b4acce61 --- /dev/null +++ b/pjsip-apps/src/py_pjsua/helper.mak @@ -0,0 +1,17 @@ +include ../../../build.mak + +lib_dir: + @for token in `echo $(APP_LDFLAGS)`; do \ + echo $$token | grep L | sed 's/-L//'; \ + done + +inc_dir: + @for token in `echo $(APP_CFLAGS)`; do \ + echo $$token | grep I | sed 's/-I//'; \ + done + +libs: + @for token in `echo $(APP_LDLIBS)`; do \ + echo $$token | grep \\-l | sed 's/-l//'; \ + done + diff --git a/pjsip-apps/src/py_pjsua/setup.py b/pjsip-apps/src/py_pjsua/setup.py index c7c50338..590159c7 100644 --- a/pjsip-apps/src/py_pjsua/setup.py +++ b/pjsip-apps/src/py_pjsua/setup.py @@ -1,45 +1,33 @@ from distutils.core import setup, Extension import os -pjproject = "../../../" +# Fill in pj_inc_dirs +pj_inc_dirs = [] +f = os.popen("make -f helper.mak inc_dir") +for line in f: + pj_inc_dirs.append(line.rstrip("\r\n")) +f.close() -# Determine target -#target = "i686-pc-linux-gnu" -f = os.popen("grep TARGET_NAME ../../../build.mak") -line = f.readline() -tokens = line.split() -found = 0 -for token in tokens: - if token == ":=" or token == "=": - found = 1 - elif found != 0: - target = token - break +# Fill in pj_lib_dirs +pj_lib_dirs = [] +f = os.popen("make -f helper.mak lib_dir") +for line in f: + pj_lib_dirs.append(line.rstrip("\r\n")) +f.close() -print "Building py_pjsua module for " + target +# Fill in pj_libs +pj_libs = [] +f = os.popen("make -f helper.mak libs") +for line in f: + pj_libs.append(line.rstrip("\r\n")) +f.close() -setup(name="py_pjsua", version="0.1", +setup(name="py_pjsua", version="0.7", ext_modules = [ Extension("py_pjsua", ["py_pjsua.c"], - include_dirs=[pjproject + "pjsip/include", - pjproject + "pjlib/include", - pjproject + "pjlib-util/include", pjproject + "pjmedia/include"], - library_dirs=[pjproject + "pjsip/lib", - pjproject + "pjlib/lib", - pjproject + "pjmedia/lib", - pjproject + "pjlib-util/lib"], - libraries=[ "pjsua-" + target, - "pjsip-ua-" + target, - "pjsip-simple-" + target, - "pjsip-" + target, - "pjmedia-codec-" + target, - "pjmedia-" + target, - "pjmedia-codec-" + target, - "pjlib-util-" + target, - "pj-" + target, - "ssl", - "crypto", - "asound"]), + include_dirs=pj_inc_dirs, + library_dirs=pj_lib_dirs, + libraries=pj_libs), ]) |