- Timestamp:
- Dec 13, 2013 9:07:53 AM (11 years ago)
- Location:
- pjproject/branches/projects/pjsua2
- Files:
-
- 52 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/build.mak.in
r4639 r4691 115 115 -I$(PJDIR)/pjsip/include 116 116 export APP_CXXFLAGS := $(APP_CFLAGS) 117 # x x x x x x x x x x x x x x x x x x x x x x x x 118 # 119 # FIX THIS 120 # 121 # pjsua2 is c++ library hence maybe needs to be put in separate 122 # variables. it will also require -lstdc++ or -static-libstdc++ 123 # x x x x x x x x x x x x x x x x x x x x x x x x 117 124 export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\ 118 125 -L$(PJDIR)/pjlib-util/lib\ … … 122 129 -L$(PJDIR)/third_party/lib\ 123 130 $(PJ_VIDEO_LDFLAGS) \ 131 -static-libstdc++ \ 124 132 @LDFLAGS@ 125 133 # x x x x x x x x x x x x x x x x x x x x x x x x … … 145 153 $(APP_THIRD_PARTY_EXT)\ 146 154 -lpj-$(TARGET_NAME)\ 147 @LIBS@ \ 148 -lstdc++ 155 @LIBS@ 149 156 # x x x x x x x x x x x x x x x x x x x x x x x x 150 157 # -
pjproject/branches/projects/pjsua2/configure-android
r4594 r4691 87 87 export CXX="${NDK_CXX}" 88 88 89 export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/ "90 export LIBS="${LIBS} -l c -lgcc"91 export CFLAGS="${CFLAGS} ${NDK_CFLAGS} "92 export CPPFLAGS="${CFLAGS} "93 export CXXFLAGS="${NDK_CXXFLAGS} "89 export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/ -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi" 90 export LIBS="${LIBS} -lgnustl_static -lc -lgcc ${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o" 91 export CFLAGS="${CFLAGS} ${NDK_CFLAGS} -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/include -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include" 92 export CPPFLAGS="${CFLAGS} -fexceptions -frtti" 93 export CXXFLAGS="${NDK_CXXFLAGS} -fexceptions -frtti" 94 94 95 95 else … … 111 111 export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++" 112 112 113 export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/ "114 export LIBS="${LIBS} -l c -lgcc"115 export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include "116 export CPPFLAGS="${CFLAGS} "117 export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT} "113 export LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/ -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi" 114 export LIBS="${LIBS} -lgnustl_static -lc -lgcc ${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o" 115 export CFLAGS="${CFLAGS} -I${ANDROID_SYSROOT}/usr/include -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/include -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include" 116 export CPPFLAGS="${CFLAGS} -fexceptions -frtti" 117 export CXXFLAGS="${CXXFLAGS} -shared --sysroot=${ANDROID_SYSROOT} -fexceptions -frtti" 118 118 119 119 fi -
pjproject/branches/projects/pjsua2/pjsip-apps/build/Makefile
r4676 r4691 97 97 $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $@ 98 98 $(MAKE) -f Samples.mak $@ 99 $(MAKE) -C ../src/swig $@ 99 100 @if test "$@" = "depend"; then \ 100 101 echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/Makefile
r4639 r4691 1 DIRS = python java 1 include ../../../build.mak 2 3 ifneq ($(findstring android,$(TARGET_NAME)),) 4 # no python for android 5 DIRS = java 6 else 7 DIRS = python java 8 endif 2 9 3 10 export SWIG_FLAGS=-I../../../../pjlib/include \ -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/Makefile
r4670 r4691 1 1 include ../../../../build.mak 2 2 3 ifneq ($(findstring "$(TARGET_NAME)","darwin"),"") 3 ifneq ($(findstring android,$(TARGET_NAME)),) 4 OS=android 5 else 6 ifneq ($(findstring darwin,$(TARGET_NAME)),) 4 7 OS=darwin 8 endif 5 9 endif 6 10 7 11 OUT_DIR=output 8 12 ifeq ($(OS),Windows_NT) 9 LIBPJSUA2_SO=$(OUT_DIR)/pjsua2.dll13 LIBPJSUA2_SO=$(OUT_DIR)/pjsua2.dll 10 14 else 11 15 ifeq ($(OS),darwin) 12 16 LIBPJSUA2_SO=$(OUT_DIR)/libpjsua2.jnilib 13 17 else 14 LIBPJSUA2_SO=$(OUT_DIR)/libpjsua2.so 18 ifeq ($(OS),android) 19 LIBPJSUA2_SO=android/libs/armeabi/libpjsua2.so 20 else 21 LIBPJSUA2_SO=$(OUT_DIR)/libpjsua2.so 22 endif 15 23 endif 16 24 endif … … 33 41 JAVA_BIN := $(JAVA_HOME) 34 42 endif 35 #$(error $(JAVA_BIN))36 43 endif 37 44 38 45 # OS specific 39 46 ifeq ($(OS),Windows_NT) 40 MY_JNI_LDFLAGS = -L$(MY_JDK)/lib -Wl,--kill-at 41 MY_JNI_LIB = $(OUT_DIR)/pjsua2.dll 47 MY_JNI_LDFLAGS = -L$(MY_JDK)/lib -Wl,--kill-at 42 48 else 43 MY_JNI_LDFLAGS = -L$(MY_JDK)/lib 44 ifneq ($(OS),darwin) 45 MY_JNI_LDFLAGS := $(MY_JNI_LDFLAGS) -Wl,-soname,pjsua2.so 49 MY_JNI_CFLAGS = -fPIC 50 MY_JNI_LDFLAGS = -L$(MY_JDK)/lib 51 ifeq ($(OS),darwin) 52 MY_JNI_LDFLAGS := $(MY_JNI_LDFLAGS) -Wl,-soname,pjsua2.so 46 53 endif 47 MY_JNI_LIB = $(OUT_DIR)/libpjsua2.so 48 MY_JNI_CFLAGS := -fPIC $(MY_JNI_CFLAGS) 54 ifeq ($(OS),android) 55 MY_JNI_CFLAGS := $(MY_JNI_CFLAGS) -D__ANDROID__ 56 endif 49 57 endif 50 58 … … 60 68 endif 61 69 MY_JNI_CFLAGS := $(MY_JNI_CFLAGS) -I$(MY_JDK)/include -I$(MY_JDK)/include/win32 \ 62 -I$(MY_JDK)/include/linux -I.70 -I$(MY_JDK)/include/linux -I. 63 71 64 72 # Build settings 65 73 MY_CFLAGS = $(PJ_CFLAGS) $(MY_JNI_CFLAGS) 66 MY_LDFLAGS = $(PJ_LDFLAGS) -lpjsua2-$(TARGET_NAME) $(PJ_LDLIBS) $(MY_JNI_LDFLAGS) -static-libstdc++ 74 MY_LDFLAGS = $(PJ_LDFLAGS) -lpjsua2-$(TARGET_NAME) $(PJ_LDLIBS) $(MY_JNI_LDFLAGS) 75 MY_PACKAGE_NAME = org.pjsip.pjsua2 76 ifeq ($(OS),android) 77 MY_PACKAGE_PATH = android/src/$(subst .,/,$(MY_PACKAGE_NAME)) 78 else 79 MY_PACKAGE_PATH = $(OUT_DIR)/$(subst .,/,$(MY_PACKAGE_NAME)) 80 endif 67 81 68 82 .PHONY: all java install uninstall … … 71 85 72 86 $(LIBPJSUA2_SO): $(OUT_DIR)/pjsua2_wrap.o 73 g++-shared -o $(LIBPJSUA2_SO) $(OUT_DIR)/pjsua2_wrap.o $(MY_CFLAGS) $(MY_LDFLAGS)87 $(PJ_CXX) -shared -o $(LIBPJSUA2_SO) $(OUT_DIR)/pjsua2_wrap.o $(MY_CFLAGS) $(MY_LDFLAGS) 74 88 75 89 $(OUT_DIR)/pjsua2_wrap.o: $(OUT_DIR)/pjsua2_wrap.cpp Makefile 76 g++-c $(OUT_DIR)/pjsua2_wrap.cpp -o $(OUT_DIR)/pjsua2_wrap.o $(MY_CFLAGS) $(MY_LDFLAGS)90 $(PJ_CXX) -c $(OUT_DIR)/pjsua2_wrap.cpp -o $(OUT_DIR)/pjsua2_wrap.o $(MY_CFLAGS) $(MY_LDFLAGS) 77 91 78 92 $(OUT_DIR)/pjsua2_wrap.cpp: ../pjsua2.i ../symbols.i $(SRCS) 79 swig $(SWIG_FLAGS) -java -o $(OUT_DIR)/pjsua2_wrap.cpp ../pjsua2.i 93 mkdir -p $(MY_PACKAGE_PATH) 94 swig $(SWIG_FLAGS) -java -package $(MY_PACKAGE_NAME) -outdir $(MY_PACKAGE_PATH) -o $(OUT_DIR)/pjsua2_wrap.cpp ../pjsua2.i 80 95 81 96 clean distclean realclean: 82 rm -rf $( OUT_DIR)/pjsua2_wrap.cpp $(OUT_DIR)/pjsua2_wrap.o $(LIBPJSUA2_SO) $(OUT_DIR)/*.java $(OUT_DIR)/*.class97 rm -rf $(LIBPJSUA2_SO) $(OUT_DIR)/* $(MY_PACKAGE_PATH)/*.java $(MY_PACKAGE_PATH)/*.class 83 98 84 java: output/Error.class output/test.class99 java: $(MY_PACKAGE_PATH)/Error.class $(MY_PACKAGE_PATH)/test.class 85 100 86 output/Error.class: output/Error.java87 $(MY_JAVAC) -d $(OUT_DIR) $( OUT_DIR)/*.java101 $(MY_PACKAGE_PATH)/Error.class: $(MY_PACKAGE_PATH)/Error.java 102 $(MY_JAVAC) -d $(OUT_DIR) $(MY_PACKAGE_PATH)/*.java 88 103 89 output/test.class: test.java104 $(MY_PACKAGE_PATH)/test.class: test.java 90 105 $(MY_JAVAC) -d $(OUT_DIR) -classpath "$(OUT_DIR)" test.java 91 106 … … 93 108 @# Need to specify classpath and library path, alternatively, they can be set via 94 109 @# CLASSPATH and java.library.path env settings 95 $(MY_JAVA) -cp $(OUT_DIR)-Djava.library.path="$(OUT_DIR)" test110 $(MY_JAVA) -cp "$(OUT_DIR);$(MY_PACKAGE_PATH)" -Djava.library.path="$(OUT_DIR)" test 96 111 97 112 install: -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/test.java
r4619 r4691 1 import org.pjsip.pjsua2.*; 2 1 3 public class test { 2 4 static { -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/pjsua2.i
r4669 r4691 26 26 } 27 27 #endif 28 29 // Allow C++ exceptions to be handled in Java 30 #ifdef SWIGJAVA 31 %typemap(throws, throws="java.lang.Exception") pj::Error { 32 jclass excep = jenv->FindClass("java/lang/Exception"); 33 if (excep) 34 jenv->ThrowNew(excep, $1.info(true).c_str()); 35 return $null; 36 } 37 38 // Force the Error Java class to extend java.lang.Exception 39 %typemap(javabase) pj::Error "java.lang.Exception"; 40 41 // Override getMessage() 42 %typemap(javacode) pj::Error %{ 43 public String getMessage() { 44 return getTitle(); 45 } 46 %} 47 #endif 48 28 49 29 50 // Constants from PJSIP libraries … … 75 96 %template(AudioMediaVector) std::vector<pj::AudioMedia*>; 76 97 %template(MediaFormatVector) std::vector<pj::MediaFormat*>; 77 %template(AudioDevInfoVector) std::vector< AudioDevInfo*>;98 %template(AudioDevInfoVector) std::vector<pj::AudioDevInfo*>; 78 99 %template(CodecInfoVector) std::vector<pj::CodecInfo*>; 79 100
Note: See TracChangeset
for help on using the changeset viewer.