summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2014-02-20 08:08:06 +0000
committerNanang Izzuddin <nanang@teluu.com>2014-02-20 08:08:06 +0000
commitffa460e4438968b000f4011b62b2229087aff4ce (patch)
tree567d6d2686fe3df7883134ea3f0c092dd69c2231
parent6442fe1b398f50fb2323cbdd604dba0aa9ab2557 (diff)
Re #1519: Include user.mak build settings in building pjsua app and pjsua2 SWIG Python binding.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4753 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/build/Makefile12
-rw-r--r--pjsip-apps/build/Samples.mak2
-rw-r--r--pjsip-apps/src/swig/python/helper.mak18
-rw-r--r--pjsip-apps/src/swig/python/setup.py39
4 files changed, 23 insertions, 48 deletions
diff --git a/pjsip-apps/build/Makefile b/pjsip-apps/build/Makefile
index 02835d7e..917b1deb 100644
--- a/pjsip-apps/build/Makefile
+++ b/pjsip-apps/build/Makefile
@@ -39,9 +39,9 @@ export PJSUA_SRCDIR = ../src/pjsua
export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
main.o pjsua_app.o pjsua_app_cli.o pjsua_app_common.o \
pjsua_app_config.o pjsua_app_legacy.o
-export PJSUA_CFLAGS += $(PJ_CFLAGS)
-export PJSUA_CXXFLAGS += $(PJ_CXXFLAGS)
-export PJSUA_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS)
+export PJSUA_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
+export PJSUA_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
+export PJSUA_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSUA_EXE:=pjsua-$(TARGET_NAME)$(HOST_EXE)
@@ -51,9 +51,9 @@ export PJSUA_EXE:=pjsua-$(TARGET_NAME)$(HOST_EXE)
export PJSYSTEST_SRCDIR = ../src/pjsystest
export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
systest.o main_console.o
-export PJSYSTEST_CFLAGS += $(PJ_CFLAGS)
-export PJSYSTEST_CXXFLAGS += $(PJ_CXXFLAGS)
-export PJSYSTEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS)
+export PJSYSTEST_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
+export PJSYSTEST_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
+export PJSYSTEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSYSTEST_EXE:=pjsystest-$(TARGET_NAME)$(HOST_EXE)
diff --git a/pjsip-apps/build/Samples.mak b/pjsip-apps/build/Samples.mak
index 502f92c4..82256213 100644
--- a/pjsip-apps/build/Samples.mak
+++ b/pjsip-apps/build/Samples.mak
@@ -8,7 +8,7 @@ RULES_MAK := $(PJDIR)/build/rules.mak
# Gather all flags.
#
export _CFLAGS := $(PJ_CFLAGS) $(CFLAGS)
-export _CXXFLAGS:= $(PJ_CXXFLAGS)
+export _CXXFLAGS:= $(PJ_CXXFLAGS) $(CFLAGS)
export _LDFLAGS := $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export _LDXXFLAGS := $(PJ_LDXXFLAGS) $(PJ_LDXXLIBS) $(LDFLAGS)
diff --git a/pjsip-apps/src/swig/python/helper.mak b/pjsip-apps/src/swig/python/helper.mak
index dafdb284..a47ea6dd 100644
--- a/pjsip-apps/src/swig/python/helper.mak
+++ b/pjsip-apps/src/swig/python/helper.mak
@@ -1,18 +1,14 @@
include ../../../../build.mak
+include $(PJDIR)/build/common.mak
-lib_dir:
- @for token in `echo $(APP_LDFLAGS)`; do \
- echo $$token | grep \\-L | sed 's/-L//'; \
+ldflags:
+ @for token in `echo $(PJ_LDXXLIBS) $(PJ_LDXXFLAGS) $(LDFLAGS)`; do \
+ echo $$token; \
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//'; \
+cflags:
+ @for token in `echo $(PJ_CXXFLAGS) $(CFLAGS)`; do \
+ echo $$token; \
done
target_name:
diff --git a/pjsip-apps/src/swig/python/setup.py b/pjsip-apps/src/swig/python/setup.py
index ace24d31..44b92b8e 100644
--- a/pjsip-apps/src/swig/python/setup.py
+++ b/pjsip-apps/src/swig/python/setup.py
@@ -66,38 +66,20 @@ f = os.popen("make --no-print-directory -f helper.mak target_name")
pj_target_name = f.read().rstrip("\r\n")
f.close()
-# Fill in pj_inc_dirs
-pj_inc_dirs = []
-f = os.popen("make --no-print-directory -f helper.mak inc_dir")
+# Fill in extra_compile_args
+extra_compile_args = []
+f = os.popen("make --no-print-directory -f helper.mak cflags")
for line in f:
- pj_inc_dirs.append(line.rstrip("\r\n"))
+ extra_compile_args.append(line.rstrip("\r\n"))
f.close()
-# Fill in pj_lib_dirs
-pj_lib_dirs = []
-f = os.popen("make --no-print-directory -f helper.mak lib_dir")
-for line in f:
- pj_lib_dirs.append(line.rstrip("\r\n"))
-f.close()
-
-# Fill in pj_libs
-pj_libs = ['pjsua2-' + pj_target_name]
-f = os.popen("make --no-print-directory -f helper.mak libs")
+# Fill in extra_link_args
+extra_link_args = []
+f = os.popen("make --no-print-directory -f helper.mak ldflags")
for line in f:
- pj_libs.append(line.rstrip("\r\n"))
+ extra_link_args.append(line.rstrip("\r\n"))
f.close()
-# Fill in extra link args
-extra_link_args = []
-if platform.system() == 'Darwin':
- # Mac OS X depedencies
- extra_link_args += ["-framework", "CoreFoundation",
- "-framework", "AudioToolbox",
- "-framework", "QTKit"]
- # OS X Lion support
- if platform.mac_ver()[0].startswith("10.7"):
- extra_link_args += ["-framework", "AudioUnit"]
-
# MinGW specific action: put current working dir to PATH, so Python distutils
# will invoke our dummy gcc/g++ instead, which is in the current working dir.
if platform.system()=='Windows' and os.environ["MSYSTEM"].find('MINGW')!=-1:
@@ -109,10 +91,7 @@ setup(name="pjsua2",
url='http://www.pjsip.org',
ext_modules = [Extension("_pjsua2",
["pjsua2_wrap.cpp"],
- define_macros=[('PJ_AUTOCONF', '1'),],
- include_dirs=pj_inc_dirs,
- library_dirs=pj_lib_dirs,
- libraries=pj_libs,
+ extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
)
],