openbsd-ports/telephony/pjsua/patches/patch-build_mak_in
dcoppa 42a5d6cf0f Update to pjsua-1.5.5
From (new) MAINTAINER Christopher Zimmermann with some modifications
by landry@, ajacoutot@, sthen@ and myself.

Thanks!

OK landry@, ajacoutot@, sthen@
2010-04-02 11:48:24 +00:00

86 lines
3.0 KiB
Plaintext

$OpenBSD: patch-build_mak_in,v 1.2 2010/04/02 11:48:24 dcoppa Exp $
fix from upstream:
enable use of system libraries for gsm, speex and portaudio
--- build.mak.in.orig Wed Apr 15 16:45:41 2009
+++ build.mak.in Thu Apr 1 18:52:00 2010
@@ -7,21 +7,33 @@ export TARGET_NAME := @target@
export CROSS_COMPILE := @ac_cross_compile@
export LINUX_POLL := @ac_linux_poll@
+export ac_prefix := @prefix@
+
LIB_SUFFIX = $(TARGET_NAME).a
# Determine which party libraries to use
export APP_THIRD_PARTY_LIBS := -lresample-$(TARGET_NAME) -lmilenage-$(TARGET_NAME) -lsrtp-$(TARGET_NAME)
+export APP_THIRD_PARTY_EXT :=
export APP_THIRD_PARTY_LIB_FILES = $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX) $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX)
ifneq (@ac_no_gsm_codec@,1)
+ifeq (@ac_external_gsm@,1)
+# External GSM library
+APP_THIRD_PARTY_EXT += -lgsm
+else
APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME)
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX)
endif
+endif
ifneq (@ac_no_speex_codec@,1)
+ifeq (@ac_external_speex@,1)
+APP_THIRD_PARTY_EXT += -lspeex -lspeexdsp
+else
APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME)
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX)
endif
+endif
ifneq (@ac_no_ilbc_codec@,1)
APP_THIRD_PARTY_LIBS += -lilbccodec-$(TARGET_NAME)
@@ -34,9 +46,14 @@ APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib
endif
ifneq ($(findstring pa,@ac_pjmedia_snd@),)
+ifeq (@ac_external_pa@,1)
+# External PA
+APP_THIRD_PARTY_EXT += -lportaudio
+else
APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME)
APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX)
endif
+endif
# Additional flags
@ac_build_mak_vars@
@@ -69,6 +86,7 @@ export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\
-lpjnath-$(TARGET_NAME)\
-lpjlib-util-$(TARGET_NAME)\
$(APP_THIRD_PARTY_LIBS)\
+ $(APP_THIRD_PARTY_EXT)\
-lpj-$(TARGET_NAME)\
@LIBS@
export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \
@@ -83,6 +101,8 @@ export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(
$(APP_THIRD_PARTY_LIB_FILES) \
$(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX)
+# Here are the variabels to use if application is using the library
+# from within the source distribution
export PJ_DIR := $(PJDIR)
export PJ_CC := $(APP_CC)
export PJ_CFLAGS := $(APP_CFLAGS)
@@ -91,3 +111,11 @@ export PJ_LDFLAGS := $(APP_LDFLAGS)
export PJ_LDLIBS := $(APP_LDLIBS)
export PJ_LIB_FILES := $(APP_LIB_FILES)
+# And here are the variables to use if application is using the
+# library from the install location (i.e. --prefix)
+export PJ_INSTALL_DIR := @prefix@
+export PJ_INSTALL_INC_DIR := $(PJ_INSTALL_DIR)/include
+export PJ_INSTALL_LIB_DIR := $(PJ_INSTALL_DIR)/lib
+export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
+export PJ_INSTALL_CXXFLAGS := $(PJ_INSTALL_CFLAGS)
+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)