Ignore:
Timestamp:
Nov 23, 2013 7:13:40 AM (9 years ago)
Author:
bennylp
Message:

Fixed #1713: Enable building the libraries as shared libraries/DLLs for GNU targets

File:
1 edited

Legend:

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

    r4607 r4656  
    1313export SHLIB_SUFFIX := @ac_shlib_suffix@ 
    1414 
    15 export ac_prefix := @prefix@ 
     15export prefix := @prefix@ 
     16export exec_prefix := @exec_prefix@ 
     17export includedir := @includedir@ 
     18export libdir := @libdir@ 
    1619 
    1720LIB_SUFFIX = $(TARGET_NAME).a 
    1821 
     22ifeq (@ac_shared_libraries@,1) 
     23export PJ_SHARED_LIBRARIES := 1 
     24endif 
     25 
    1926# Determine which party libraries to use 
    20 export APP_THIRD_PARTY_LIBS := -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) 
    2127export APP_THIRD_PARTY_EXT := 
     28export APP_THIRD_PARTY_LIBS := 
    2229export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) 
    23  
     30ifeq ($(PJ_SHARED_LIBRARIES),) 
     31APP_THIRD_PARTY_LIBS += -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) 
     32else 
     33APP_THIRD_PARTY_LIBS += -lmilenage -lsrtp 
     34APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX) \ 
     35                             $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX) 
     36endif 
     37 
     38APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) 
     39ifeq ($(PJ_SHARED_LIBRARIES),) 
    2440ifeq (@ac_resample_dll@,1) 
    2541export PJ_RESAMPLE_DLL := 1 
    26 export APP_THIRD_PARTY_LIBS := -lresample $(APP_THIRD_PARTY_LIBS) 
    27 export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) $(APP_THIRD_PARTY_LIB_FILES) 
    28 else 
    29 export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) $(APP_THIRD_PARTY_LIBS) 
    30 export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(APP_THIRD_PARTY_LIB_FILES) 
     42APP_THIRD_PARTY_LIBS += -lresample 
     43APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) 
     44else 
     45APP_THIRD_PARTY_LIBS += -lresample-$(TARGET_NAME) 
     46endif 
     47else 
     48APP_THIRD_PARTY_LIBS += -lresample 
     49APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) 
    3150endif 
    3251 
     
    3655APP_THIRD_PARTY_EXT += -lgsm 
    3756else 
     57APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX) 
     58ifeq ($(PJ_SHARED_LIBRARIES),) 
    3859APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME) 
    39 APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX) 
     60else 
     61APP_THIRD_PARTY_LIBS += -lgsmcodec 
     62APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libgsmcodec.$(SHLIB_SUFFIX) 
     63endif 
    4064endif 
    4165endif 
     
    4569APP_THIRD_PARTY_EXT += -lspeex -lspeexdsp 
    4670else 
     71APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX) 
     72ifeq ($(PJ_SHARED_LIBRARIES),) 
    4773APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME) 
    48 APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX) 
     74else 
     75APP_THIRD_PARTY_LIBS += -lspeex 
     76APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libspeex.$(SHLIB_SUFFIX) 
     77endif 
    4978endif 
    5079endif 
    5180 
    5281ifneq (@ac_no_ilbc_codec@,1) 
     82APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libilbccodec-$(LIB_SUFFIX) 
     83ifeq ($(PJ_SHARED_LIBRARIES),) 
    5384APP_THIRD_PARTY_LIBS += -lilbccodec-$(TARGET_NAME) 
    54 APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libilbccodec-$(LIB_SUFFIX) 
     85else 
     86APP_THIRD_PARTY_LIBS += -lilbccodec 
     87APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libilbccodec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libilbccodec.$(SHLIB_SUFFIX) 
     88endif 
    5589endif 
    5690 
    5791ifneq (@ac_no_g7221_codec@,1) 
     92APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libg7221codec-$(LIB_SUFFIX) 
     93ifeq ($(PJ_SHARED_LIBRARIES),) 
    5894APP_THIRD_PARTY_LIBS += -lg7221codec-$(TARGET_NAME) 
    59 APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libg7221codec-$(LIB_SUFFIX) 
     95else 
     96APP_THIRD_PARTY_LIBS += -lg7221codec 
     97APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libg7221codec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libg7221codec.$(SHLIB_SUFFIX) 
     98endif 
    6099endif 
    61100 
     
    65104APP_THIRD_PARTY_EXT += -lportaudio 
    66105else 
     106APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX) 
     107ifeq ($(PJ_SHARED_LIBRARIES),) 
    67108APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME) 
    68 APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX) 
     109else 
     110APP_THIRD_PARTY_LIBS += -lportaudio 
     111APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libportaudio.$(SHLIB_SUFFIX) 
     112endif 
    69113endif 
    70114endif 
     
    123167        $(PJ_VIDEO_LDFLAGS) \ 
    124168        @LDFLAGS@ 
    125 export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\ 
    126         -lpjsip-ua-$(TARGET_NAME)\ 
    127         -lpjsip-simple-$(TARGET_NAME)\ 
    128         -lpjsip-$(TARGET_NAME)\ 
    129         -lpjmedia-codec-$(TARGET_NAME)\ 
    130         -lpjmedia-videodev-$(TARGET_NAME)\ 
    131         -lpjmedia-$(TARGET_NAME)\ 
    132         -lpjmedia-audiodev-$(TARGET_NAME)\ 
    133         -lpjmedia-$(TARGET_NAME)\ 
    134         -lpjnath-$(TARGET_NAME)\ 
    135         -lpjlib-util-$(TARGET_NAME)\ 
    136         $(APP_THIRD_PARTY_LIBS)\ 
    137         $(APP_THIRD_PARTY_EXT)\ 
    138         -lpj-$(TARGET_NAME)\ 
    139         @LIBS@ 
    140169export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \ 
    141170        $(PJ_DIR)/pjsip/lib/libpjsip-ua-$(LIB_SUFFIX) \ 
     
    151180        $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX) 
    152181 
     182ifeq ($(PJ_SHARED_LIBRARIES),) 
     183export PJLIB_LDLIB := -lpj-$(TARGET_NAME) 
     184export PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME) 
     185export PJNATH_LDLIB := -lpjnath-$(TARGET_NAME) 
     186export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev-$(TARGET_NAME) 
     187export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev-$(TARGET_NAME) 
     188export PJMEDIA_LDLIB := -lpjmedia-$(TARGET_NAME) 
     189export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec-$(TARGET_NAME) 
     190export PJSIP_LDLIB := -lpjsip-$(TARGET_NAME) 
     191export PJSIP_SIMPLE_LDLIB := -lpjsip-simple-$(TARGET_NAME) 
     192export PJSIP_UA_LDLIB := -lpjsip-ua-$(TARGET_NAME) 
     193export PJSUA_LIB_LDLIB := -lpjsua-$(TARGET_NAME) 
     194else 
     195export PJLIB_LDLIB := -lpj 
     196export PJLIB_UTIL_LDLIB := -lpjlib-util 
     197export PJNATH_LDLIB := -lpjnath 
     198export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev 
     199export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev 
     200export PJMEDIA_LDLIB := -lpjmedia 
     201export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec 
     202export PJSIP_LDLIB := -lpjsip 
     203export PJSIP_SIMPLE_LDLIB := -lpjsip-simple 
     204export PJSIP_UA_LDLIB := -lpjsip-ua 
     205export PJSUA_LIB_LDLIB := -lpjsua 
     206 
     207APP_LIB_FILES += $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX) \ 
     208        $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX) \ 
     209        $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX) \ 
     210        $(PJ_DIR)/pjsip/lib/libpjsip.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip.$(SHLIB_SUFFIX) \ 
     211        $(PJ_DIR)/pjmedia/lib/libpjmedia-codec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-codec.$(SHLIB_SUFFIX) \ 
     212        $(PJ_DIR)/pjmedia/lib/libpjmedia-videodev.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-videodev.$(SHLIB_SUFFIX) \ 
     213        $(PJ_DIR)/pjmedia/lib/libpjmedia.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia.$(SHLIB_SUFFIX) \ 
     214        $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev.$(SHLIB_SUFFIX) \ 
     215        $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX) \ 
     216        $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX) \ 
     217        $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX) 
     218endif 
     219 
     220export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \ 
     221        $(PJSIP_UA_LDLIB) \ 
     222        $(PJSIP_SIMPLE_LDLIB) \ 
     223        $(PJSIP_LDLIB) \ 
     224        $(PJMEDIA_CODEC_LDLIB) \ 
     225        $(PJMEDIA_LDLIB) \ 
     226        $(PJMEDIA_VIDEODEV_LDLIB) \ 
     227        $(PJMEDIA_AUDIODEV_LDLIB) \ 
     228        $(PJNATH_LDLIB) \ 
     229        $(PJLIB_UTIL_LDLIB) \ 
     230        $(APP_THIRD_PARTY_LIBS)\ 
     231        $(APP_THIRD_PARTY_EXT)\ 
     232        $(PJLIB_LDLIB) \ 
     233        @LIBS@ 
     234 
    153235# Here are the variabels to use if application is using the library 
    154236# from within the source distribution 
     
    164246# library from the install location (i.e. --prefix) 
    165247export PJ_INSTALL_DIR := @prefix@ 
    166 export PJ_INSTALL_INC_DIR := $(PJ_INSTALL_DIR)/include 
    167 export PJ_INSTALL_LIB_DIR := $(PJ_INSTALL_DIR)/lib 
     248export PJ_INSTALL_INC_DIR := @includedir@ 
     249export PJ_INSTALL_LIB_DIR := @libdir@ 
    168250export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1     @CFLAGS@ 
    169251export PJ_INSTALL_CXXFLAGS := $(PJ_INSTALL_CFLAGS) 
Note: See TracChangeset for help on using the changeset viewer.