From 3c3b8c6cf322ceacb451e0de8cac7b8338bbc297 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Tue, 12 Feb 2013 14:00:13 -0600 Subject: Add support for building and using shared libraries. --- third_party/build/g7221/Makefile | 20 +++++++++++++----- third_party/build/gsm/Makefile | 20 +++++++++++++----- third_party/build/ilbc/Makefile | 20 +++++++++++++----- third_party/build/milenage/Makefile | 20 +++++++++++++----- third_party/build/portaudio/Makefile | 20 +++++++++++++----- third_party/build/resample/Makefile | 40 ++++++++++++++++-------------------- third_party/build/speex/Makefile | 20 +++++++++++++----- third_party/build/srtp/Makefile | 20 +++++++++++++----- 8 files changed, 123 insertions(+), 57 deletions(-) (limited to 'third_party') diff --git a/third_party/build/g7221/Makefile b/third_party/build/g7221/Makefile index 6059030..59d8160 100644 --- a/third_party/build/g7221/Makefile +++ b/third_party/build/g7221/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export G7221_CODEC_LIB := ../../lib/libg7221codec-$(TARGET_NAME)$(LIBEXT) +export G7221_CODEC_SONAME := libg7221codec.$(SHLIB_SUFFIX) +export G7221_CODEC_SHLIB := $(G7221_CODEC_SONAME).$(PJ_VERSION_MAJOR) +export G7221_CODEC_LIB := libg7221codec-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -34,7 +36,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libg7221codec +TARGETS := $(G7221_CODEC_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(G7221_CODEC_SONAME) +endif all: $(TARGETS) @@ -44,10 +49,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libg7221codec clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(G7221_CODEC_LIB) $(G7221_CODEC_SHLIB) $(G7221_CODEC_SONAME) -libg7221codec: - $(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $(G7221_CODEC_LIB) +libg7221codec: $(G7221_CODEC_LIB) +$(G7221_CODEC_SHLIB): $(G7221_CODEC_SONAME) +$(G7221_CODEC_SONAME): $(G7221_CODEC_LIB) +$(G7221_CODEC_LIB) $(G7221_CODEC_SHLIB) $(G7221_CODEC_SONAME): + $(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $@ diff --git a/third_party/build/gsm/Makefile b/third_party/build/gsm/Makefile index a265076..1fba80e 100644 --- a/third_party/build/gsm/Makefile +++ b/third_party/build/gsm/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export GSM_CODEC_LIB := ../../lib/libgsmcodec-$(TARGET_NAME)$(LIBEXT) +export GSM_CODEC_SONAME := libgsmcodec.$(SHLIB_SUFFIX) +export GSM_CODEC_SHLIB := $(GSM_CODEC_SONAME).$(PJ_VERSION_MAJOR) +export GSM_CODEC_LIB := libgsmcodec-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -35,7 +37,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libgsmcodec +TARGETS := $(GSM_CODEC_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(GSM_CODEC_SONAME) +endif all: $(TARGETS) @@ -45,10 +50,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libgsmcodec clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONE: $(GSM_CODEC_LIB) $(GSM_CODEC_SHLIB) $(GSM_CODEC_SONAME) -libgsmcodec: - $(MAKE) -f $(RULES_MAK) APP=GSM_CODEC app=libgsmcodec $(GSM_CODEC_LIB) +libgsmcodec: $(GSM_CODEC_LIB) +$(GSM_CODEC_SHLIB): $(GSM_CODEC_SONAME) +$(GSM_CODEC_SONAME): $(GSM_CODEC_LIB) +$(GSM_CODEC_LIB) $(GSM_CODEC_SHLIB) $(GSM_CODEC_SONAME): + $(MAKE) -f $(RULES_MAK) APP=GSM_CODEC app=libgsmcodec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=GSM_CODEC app=libgsmcodec $@ diff --git a/third_party/build/ilbc/Makefile b/third_party/build/ilbc/Makefile index 50b4ab7..1e75d07 100644 --- a/third_party/build/ilbc/Makefile +++ b/third_party/build/ilbc/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export ILBC_LIB := ../../lib/libilbccodec-$(TARGET_NAME)$(LIBEXT) +export ILBC_SONAME := libilbccodec.$(SHLIB_SUFFIX) +export ILBC_SHLIB := $(ILBC_SONAME).$(PJ_VERSION_MAJOR) +export ILBC_LIB := libilbccodec-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -36,7 +38,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libilbccodec +TARGETS := $(ILBC_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(ILBC_SONAME) +endif all: $(TARGETS) @@ -46,10 +51,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libilbccodec clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(ILBC_LIB) $(ILBC_SHLIB) $(ILBC_SONAME) -libilbccodec: - $(MAKE) -f $(RULES_MAK) APP=ILBC app=libilbccodec $(ILBC_LIB) +libilbccodec: $(ILBC_LIB) +$(ILBC_SHLIB): $(ILBC_SONAME) +$(ILBC_SONAME): $(ILBC_LIB) +$(ILBC_LIB) $(ILBC_SHLIB) $(ILBC_SONAME): + $(MAKE) -f $(RULES_MAK) APP=ILBC app=libilbccodec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=ILBC app=libilbccodec $@ diff --git a/third_party/build/milenage/Makefile b/third_party/build/milenage/Makefile index 094ddea..1948d03 100644 --- a/third_party/build/milenage/Makefile +++ b/third_party/build/milenage/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export MILENAGE_LIB := ../../lib/libmilenage-$(TARGET_NAME)$(LIBEXT) +export MILENAGE_SONAME := libmilenage.$(SHLIB_SUFFIX) +export MILENAGE_SHLIB := $(MILENAGE_SONAME).$(PJ_VERSION_MAJOR) +export MILENAGE_LIB := libmilenage-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -29,7 +31,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libmilenage +TARGETS := $(MILENAGE_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(MILENAGE_SONAME) +endif all: $(TARGETS) @@ -39,10 +44,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libmilenage clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(MILENAGE_LIB) $(MILENAGE_SHLIB) $(MILENAGE_SONAME) -libmilenage: - $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $(MILENAGE_LIB) +libmilenage: $(MILENAGE_LIB) +$(MILENAGE_SHLIB): $(MILENAGE_SONAME) +$(MILENAGE_SONAME): $(MILENAGE_LIB) +$(MILENAGE_LIB) $(MILENAGE_SHLIB) $(MILENAGE_SONAME): + $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $@ diff --git a/third_party/build/portaudio/Makefile b/third_party/build/portaudio/Makefile index ad81571..6c36747 100644 --- a/third_party/build/portaudio/Makefile +++ b/third_party/build/portaudio/Makefile @@ -6,7 +6,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export PORTAUDIO_LIB:=../../lib/libportaudio-$(TARGET_NAME)$(LIBEXT) +export PORTAUDIO_SONAME := libportaudio.$(SHLIB_SUFFIX) +export PORTAUDIO_SHLIB := $(PORTAUDIO_SONAME).$(PJ_VERSION_MAJOR) +export PORTAUDIO_LIB:=libportaudio-$(TARGET_NAME)$(LIBEXT) PORTAUDIO_OBJS += pa_allocation.o \ pa_converters.o \ @@ -43,17 +45,25 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libportaudio +TARGETS := $(PORTAUDIO_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(PORTAUDIO_SONAME) +endif all: $(TARGETS) dep: depend distclean: realclean -.PHONY: dep depend libportaudio clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(PORTAUDIO_LIB) $(PORTAUDIO_SHLIB) $(PORTAUDIO_SONAME) -libportaudio: - $(MAKE) -f $(RULES_MAK) APP=PORTAUDIO app=libportaudio $(PORTAUDIO_LIB) +libportaudio: $(PORTAUDIO_LIB) +$(PORTAUDIO_SHLIB): $(PORTAUDIO_SONAME) +$(PORTAUDIO_SONAME): $(PORTAUDIO_LIB) +$(PORTAUDIO_LIB) $(PORTAUDIO_SHLIB) $(PORTAUDIO_SONAME): + $(MAKE) -f $(RULES_MAK) APP=PORTAUDIO app=libportaudio $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean: $(MAKE) -f $(RULES_MAK) APP=PORTAUDIO app=libportaudio $@ diff --git a/third_party/build/resample/Makefile b/third_party/build/resample/Makefile index 2deb873..8b0423e 100644 --- a/third_party/build/resample/Makefile +++ b/third_party/build/resample/Makefile @@ -21,9 +21,9 @@ export RESAMPLE_SRCDIR = ../../resample/src export RESAMPLE_OBJS = resamplesubs.o export RESAMPLE_CFLAGS = $(_CFLAGS) -SHLIB_NAME := libresample.$(SHLIB_SUFFIX) -export RESAMPLE_SHLIB := ../../lib/$(SHLIB_NAME).$(PJ_VERSION_MAJOR) -export RESAMPLE_LIB := ../../lib/libresample-$(TARGET_NAME)$(LIBEXT) +export RESAMPLE_SONAME := libresample.$(SHLIB_SUFFIX) +export RESAMPLE_SHLIB := $(RESAMPLE_SONAME).$(PJ_VERSION_MAJOR) +export RESAMPLE_LIB := libresample-$(TARGET_NAME)$(LIBEXT) export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT ############################################################################### @@ -31,17 +31,14 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -ifeq ($(PJ_RESAMPLE_DLL),1) -TARGETS := ../../lib/$(SHLIB_NAME) -ifeq ($(SHLIB_SUFFIX),so) -SHLIB_OPT := -Wl,-soname,$(SHLIB_NAME).$(PJ_VERSION_MAJOR) +TARGETS := $(RESAMPLE_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(RESAMPLE_SONAME) else -SHLIB_OPT := -endif +ifneq ($(PJ_RESAMPLE_DLL),) +TARGETS += $(RESAMPLE_SONAME) export RESAMPLE_CFLAGS := -fPIC $(RESAMPLE_CFLAGS) -export RESAMPLE_LDFLAGS := -shared $(SHLIB_OPT) $(RESAMPLE_LDFLAGS) -else -TARGETS := libresample +endif endif all: $(TARGETS) @@ -52,23 +49,22 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libresample clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(RESAMPLE_LIB) $(RESAMPLE_SHLIB) $(RESAMPLE_SONAME) -libresample: - $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(RESAMPLE_LIB) +dep: depend -../../lib/$(SHLIB_NAME): $(RESAMPLE_SHLIB) - ln -s $(SHLIB_NAME).$(PJ_VERSION_MAJOR) $@ +libresample: $(RESAMPLE_LIB) +$(RESAMPLE_SHLIB): $(RESAMPLE_SONAME) +$(RESAMPLE_SONAME): $(RESAMPLE_LIB) +$(RESAMPLE_LIB) $(RESAMPLE_SHLIB) $(RESAMPLE_SONAME): + $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) -$(RESAMPLE_SHLIB): - $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(RESAMPLE_SHLIB) - clean print_lib: $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@ realclean: - $(subst @@,$(subst /,$(HOST_PSEP),../../lib/$(SHLIB_NAME)),$(HOST_RMR)) - $(subst @@,$(subst /,$(HOST_PSEP),$(RESAMPLE_SHLIB)),$(HOST_RMR)) $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@ depend: diff --git a/third_party/build/speex/Makefile b/third_party/build/speex/Makefile index d31166e..49bf2ff 100644 --- a/third_party/build/speex/Makefile +++ b/third_party/build/speex/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export SPEEX_LIB := ../../lib/libspeex-$(TARGET_NAME)$(LIBEXT) +export SPEEX_SONAME := libspeex.$(SHLIB_SUFFIX) +export SPEEX_SHLIB := $(SPEEX_SONAME).$(PJ_VERSION_MAJOR) +export SPEEX_LIB := libspeex-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -44,7 +46,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libspeex +TARGETS := $(SPEEX_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(SPEEX_SONAME) +endif all: $(TARGETS) @@ -54,10 +59,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libspeex clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(SPEEX_LIB) $(SPEEX_SHLIB) $(SPEEX_SONAME) -libspeex: - $(MAKE) -f $(RULES_MAK) APP=SPEEX app=libspeex $(SPEEX_LIB) +libspeex: $(SPEEX_LIB) +$(SPEEX_SHLIB): $(SPEEX_SONAME) +$(SPEEX_SONAME): $(SPEEX_LIB) +$(SPEEX_LIB) $(SPEEX_SHLIB) $(SPEEX_SONAME): + $(MAKE) -f $(RULES_MAK) APP=SPEEX app=libspeex $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=SPEEX app=libspeex $@ diff --git a/third_party/build/srtp/Makefile b/third_party/build/srtp/Makefile index 17cb421..4ed0121 100644 --- a/third_party/build/srtp/Makefile +++ b/third_party/build/srtp/Makefile @@ -5,7 +5,9 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak -export SRTP_LIB := ../../lib/libsrtp-$(TARGET_NAME)$(LIBEXT) +export SRTP_SONAME := libsrtp.$(SHLIB_SUFFIX) +export SRTP_SHLIB := $(SRTP_SONAME).$(PJ_VERSION_MAJOR) +export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -57,7 +59,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := libsrtp +TARGETS := $(SRTP_LIB) +ifneq ($(PJ_SHARED_LIBRARIES),) +TARGETS += $(SRTP_SONAME) +endif all: $(TARGETS) @@ -67,10 +72,15 @@ doc: dep: depend distclean: realclean -.PHONY: dep depend libsrtp clean realclean distclean +.PHONY: all dep depend clean realclean distclean +.PHONY: $(TARGETS) +.PHONY: $(SRTP_LIB) $(SRTP_SHLIB) $(SRTP_SONAME) -libsrtp: - $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(SRTP_LIB) +libsrtp: $(SRTP_LIB) +$(SRTP_SHLIB): $(SRTP_SONAME) +$(SRTP_SONAME): $(SRTP_LIB) +$(SRTP_LIB) $(SRTP_SHLIB) $(SRTP_SONAME): + $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ -- cgit v1.2.3 From 36194f13ae01a7f5578104fcb7e022fe81c83464 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Fri, 15 Feb 2013 12:54:17 -0600 Subject: More fixes for dependencies, and to be more consistent. --- build.mak.in | 66 +++++++++++++++++++++--------------- pjlib-util/build/Makefile | 12 +++---- pjlib/build/Makefile | 8 ++--- pjmedia/build/Makefile | 57 +++++++++++++++---------------- pjnath/build/Makefile | 12 ++----- pjsip-apps/build/Samples.mak | 2 +- pjsip/build/Makefile | 61 ++++++++++++++++++++------------- third_party/build/g7221/Makefile | 16 ++++----- third_party/build/gsm/Makefile | 16 ++++----- third_party/build/ilbc/Makefile | 16 ++++----- third_party/build/milenage/Makefile | 16 ++++----- third_party/build/portaudio/Makefile | 16 ++++----- third_party/build/resample/Makefile | 15 ++++---- third_party/build/speex/Makefile | 16 ++++----- third_party/build/srtp/Makefile | 16 ++++----- 15 files changed, 177 insertions(+), 168 deletions(-) (limited to 'third_party') diff --git a/build.mak.in b/build.mak.in index e854de3..fa8a4bf 100644 --- a/build.mak.in +++ b/build.mak.in @@ -39,10 +39,10 @@ export PJ_RESAMPLE_DLL := 1 APP_THIRD_PARTY_LIBS += -lresample APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) else -APP_THIRD_PARTY_LIBS += -lresample-$(TARGET_NAME) $(APP_THIRD_PARTY_LIBS) +APP_THIRD_PARTY_LIBS += -lresample-$(TARGET_NAME) endif else -APP_THIRD_PARTY_LIBS += -lresample $(APP_THIRD_PARTY_LIBS) +APP_THIRD_PARTY_LIBS += -lresample APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX) endif @@ -177,21 +177,30 @@ export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \ $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX) ifeq ($(PJ_SHARED_LIBRARIES),) -export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\ - -lpjsip-ua-$(TARGET_NAME)\ - -lpjsip-simple-$(TARGET_NAME)\ - -lpjsip-$(TARGET_NAME)\ - -lpjmedia-codec-$(TARGET_NAME)\ - -lpjmedia-videodev-$(TARGET_NAME)\ - -lpjmedia-$(TARGET_NAME)\ - -lpjmedia-audiodev-$(TARGET_NAME)\ - -lpjnath-$(TARGET_NAME)\ - -lpjlib-util-$(TARGET_NAME)\ - $(APP_THIRD_PARTY_LIBS)\ - $(APP_THIRD_PARTY_EXT)\ - -lpj-$(TARGET_NAME)\ - @LIBS@ +export PJLIB_LDLIB := -lpj-$(TARGET_NAME) +export PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME) +export PJNATH_LDLIB := -lpjnath-$(TARGET_NAME) +export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev-$(TARGET_NAME) +export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev-$(TARGET_NAME) +export PJMEDIA_LDLIB := -lpjmedia-$(TARGET_NAME) +export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec-$(TARGET_NAME) +export PJSIP_LDLIB := -lpjsip-$(TARGET_NAME) +export PJSIP_SIMPLE_LDLIB := -lpjsip-simple-$(TARGET_NAME) +export PJSIP_UA_LDLIB := -lpjsip-ua-$(TARGET_NAME) +export PJSUA_LIB_LDLIB := -lpjsua-$(TARGET_NAME) else +export PJLIB_LDLIB := -lpj +export PJLIB_UTIL_LDLIB := -lpjlib-util +export PJNATH_LDLIB := -lpjnath +export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev +export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev +export PJMEDIA_LDLIB := -lpjmedia +export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec +export PJSIP_LDLIB := -lpjsip +export PJSIP_SIMPLE_LDLIB := -lpjsip-simple +export PJSIP_UA_LDLIB := -lpjsip-ua +export PJSUA_LIB_LDLIB := -lpjsua + APP_LIB_FILES += $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX) \ $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX) \ $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX) \ @@ -203,21 +212,22 @@ APP_LIB_FILES += $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX) \ $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX) \ $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX) -export APP_LDLIBS := -lpjsua\ - -lpjsip-ua\ - -lpjsip-simple\ - -lpjsip\ - -lpjmedia-codec\ - -lpjmedia-videodev\ - -lpjmedia\ - -lpjmedia-audiodev\ - -lpjnath\ - -lpjlib-util\ +endif + +export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \ + $(PJSIP_UA_LDLIB) \ + $(PJSIP_SIMPLE_LDLIB) \ + $(PJSIP_LDLIB) \ + $(PJMEDIA_CODEC_LDLIB) \ + $(PJMEDIA_LDLIB) \ + $(PJMEDIA_VIDEODEV_LDLIB) \ + $(PJMEDIA_AUDIODEV_LDLIB) \ + $(PJNATH_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ $(APP_THIRD_PARTY_LIBS)\ $(APP_THIRD_PARTY_EXT)\ - -lpj\ + $(PJLIB_LDLIB) \ @LIBS@ -endif # Here are the variabels to use if application is using the library # from within the source distribution diff --git a/pjlib-util/build/Makefile b/pjlib-util/build/Makefile index aef1e8e..8dc0e65 100644 --- a/pjlib-util/build/Makefile +++ b/pjlib-util/build/Makefile @@ -16,13 +16,9 @@ PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) export PJLIB_UTIL_LIB := libpjlib-util-$(TARGET_NAME)$(LIBEXT) ifeq ($(PJ_SHARED_LIBRARIES),) -PJLIB_LDLIB := -lpj-$(TARGET_NAME) -PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME) else export PJLIB_UTIL_SONAME := libpjlib-util.$(SHLIB_SUFFIX) export PJLIB_UTIL_SHLIB := $(PJLIB_UTIL_SONAME).$(PJ_VERSION_MAJOR) -PJLIB_LDLIB := -lpj -PJLIB_UTIL_LDLIB := -lpjlib-util endif ############################################################################### @@ -45,6 +41,7 @@ export PJLIB_UTIL_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ scanner.o sha1.o srv_resolver.o string.o stun_simple.o \ stun_simple_client.o xml.o export PJLIB_UTIL_CFLAGS += $(_CFLAGS) +export PJLIB_UTIL_LDFLAGS += $(PJLIB_LDLIB) $(_LDFLAGS) ############################################################################### # Defines for building test application @@ -83,13 +80,12 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SHLIB) $(PJLIB_UTIL_SONAME) +.PHONY: $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME) .PHONY: $(UTIL_TEST_EXE) -pjlib-util: $(PJLIB_UTIL_LIB) -$(PJLIB_UTIL_SHLIB): $(PJLIB_UTIL_SONAME) +pjlib-util: $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME) $(PJLIB_UTIL_SONAME): $(PJLIB_UTIL_LIB) -$(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SHLIB) $(PJLIB_UTIL_SONAME): +$(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME): $(PJLIB_LIB) $(PJLIB_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJLIB_UTIL app=pjlib-util $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjlib-util-test: $(UTIL_TEST_EXE) diff --git a/pjlib/build/Makefile b/pjlib/build/Makefile index 926fea2..9b70994 100644 --- a/pjlib/build/Makefile +++ b/pjlib/build/Makefile @@ -10,9 +10,7 @@ RULES_MAK := $(PJDIR)/build/rules.mak export PJLIB_LIB := libpj-$(TARGET_NAME)$(LIBEXT) ifeq ($(PJ_SHARED_LIBRARIES),) -PJLIB_LDLIB := -lpj-$(TARGET_NAME) else -PJLIB_LDLIB := -lpj export PJLIB_SONAME := libpj.$(SHLIB_SUFFIX) export PJLIB_SHLIB := $(PJLIB_SONAME).$(PJ_VERSION_MAJOR) endif @@ -40,6 +38,7 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ ssl_sock_common.o ssl_sock_ossl.o ssl_sock_dump.o \ string.o timer.o types.o export PJLIB_CFLAGS += $(_CFLAGS) +export PJLIB_LDFLAGS += $(_LDFLAGS) ############################################################################### # Defines for building test application @@ -89,7 +88,7 @@ depend: ../include/pj/config_site.h .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PJLIB_LIB) $(PJLIB_SHLIB) $(PJLIB_SONAME) +.PHONY: $(PJLIB_LIB) $(PJLIB_SONAME) .PHONY: $(TEST_EXE) dep: depend @@ -97,9 +96,8 @@ dep: depend pjlib: $(PJLIB_LIB) $(PJLIB_LIB): ../include/pj/config_site.h -$(PJLIB_SHLIB): $(PJLIB_SONAME) $(PJLIB_SONAME): $(PJLIB_LIB) -$(PJLIB_LIB) $(PJLIB_SHLIB) $(PJLIB_SONAME): +$(PJLIB_LIB) $(PJLIB_SONAME): $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) ../include/pj/config_site.h: diff --git a/pjmedia/build/Makefile b/pjmedia/build/Makefile index 73a1315..d27900d 100644 --- a/pjmedia/build/Makefile +++ b/pjmedia/build/Makefile @@ -25,21 +25,7 @@ export PJMEDIA_AUDIODEV_LIB:=libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) export PJMEDIA_VIDEODEV_LIB:=libpjmedia-videodev-$(TARGET_NAME)$(LIBEXT) ifeq ($(PJ_SHARED_LIBRARIES),) -PJMEDIA_LDLIB := -lpjmedia-$(TARGET_NAME) -PJMEDIA_CODEC_LDLIB := -lpjmedia-codec-$(TARGET_NAME) -PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev-$(TARGET_NAME) -PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev-$(TARGET_NAME) -PJLIB_LDLIB := -lpj-$(TARGET_NAME) -PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME) -PJNATH_LDLIB := -lpjnath-$(TARGET_NAME) else -PJMEDIA_LDLIB := -lpjmedia -PJMEDIA_CODEC_LDLIB := -lpjmedia-codec -PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev -PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev -PJLIB_LDLIB := -lpj -PJLIB_UTIL_LDLIB := -lpjlib-util -PJNATH_LDLIB := -lpjnath export PJMEDIA_SONAME:=libpjmedia.$(SHLIB_SUFFIX) export PJMEDIA_SHLIB:=$(PJMEDIA_SONAME).$(PJ_VERSION_MAJOR) export PJMEDIA_CODEC_SONAME:=libpjmedia-codec.$(SHLIB_SUFFIX) @@ -97,6 +83,12 @@ export PJMEDIA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ wsola.o export PJMEDIA_CFLAGS += $(_CFLAGS) +export PJMEDIA_LDFLAGS += $(PJMEDIA_VIDEODEV_LDLIB) \ + $(PJMEDIA_AUDIODEV_LDLIB) \ + $(PJLIB_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ + $(PJNATH_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -107,6 +99,8 @@ export PJMEDIA_AUDIODEV_OBJS += audiodev.o audiotest.o errno.o \ coreaudio_dev.o legacy_dev.o null_dev.o pa_dev.o wmme_dev.o \ alsa_dev.o bb10_dev.o export PJMEDIA_AUDIODEV_CFLAGS += $(_CFLAGS) +export PJMEDIA_AUDIODEV_LDFLAGS += $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -116,6 +110,8 @@ export PJMEDIA_VIDEODEV_SRCDIR = ../src/pjmedia-videodev export PJMEDIA_VIDEODEV_OBJS += errno.o videodev.o avi_dev.o ffmpeg_dev.o \ colorbar_dev.o v4l2_dev.o export PJMEDIA_VIDEODEV_CFLAGS += $(_CFLAGS) +export PJMEDIA_VIDEODEV_LDFLAGS += $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -128,6 +124,10 @@ export PJSDP_SRCDIR = ../src/pjmedia export PJSDP_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ errno.o sdp.o sdp_cmp.o sdp_neg.o export PJSDP_CFLAGS += $(_CFLAGS) +export PJSDP_LDFLAGS += $(PJMEDIA_LDLIB) \ + $(PJLIB_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -141,7 +141,9 @@ export PJMEDIA_CODEC_OBJS += audio_codecs.o ffmpeg_vid_codecs.o \ g7221_sdp_match.o amr_sdp_match.o export PJMEDIA_CODEC_CFLAGS += $(_CFLAGS) $(GSM_CFLAGS) $(SPEEX_CFLAGS) \ $(ILBC_CFLAGS) $(IPP_CFLAGS) $(G7221_CFLAGS) - +export PJMEDIA_CODEC_LDFLAGS += $(PJMEDIA_LDLIB) \ + $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### # Defines for building test application @@ -194,41 +196,36 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PJMEDIA_LIB) $(PJMEDIA_SHLIB) $(PJMEDIA_SONAME) -.PHONY: $(PJMEDIA_CODEC_LIB) $(PJMEDIA_CODEC_SHLIB) $(PJMEDIA_CODEC_SONAME) -.PHONY: $(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SHLIB) $(PJMEDIA_VIDEODEV_SONAME) -.PHONY: $(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SHLIB) $(PJMEDIA_AUDIODEV_SONAME) -.PHONY: $(PJSDP_LIB) $(PJSDP_SHLIB) $(PJSDP_SONAME) +.PHONY: $(PJMEDIA_LIB) $(PJMEDIA_SONAME) +.PHONY: $(PJMEDIA_CODEC_LIB) $(PJMEDIA_CODEC_SONAME) +.PHONY: $(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SONAME) +.PHONY: $(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SONAME) +.PHONY: $(PJSDP_LIB) $(PJSDP_SONAME) .PHONY: $(PJMEDIA_TEST_EXE) pjmedia: $(PJMEDIA_LIB) -$(PJMEDIA_SHLIB): $(PJMEDIA_SONAME) $(PJMEDIA_SONAME): $(PJMEDIA_LIB) -$(PJMEDIA_LIB) $(PJMEDIA_SHLIB) $(PJMEDIA_SONAME): +$(PJMEDIA_LIB) $(PJMEDIA_SONAME): $(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SONAME) $(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjmedia-codec: $(PJMEDIA_CODEC_LIB) -$(PJMEDIA_CODEC_SHLIB): $(PJMEDIA_CODEC_SONAME) $(PJMEDIA_CODEC_SONAME): $(PJMEDIA_CODEC_LIB) -$(PJMEDIA_CODEC_LIB) $(PJMEDIA_CODEC_SHLIB) $(PJMEDIA_CODEC_SONAME): +$(PJMEDIA_CODEC_LIB) $(PJMEDIA_CODEC_SONAME): $(PJMEDIA_LIB) $(PJMEDIA_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjmedia-videodev: $(PJMEDIA_VIDEODEV_LIB) -$(PJMEDIA_VIDEODEV_SHLIB): $(PJMEDIA_VIDEODEV_SONAME) $(PJMEDIA_VIDEODEV_SONAME): $(PJMEDIA_VIDEODEV_LIB) -$(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SHLIB) $(PJMEDIA_VIDEODEV_SONAME): +$(PJMEDIA_VIDEODEV_LIB) $(PJMEDIA_VIDEODEV_SONAME): $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_VIDEODEV app=pjmedia-videodev $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjmedia-audiodev: $(PJMEDIA_AUDIODEV_LIB) -$(PJMEDIA_AUDIODEV_SHLIB): $(PJMEDIA_AUDIODEV_SONAME) $(PJMEDIA_AUDIODEV_SONAME): $(PJMEDIA_AUDIODEV_LIB) -$(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SHLIB) $(PJMEDIA_AUDIODEV_SONAME): +$(PJMEDIA_AUDIODEV_LIB) $(PJMEDIA_AUDIODEV_SONAME): $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsdp: $(PJSDP_LIB) -$(PJSDP_SHLIB): $(PJSDP_SONAME) $(PJSDP_SONAME): $(PJSDP_LIB) -$(PJSDP_LIB) $(PJSDP_SHLIB) $(PJSDP_SONAME): +$(PJSDP_LIB) $(PJSDP_SONAME): $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $(LIBDIR)/$@ pjmedia-test: $(PJMEDIA_TEST_EXE) diff --git a/pjnath/build/Makefile b/pjnath/build/Makefile index 05c3342..e4b2077 100644 --- a/pjnath/build/Makefile +++ b/pjnath/build/Makefile @@ -17,13 +17,7 @@ PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) export PJNATH_LIB:=libpjnath-$(TARGET_NAME)$(LIBEXT) ifeq ($(PJ_SHARED_LIBRARIES),) -PJNATH_LDLIB := -lpjnath-$(TARGET_NAME) -PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME) -PJLIB_LDLIB := -lpj-$(TARGET_NAME) else -PJNATH_LDLIB := -lpjnath -PJLIB_UTIL_LDLIB := -lpjlib-util -PJLIB_LDLIB := -lpj export PJNATH_SONAME := libpjnath.$(SHLIB_SUFFIX) export PJNATH_SHLIB := $(PJNATH_SONAME).$(PJ_VERSION_MAJOR) endif @@ -48,6 +42,7 @@ export PJNATH_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ stun_msg.o stun_msg_dump.o stun_session.o stun_sock.o \ stun_transaction.o turn_session.o turn_sock.o export PJNATH_CFLAGS += $(_CFLAGS) +export PJNATH_LDFLAGS += $(PJLIB_UTIL_LDLIB) $(PJLIB_LDLIB) $(_LDFLAGS) ############################################################################### # Defines for building test application @@ -107,13 +102,12 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PJNATH_LIB) $(PJNATH_SHLIB) $(PJNATH_SONAME) +.PHONY: $(PJNATH_LIB) $(PJNATH_SONAME) .PHONY: $(PJNATH_TEST_EXE) $(PJTURN_CLIENT_EXE) $(PJTURN_SRV_EXE) pjnath: $(PJNATH_LIB) -$(PJNATH_SHLIB): $(PJNATH_SONAME) $(PJNATH_SONAME): $(PJNATH_LIB) -$(PJNATH_LIB) $(PJNATH_SHLIB) $(PJNATH_SONAME): +$(PJNATH_LIB) $(PJNATH_SONAME): $(PJLIB_LIB) $(PJLIB_SONAME) $(PJLIB_UTIL_LIB) $(PJLIB_UTIL_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJNATH app=pjnath $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjnath-test: $(PJNATH_TEST_EXE) diff --git a/pjsip-apps/build/Samples.mak b/pjsip-apps/build/Samples.mak index 658db4d..b13df53 100644 --- a/pjsip-apps/build/Samples.mak +++ b/pjsip-apps/build/Samples.mak @@ -52,7 +52,7 @@ EXES := $(foreach file, $(SAMPLES), $(file)$(HOST_EXE)) all: $(EXES) $(EXES): - $(MAKE) --no-print-directory -f $(RULES_MAK) SAMPLE_SRCDIR=$(SRCDIR) SAMPLE_OBJS=$@.o SAMPLE_LDFLAGS="$(_LDFLAGS)" SAMPLE_EXE=$@ APP=SAMPLE app=sample $(subst /,$(HOST_PSEP),$(BINDIR)/$@) + $(MAKE) --no-print-directory -f $(RULES_MAK) SAMPLE_SRCDIR=$(SRCDIR) SAMPLE_OBJS=$@.o SAMPLE_CFLAGS="$(_CFLAGS)" SAMPLE_LDFLAGS="$(_LDFLAGS)" SAMPLE_EXE=$@ APP=SAMPLE app=sample $(subst /,$(HOST_PSEP),$(BINDIR)/$@) depend: diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile index c05e113..749b043 100644 --- a/pjsip/build/Makefile +++ b/pjsip/build/Makefile @@ -23,15 +23,7 @@ export PJSIP_SIMPLE_LIB:=libpjsip-simple-$(TARGET_NAME)$(LIBEXT) export PJSUA_LIB_LIB:=libpjsua-$(TARGET_NAME)$(LIBEXT) ifeq ($(PJ_SHARED_LIBRARIES),) -PJSIP_LDLIB := -lpjsip-$(TARGET_NAME) -PJSIP_UA_LDLIB := -lpjsip-ua-$(TARGET_NAME) -PJSIP_SIMPLE_LDLIB := -lpjsip-simple-$(TARGET_NAME) -PJSUA_LIB_LDLIB := -lpjsip-$(TARGET_NAME) else -PJSIP_LDLIB := -lpjsip -PJSIP_UA_LDLIB := -lpjsip-ua -PJSIP_SIMPLE_LDLIB := -lpjsip-simple -PJSUA_LIB_LDLIB := -lpjsip export PJSIP_SONAME := libpjsip.$(SHLIB_SUFFIX) export PJSIP_SHLIB := $(PJSIP_SONAME).$(PJ_VERSION_MAJOR) export PJSIP_UA_SONAME := libpjsip-ua.$(SHLIB_SUFFIX) @@ -53,8 +45,10 @@ export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ $(CC_INC)../../pjmedia/include export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ $(HOST_CXXFLAGS) $(CXXFLAGS) -export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ - $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) +export _LDFLAGS := $(APP_THIRD_PARTY_LIBS) \ + $(APP_THIRD_PARTY_EXT) \ + $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ + $(APP_LDFLAGS) $(LDFLAGS) ############################################################################### # Defines for building PJSIP core library @@ -72,6 +66,9 @@ export PJSIP_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ sip_transaction.o sip_util_statefull.o \ sip_dialog.o sip_ua_layer.o export PJSIP_CFLAGS += $(_CFLAGS) +export PJSIP_LDFLAGS += $(PJLIB_UTIL_LDLIB) \ + $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### # Defines for building PJSIP UA library @@ -81,6 +78,12 @@ export PJSIP_UA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ sip_inv.o sip_reg.o sip_replaces.o sip_xfer.o \ sip_100rel.o sip_timer.o export PJSIP_UA_CFLAGS += $(_CFLAGS) +export PJSIP_UA_LDFLAGS += $(PJSIP_SIMPLE_LDLIB) \ + $(PJSIP_LDLIB) \ + $(PJMEDIA_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ + $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -92,6 +95,10 @@ export PJSIP_SIMPLE_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ mwi.o pidf.o presence.o presence_body.o publishc.o \ rpid.o xpidf.o export PJSIP_SIMPLE_CFLAGS += $(_CFLAGS) +export PJSIP_SIMPLE_LDFLAGS += $(PJSIP_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ + $(PJLIB_LDLIB) \ + $(_LDFLAGS) ############################################################################### @@ -103,6 +110,17 @@ export PJSUA_LIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ pjsua_im.o pjsua_media.o pjsua_pres.o \ pjsua_dump.o pjsua_aud.o pjsua_vid.o export PJSUA_LIB_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS) +export PJSUA_LIB_LDFLAGS += $(PJSIP_UA_LDLIB) \ + $(PJSIP_SIMPLE_LDLIB) \ + $(PJSIP_LDLIB) \ + $(PJMEDIA_AUDIODEV_LDLIB) \ + $(PJMEDIA_VIDEODEV_LDLIB) \ + $(PJMEDIA_CODEC_LDLIB) \ + $(PJMEDIA_LDLIB) \ + $(PJNATH_LDLIB) \ + $(PJLIB_UTIL_LDLIB) \ + $(PJLIB_LDLIB) \ + $(_LDFLAGS) export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT @@ -130,7 +148,6 @@ export TEST_LDFLAGS += $(PJSIP_LDLIB) \ $(PJLIB_LDLIB) \ $(PJLIB_UTIL_LDLIB) \ $(PJNATH_LDLIB) \ - $(APP_LDFLAGS) \ $(_LDFLAGS) export TEST_EXE := pjsip-test-$(TARGET_NAME)$(HOST_EXE) @@ -141,8 +158,8 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # TARGETS := $(PJSIP_LIB) $(PJSIP_SONAME) \ - $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) \ $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) \ + $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) \ $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) \ $(TEST_EXE) @@ -164,34 +181,30 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PJSIP_LIB) $(PJSIP_SHLIB) $(PJSIP_SONAME) -.PHONY: $(PJSIP_UA_LIB) $(PJSIP_UA_SHLIB) $(PJSIP_UA_SONAME) -.PHONY: $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SHLIB) $(PJSIP_SIMPLE_SONAME) -.PHONY: $(PJSUA_LIB_LIB) $(PJSUA_LIB_SHLIB) $(PJSUA_LIB_SONAME) +.PHONY: $(PJSIP_LIB) $(PJSIP_SONAME) +.PHONY: $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) +.PHONY: $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) +.PHONY: $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) .PHONY: $(TEST_EXE) pjsip: $(PJSIP_LIB) -$(PJSIP_SHLIB): $(PJSIP_SONAME) $(PJSIP_SONAME): $(PJSIP_LIB) -$(PJSIP_LIB) $(PJSIP_SHLIB) $(PJSIP_SONAME): +$(PJSIP_LIB) $(PJSIP_SONAME): $(MAKE) -f $(RULES_MAK) APP=PJSIP app=pjsip $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsip-ua: $(PJSIP_UA_LIB) -$(PJSIP_UA_SHLIB): $(PJSIP_UA_SONAME) $(PJSIP_UA_SONAME): $(PJSIP_UA_LIB) -$(PJSIP_UA_LIB) $(PJSIP_UA_SHLIB) $(PJSIP_UA_SONAME): +$(PJSIP_UA_LIB) $(PJSIP_UA_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJSIP_UA app=pjsip-ua $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsip-simple: $(PJSIP_SIMPLE_LIB) -$(PJSIP_SIMPLE_SHLIB): $(PJSIP_SIMPLE_SONAME) $(PJSIP_SIMPLE_SONAME): $(PJSIP_SIMPLE_LIB) -$(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SHLIB) $(PJSIP_SIMPLE_SONAME): +$(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJSIP_SIMPLE app=pjsip-simple $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsua-lib: $(PJSUA_LIB_LIB) -$(PJSUA_LIB_SHLIB): $(PJSUA_LIB_SONAME) $(PJSUA_LIB_SONAME): $(PJSUA_LIB_LIB) -$(PJSUA_LIB_LIB) $(PJSUA_LIB_SHLIB) $(PJSUA_LIB_SONAME): +$(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsip-test: $(TEST_EXE) diff --git a/third_party/build/g7221/Makefile b/third_party/build/g7221/Makefile index 59d8160..d0e7596 100644 --- a/third_party/build/g7221/Makefile +++ b/third_party/build/g7221/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export G7221_CODEC_LIB := libg7221codec-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export G7221_CODEC_SONAME := libg7221codec.$(SHLIB_SUFFIX) export G7221_CODEC_SHLIB := $(G7221_CODEC_SONAME).$(PJ_VERSION_MAJOR) -export G7221_CODEC_LIB := libg7221codec-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -36,10 +40,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(G7221_CODEC_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(G7221_CODEC_SONAME) -endif +TARGETS := $(G7221_CODEC_LIB) $(G7221_CODEC_SONAME) all: $(TARGETS) @@ -51,12 +52,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(G7221_CODEC_LIB) $(G7221_CODEC_SHLIB) $(G7221_CODEC_SONAME) +.PHONY: $(G7221_CODEC_LIB) $(G7221_CODEC_SONAME) libg7221codec: $(G7221_CODEC_LIB) -$(G7221_CODEC_SHLIB): $(G7221_CODEC_SONAME) $(G7221_CODEC_SONAME): $(G7221_CODEC_LIB) -$(G7221_CODEC_LIB) $(G7221_CODEC_SHLIB) $(G7221_CODEC_SONAME): +$(G7221_CODEC_LIB) $(G7221_CODEC_SONAME): $(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/gsm/Makefile b/third_party/build/gsm/Makefile index 1fba80e..0b94998 100644 --- a/third_party/build/gsm/Makefile +++ b/third_party/build/gsm/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export GSM_CODEC_LIB := libgsmcodec-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export GSM_CODEC_SONAME := libgsmcodec.$(SHLIB_SUFFIX) export GSM_CODEC_SHLIB := $(GSM_CODEC_SONAME).$(PJ_VERSION_MAJOR) -export GSM_CODEC_LIB := libgsmcodec-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -37,10 +41,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(GSM_CODEC_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(GSM_CODEC_SONAME) -endif +TARGETS := $(GSM_CODEC_LIB) $(GSM_CODEC_SONAME) all: $(TARGETS) @@ -52,12 +53,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONE: $(GSM_CODEC_LIB) $(GSM_CODEC_SHLIB) $(GSM_CODEC_SONAME) +.PHONE: $(GSM_CODEC_LIB) $(GSM_CODEC_SONAME) libgsmcodec: $(GSM_CODEC_LIB) -$(GSM_CODEC_SHLIB): $(GSM_CODEC_SONAME) $(GSM_CODEC_SONAME): $(GSM_CODEC_LIB) -$(GSM_CODEC_LIB) $(GSM_CODEC_SHLIB) $(GSM_CODEC_SONAME): +$(GSM_CODEC_LIB) $(GSM_CODEC_SONAME): $(MAKE) -f $(RULES_MAK) APP=GSM_CODEC app=libgsmcodec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/ilbc/Makefile b/third_party/build/ilbc/Makefile index 1e75d07..39ac6b2 100644 --- a/third_party/build/ilbc/Makefile +++ b/third_party/build/ilbc/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export ILBC_LIB := libilbccodec-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export ILBC_SONAME := libilbccodec.$(SHLIB_SUFFIX) export ILBC_SHLIB := $(ILBC_SONAME).$(PJ_VERSION_MAJOR) -export ILBC_LIB := libilbccodec-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -38,10 +42,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(ILBC_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(ILBC_SONAME) -endif +TARGETS := $(ILBC_LIB) $(ILBC_SONAME) all: $(TARGETS) @@ -53,12 +54,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(ILBC_LIB) $(ILBC_SHLIB) $(ILBC_SONAME) +.PHONY: $(ILBC_LIB) $(ILBC_SONAME) libilbccodec: $(ILBC_LIB) -$(ILBC_SHLIB): $(ILBC_SONAME) $(ILBC_SONAME): $(ILBC_LIB) -$(ILBC_LIB) $(ILBC_SHLIB) $(ILBC_SONAME): +$(ILBC_LIB) $(ILBC_SONAME): $(MAKE) -f $(RULES_MAK) APP=ILBC app=libilbccodec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/milenage/Makefile b/third_party/build/milenage/Makefile index 1948d03..18a48b9 100644 --- a/third_party/build/milenage/Makefile +++ b/third_party/build/milenage/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export MILENAGE_LIB := libmilenage-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export MILENAGE_SONAME := libmilenage.$(SHLIB_SUFFIX) export MILENAGE_SHLIB := $(MILENAGE_SONAME).$(PJ_VERSION_MAJOR) -export MILENAGE_LIB := libmilenage-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -31,10 +35,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(MILENAGE_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(MILENAGE_SONAME) -endif +TARGETS := $(MILENAGE_LIB) $(MILENAGE_SONAME) all: $(TARGETS) @@ -46,12 +47,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(MILENAGE_LIB) $(MILENAGE_SHLIB) $(MILENAGE_SONAME) +.PHONY: $(MILENAGE_LIB) $(MILENAGE_SONAME) libmilenage: $(MILENAGE_LIB) -$(MILENAGE_SHLIB): $(MILENAGE_SONAME) $(MILENAGE_SONAME): $(MILENAGE_LIB) -$(MILENAGE_LIB) $(MILENAGE_SHLIB) $(MILENAGE_SONAME): +$(MILENAGE_LIB) $(MILENAGE_SONAME): $(MAKE) -f $(RULES_MAK) APP=MILENAGE app=libmilenage $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/portaudio/Makefile b/third_party/build/portaudio/Makefile index 6c36747..a5c2449 100644 --- a/third_party/build/portaudio/Makefile +++ b/third_party/build/portaudio/Makefile @@ -6,9 +6,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export PORTAUDIO_LIB:=libportaudio-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export PORTAUDIO_SONAME := libportaudio.$(SHLIB_SUFFIX) export PORTAUDIO_SHLIB := $(PORTAUDIO_SONAME).$(PJ_VERSION_MAJOR) -export PORTAUDIO_LIB:=libportaudio-$(TARGET_NAME)$(LIBEXT) +endif PORTAUDIO_OBJS += pa_allocation.o \ pa_converters.o \ @@ -45,10 +49,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(PORTAUDIO_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(PORTAUDIO_SONAME) -endif +TARGETS := $(PORTAUDIO_LIB) $(PORTAUDIO_SONAME) all: $(TARGETS) @@ -57,12 +58,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(PORTAUDIO_LIB) $(PORTAUDIO_SHLIB) $(PORTAUDIO_SONAME) +.PHONY: $(PORTAUDIO_LIB) $(PORTAUDIO_SONAME) libportaudio: $(PORTAUDIO_LIB) -$(PORTAUDIO_SHLIB): $(PORTAUDIO_SONAME) $(PORTAUDIO_SONAME): $(PORTAUDIO_LIB) -$(PORTAUDIO_LIB) $(PORTAUDIO_SHLIB) $(PORTAUDIO_SONAME): +$(PORTAUDIO_LIB) $(PORTAUDIO_SONAME): $(MAKE) -f $(RULES_MAK) APP=PORTAUDIO app=libportaudio $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean: diff --git a/third_party/build/resample/Makefile b/third_party/build/resample/Makefile index 8b0423e..72ba28a 100644 --- a/third_party/build/resample/Makefile +++ b/third_party/build/resample/Makefile @@ -21,9 +21,13 @@ export RESAMPLE_SRCDIR = ../../resample/src export RESAMPLE_OBJS = resamplesubs.o export RESAMPLE_CFLAGS = $(_CFLAGS) +export RESAMPLE_LIB := libresample-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export RESAMPLE_SONAME := libresample.$(SHLIB_SUFFIX) export RESAMPLE_SHLIB := $(RESAMPLE_SONAME).$(PJ_VERSION_MAJOR) -export RESAMPLE_LIB := libresample-$(TARGET_NAME)$(LIBEXT) +endif export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT ############################################################################### @@ -31,12 +35,10 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(RESAMPLE_LIB) +TARGETS := $(RESAMPLE_LIB) $(RESAMPLE_SONAME) ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(RESAMPLE_SONAME) else ifneq ($(PJ_RESAMPLE_DLL),) -TARGETS += $(RESAMPLE_SONAME) export RESAMPLE_CFLAGS := -fPIC $(RESAMPLE_CFLAGS) endif endif @@ -51,14 +53,13 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(RESAMPLE_LIB) $(RESAMPLE_SHLIB) $(RESAMPLE_SONAME) +.PHONY: $(RESAMPLE_LIB) $(RESAMPLE_SONAME) dep: depend libresample: $(RESAMPLE_LIB) -$(RESAMPLE_SHLIB): $(RESAMPLE_SONAME) $(RESAMPLE_SONAME): $(RESAMPLE_LIB) -$(RESAMPLE_LIB) $(RESAMPLE_SHLIB) $(RESAMPLE_SONAME): +$(RESAMPLE_LIB) $(RESAMPLE_SONAME): $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/speex/Makefile b/third_party/build/speex/Makefile index 49bf2ff..7e5e6fd 100644 --- a/third_party/build/speex/Makefile +++ b/third_party/build/speex/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export SPEEX_LIB := libspeex-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export SPEEX_SONAME := libspeex.$(SHLIB_SUFFIX) export SPEEX_SHLIB := $(SPEEX_SONAME).$(PJ_VERSION_MAJOR) -export SPEEX_LIB := libspeex-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -46,10 +50,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(SPEEX_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(SPEEX_SONAME) -endif +TARGETS := $(SPEEX_LIB) $(SPEEX_SONAME) all: $(TARGETS) @@ -61,12 +62,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(SPEEX_LIB) $(SPEEX_SHLIB) $(SPEEX_SONAME) +.PHONY: $(SPEEX_LIB) $(SPEEX_SONAME) libspeex: $(SPEEX_LIB) -$(SPEEX_SHLIB): $(SPEEX_SONAME) $(SPEEX_SONAME): $(SPEEX_LIB) -$(SPEEX_LIB) $(SPEEX_SHLIB) $(SPEEX_SONAME): +$(SPEEX_LIB) $(SPEEX_SONAME): $(MAKE) -f $(RULES_MAK) APP=SPEEX app=libspeex $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: diff --git a/third_party/build/srtp/Makefile b/third_party/build/srtp/Makefile index 4ed0121..9538f0b 100644 --- a/third_party/build/srtp/Makefile +++ b/third_party/build/srtp/Makefile @@ -5,9 +5,13 @@ export LIBDIR := ../../lib RULES_MAK := $(PJDIR)/build/rules.mak +export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT) + +ifeq ($(PJ_SHARED_LIBRARIES),) +else export SRTP_SONAME := libsrtp.$(SHLIB_SUFFIX) export SRTP_SHLIB := $(SRTP_SONAME).$(PJ_VERSION_MAJOR) -export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT) +endif ############################################################################### # Gather all flags. @@ -59,10 +63,7 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT # # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. # -TARGETS := $(SRTP_LIB) -ifneq ($(PJ_SHARED_LIBRARIES),) -TARGETS += $(SRTP_SONAME) -endif +TARGETS := $(SRTP_LIB) $(SRTP_SONAME) all: $(TARGETS) @@ -74,12 +75,11 @@ distclean: realclean .PHONY: all dep depend clean realclean distclean .PHONY: $(TARGETS) -.PHONY: $(SRTP_LIB) $(SRTP_SHLIB) $(SRTP_SONAME) +.PHONY: $(SRTP_LIB) $(SRTP_SONAME) libsrtp: $(SRTP_LIB) -$(SRTP_SHLIB): $(SRTP_SONAME) $(SRTP_SONAME): $(SRTP_LIB) -$(SRTP_LIB) $(SRTP_SHLIB) $(SRTP_SONAME): +$(SRTP_LIB) $(SRTP_SONAME): $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) clean print_lib: -- cgit v1.2.3 From 9550ec7a68b8d072f99872d44def5004dbcc2562 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Wed, 27 Feb 2013 14:11:39 -0600 Subject: Add support for using external libsrtp. --- aconfigure | 44 ++++++++++++++++++++++++++++++++++++ aconfigure.ac | 20 ++++++++++++++++ build.mak.in | 22 ++++++++++++++---- pjmedia/build/Makefile | 7 +----- pjmedia/build/os-auto.mak.in | 14 ++++++++++++ pjmedia/build/os-darwinos.mak | 15 ++++++++++++ pjmedia/build/os-linux.mak | 15 ++++++++++++ pjmedia/build/os-win32.mak | 15 ++++++++++++ pjmedia/src/pjmedia/transport_srtp.c | 8 +++++++ third_party/build/Makefile | 2 +- third_party/build/os-auto.mak.in | 5 ++++ 11 files changed, 155 insertions(+), 12 deletions(-) (limited to 'third_party') diff --git a/aconfigure b/aconfigure index e1b0bac..78d7291 100755 --- a/aconfigure +++ b/aconfigure @@ -641,6 +641,7 @@ ac_pa_use_alsa ac_pa_cflags ac_external_pa ac_pjmedia_snd +ac_external_srtp ac_external_gsm ac_external_speex ac_shared_libraries @@ -731,6 +732,7 @@ enable_epoll enable_shared with_external_speex with_external_gsm +with_external_srtp enable_sound with_external_pa enable_oss @@ -1444,6 +1446,11 @@ Optional Packages: make sure that the GSM include/lib files are accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths) + --with-external-srtp Use external SRTP development files, not the one in + "third_party" directory. When this option is set, + make sure that SRTP is accessible to use (hint: use + CFLAGS and LDFLAGS env var to set the include/lib + paths) --with-external-pa Use external PortAudio development files, not the one in "third_party" directory. When this option is set, make sure that PortAudio is accessible to use @@ -5586,6 +5593,43 @@ fi +ac_external_srtp=0 + + +# Check whether --with-external-srtp was given. +if test "${with_external_srtp+set}" = set; then : + withval=$with_external_srtp; + if test "x$with_external_srtp" != "xno"; then + # Test SRTP installation + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external SRTP devkit is installed" >&5 +$as_echo_n "checking if external SRTP devkit is installed... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +srtp_init(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +$as_echo "yes!!" >&6; } + ac_external_srtp="1" + +else + as_fn_error $? "Unable to use SRTP. If SRTP development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + +fi + + # Check whether --enable-sound was given. diff --git a/aconfigure.ac b/aconfigure.ac index 1e93de9..9662820 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -531,6 +531,26 @@ AC_ARG_WITH(external-gsm, ) +dnl # Use external SRTP installation +AC_SUBST(ac_external_srtp,0) +AC_ARG_WITH(external-srtp, + AC_HELP_STRING([--with-external-srtp], + [Use external SRTP development files, not the one in "third_party" directory. When this option is set, make sure that SRTP is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), + [ + if test "x$with_external_srtp" != "xno"; then + # Test SRTP installation + AC_MSG_CHECKING([if external SRTP devkit is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], + [srtp_init();])], + [AC_MSG_RESULT(yes!!) + ac_external_srtp="1" + ], + [AC_MSG_ERROR([Unable to use SRTP. If SRTP development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) + fi + ] + ) + dnl # Sound device backend selection AC_SUBST(ac_pjmedia_snd) diff --git a/build.mak.in b/build.mak.in index fa8a4bf..e436667 100644 --- a/build.mak.in +++ b/build.mak.in @@ -23,13 +23,25 @@ endif # Determine which party libraries to use export APP_THIRD_PARTY_EXT := export APP_THIRD_PARTY_LIBS := -export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) +export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) ifeq ($(PJ_SHARED_LIBRARIES),) -APP_THIRD_PARTY_LIBS += -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME) +APP_THIRD_PARTY_LIBS += -lmilenage-$(TARGET_NAME) else -APP_THIRD_PARTY_LIBS += -lmilenage -lsrtp -APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX) \ - $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX) +APP_THIRD_PARTY_LIBS += -lmilenage +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX) +endif + +ifeq (@ac_external_srtp@,1) +# External SRTP library +APP_THIRD_PARTY_EXT += -lsrtp +else +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX) +ifeq ($(PJ_SHARED_LIBRARIES),) +APP_THIRD_PARTY_LIBS += -lsrtp-$(TARGET_NAME) +else +APP_THIRD_PARTY_LIBS += -lsrtp +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX) +endif endif APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) diff --git a/pjmedia/build/Makefile b/pjmedia/build/Makefile index 7df9ede..ca8e588 100644 --- a/pjmedia/build/Makefile +++ b/pjmedia/build/Makefile @@ -3,10 +3,6 @@ include ../../version.mak THIRD_PARTY:=$(PJDIR)/third_party -SRTP_INC=$(CC_INC)$(THIRD_PARTY)/build/srtp \ - $(CC_INC)$(THIRD_PARTY)/srtp/crypto/include \ - $(CC_INC)$(THIRD_PARTY)/srtp/include - include $(PJDIR)/build/common.mak export LIBDIR := ../lib @@ -48,8 +44,7 @@ export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ $(CC_INC)../../pjlib-util/include \ $(CC_INC)../../pjmedia/include \ $(CC_INC)../../pjnath/include \ - $(CC_INC)../.. \ - $(SRTP_INC) + $(CC_INC)../.. export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ $(HOST_CXXFLAGS) $(CXXFLAGS) diff --git a/pjmedia/build/os-auto.mak.in b/pjmedia/build/os-auto.mak.in index 04224e8..e71cde1 100644 --- a/pjmedia/build/os-auto.mak.in +++ b/pjmedia/build/os-auto.mak.in @@ -126,6 +126,20 @@ endif endif +# +# SRTP +# +ifeq (@ac_external_srtp@,1) +# External SRTP +export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1 +else +# Our SRTP in third_party +export CFLAGS += -I$(THIRD_PARTY)/build/srtp \ + -I$(THIRD_PARTY)/srtp/crypto/include \ + -I$(THIRD_PARTY)/srtp/include + +endif + # # PortAudio # diff --git a/pjmedia/build/os-darwinos.mak b/pjmedia/build/os-darwinos.mak index 7904594..82fdfbf 100644 --- a/pjmedia/build/os-darwinos.mak +++ b/pjmedia/build/os-darwinos.mak @@ -79,6 +79,21 @@ export G7221_CFLAGS += -I$(THIRD_PARTY) endif +# +# SRTP +# +#ifeq (@ac_external_srtp@,1) +ifeq (0,1) +# External SRTP +export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1 +else +# Our SRTP in third_party +export CFLAGS += -I$(THIRD_PARTY)/build/srtp \ + -I$(THIRD_PARTY)/srtp/crypto/include \ + -I$(THIRD_PARTY)/srtp/include + +endif + # # PortAudio # diff --git a/pjmedia/build/os-linux.mak b/pjmedia/build/os-linux.mak index 63910c4..a6d2dd3 100644 --- a/pjmedia/build/os-linux.mak +++ b/pjmedia/build/os-linux.mak @@ -73,6 +73,21 @@ export G7221_CFLAGS += -I$(THIRD_PARTY) endif +# +# SRTP +# +#ifeq (@ac_external_srtp@,1) +ifeq (0,1) +# External SRTP +export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1 +else +# Our SRTP in third_party +export CFLAGS += -I$(THIRD_PARTY)/build/srtp \ + -I$(THIRD_PARTY)/srtp/crypto/include \ + -I$(THIRD_PARTY)/srtp/include + +endif + # # PortAudio # diff --git a/pjmedia/build/os-win32.mak b/pjmedia/build/os-win32.mak index 498a9e1..0df71a5 100644 --- a/pjmedia/build/os-win32.mak +++ b/pjmedia/build/os-win32.mak @@ -75,6 +75,21 @@ export G7221_CFLAGS += -I$(THIRD_PARTY) endif +# +# SRTP +# +#ifeq (@ac_external_srtp@,1) +ifeq (0,1) +# External SRTP +export CFLAGS += -DPJMEDIA_EXTERNAL_SRTP=1 +else +# Our SRTP in third_party +export CFLAGS += -I$(THIRD_PARTY)/build/srtp \ + -I$(THIRD_PARTY)/srtp/crypto/include \ + -I$(THIRD_PARTY)/srtp/include + +endif + # # PortAudio # diff --git a/pjmedia/src/pjmedia/transport_srtp.c b/pjmedia/src/pjmedia/transport_srtp.c index a661c37..bd0e9b6 100644 --- a/pjmedia/src/pjmedia/transport_srtp.c +++ b/pjmedia/src/pjmedia/transport_srtp.c @@ -30,7 +30,11 @@ #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) +#if defined(PJMEDIA_EXTERNAL_SRTP) && (PJMEDIA_EXTERNAL_SRTP != 0) +#include +#else #include +#endif #define THIS_FILE "transport_srtp.c" @@ -315,11 +319,15 @@ static void pjmedia_srtp_deinit_lib(pjmedia_endpt *endpt) PJ_UNUSED_ARG(endpt); +#if defined(PJMEDIA_EXTERNAL_SRTP) && (PJMEDIA_EXTERNAL_SRTP != 0) + PJ_UNUSED_ARG(err); +#else err = srtp_deinit(); if (err != err_status_ok) { PJ_LOG(4, (THIS_FILE, "Failed to deinitialize libsrtp: %s", get_libsrtp_errstr(err))); } +#endif libsrtp_initialized = PJ_FALSE; } diff --git a/third_party/build/Makefile b/third_party/build/Makefile index 36d8061..8cfe9cf 100644 --- a/third_party/build/Makefile +++ b/third_party/build/Makefile @@ -1,4 +1,4 @@ -DIRS = resample milenage srtp +DIRS = resample milenage include ../../build.mak include $(PJDIR)/build/common.mak diff --git a/third_party/build/os-auto.mak.in b/third_party/build/os-auto.mak.in index f1de03f..dfc32a9 100644 --- a/third_party/build/os-auto.mak.in +++ b/third_party/build/os-auto.mak.in @@ -31,3 +31,8 @@ DIRS += portaudio endif endif +ifeq (@ac_external_srtp@,1) +# External SRTP +else +DIRS += srtp +endif -- cgit v1.2.3