Ignore:
Timestamp:
Jan 23, 2014 2:28:41 AM (10 years ago)
Author:
ming
Message:

Re #1723: Modified build system to link with C++ library only for pjsua2 lib or app

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/build.mak.in

    r4705 r4711  
    173173        -I$(PJDIR)/pjsip/include 
    174174export APP_CXXFLAGS := $(APP_CFLAGS) 
    175 #  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x 
    176 # 
    177 # FIX THIS 
    178 # 
    179 # pjsua2 is c++ library hence maybe needs to be put in separate 
    180 # variables. it will also require -lstdc++ or -static-libstdc++ 
    181 #  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x 
    182175export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\ 
    183176        -L$(PJDIR)/pjlib-util/lib\ 
     
    187180        -L$(PJDIR)/third_party/lib\ 
    188181        $(PJ_VIDEO_LDFLAGS) \ 
    189         -static-libstdc++ \ 
    190182        @LDFLAGS@ 
    191  
    192 #  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x 
    193 # 
    194 # FIX THIS 
    195 # 
    196 # pjsua2 is c++ library hence maybe needs to be put in separate 
    197 # variables. it will also require -lstdc++ 
    198 #  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x 
     183export APP_LDXXFLAGS := $(APP_LDFLAGS) \ 
     184        -static-libstdc++ 
     185 
    199186export APP_LIB_FILES = \ 
    200         $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) \ 
    201187        $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \ 
    202188        $(PJ_DIR)/pjsip/lib/libpjsip-ua-$(LIB_SUFFIX) \ 
     
    211197        $(APP_THIRD_PARTY_LIB_FILES) \ 
    212198        $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX) 
     199export APP_LIBXX_FILES = \ 
     200        $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) \ 
     201        $(APP_LIB_FILES) 
    213202 
    214203ifeq ($(PJ_SHARED_LIBRARIES),) 
     
    239228export PJSUA2_LIB_LDLIB := -lpjsua2 
    240229 
    241 APP_LIB_FILES += $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX) \ 
     230export ADD_LIB_FILES := $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX) \ 
    242231        $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX) \ 
    243232        $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX) \ 
     
    250239        $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX) \ 
    251240        $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX) 
    252 endif 
    253  
    254 export APP_LDLIBS := $(PJSUA2_LIB_LDLIB) \ 
    255         $(PJSUA_LIB_LDLIB) \ 
     241 
     242APP_LIB_FILES += $(ADD_LIB_FILES) 
     243 
     244APP_LIBXX_FILES += $(PJ_DIR)/pjsip/lib/libpjsua2.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua2.$(SHLIB_SUFFIX) \ 
     245        $(ADD_LIB_FILES) 
     246endif 
     247 
     248export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \ 
    256249        $(PJSIP_UA_LDLIB) \ 
    257250        $(PJSIP_SIMPLE_LDLIB) \ 
     
    267260        $(PJLIB_LDLIB) \ 
    268261        @LIBS@ 
     262export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \ 
     263        -lstdc++ \ 
     264        $(APP_LDLIBS) 
    269265 
    270266# Here are the variabels to use if application is using the library 
     
    275271export PJ_CXXFLAGS := $(APP_CXXFLAGS) 
    276272export PJ_LDFLAGS := $(APP_LDFLAGS) 
     273export PJ_LDXXFLAGS := $(APP_LDXXFLAGS) 
    277274export PJ_LDLIBS := $(APP_LDLIBS) 
     275export PJ_LDXXLIBS := $(APP_LDXXLIBS) 
    278276export PJ_LIB_FILES := $(APP_LIB_FILES) 
     277export PJ_LIBXX_FILES := $(APP_LIBXX_FILES) 
    279278 
    280279# And here are the variables to use if application is using the 
Note: See TracChangeset for help on using the changeset viewer.