blob: f7f01a023410425b3ad0a2ae9e2a784f31951cfe [file] [log] [blame]
Tristan Matthews0a329cc2013-07-17 13:20:14 -04001export PJDIR := @ac_pjdir@
2include $(PJDIR)/version.mak
3export PJ_DIR := $(PJDIR)
4
5# @configure_input@
6export MACHINE_NAME := auto
7export OS_NAME := auto
8export HOST_NAME := unix
9export CC_NAME := gcc
10export TARGET_NAME := @target@
11export CROSS_COMPILE := @ac_cross_compile@
12export LINUX_POLL := @ac_linux_poll@
13export SHLIB_SUFFIX := @ac_shlib_suffix@
14
Alexandre Lision8af73cb2013-12-10 14:11:20 -050015export prefix := @prefix@
16export exec_prefix := @exec_prefix@
17export includedir := @includedir@
18export libdir := @libdir@
Tristan Matthews0a329cc2013-07-17 13:20:14 -040019
20LIB_SUFFIX = $(TARGET_NAME).a
21
Alexandre Lision8af73cb2013-12-10 14:11:20 -050022ifeq (@ac_shared_libraries@,1)
23export PJ_SHARED_LIBRARIES := 1
24endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -040025
Alexandre Lision8af73cb2013-12-10 14:11:20 -050026# Determine which party libraries to use
27export APP_THIRD_PARTY_EXT :=
28export APP_THIRD_PARTY_LIBS :=
Alexandre Lision0e143012014-01-22 11:02:46 -050029export APP_THIRD_PARTY_LIB_FILES := $(PJ_DIR)/third_party/lib/libmilenage-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050030ifeq ($(PJ_SHARED_LIBRARIES),)
Alexandre Lision0e143012014-01-22 11:02:46 -050031APP_THIRD_PARTY_LIBS += -lmilenage-$(TARGET_NAME)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050032else
Alexandre Lision0e143012014-01-22 11:02:46 -050033APP_THIRD_PARTY_LIBS += -lmilenage
34APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libmilenage.$(SHLIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050035endif
36
Alexandre Lision0e143012014-01-22 11:02:46 -050037ifeq (@ac_external_srtp@,1)
38# External SRTP library
39APP_THIRD_PARTY_EXT += -lsrtp
40else
41APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libsrtp-$(LIB_SUFFIX)
42ifeq ($(PJ_SHARED_LIBRARIES),)
43APP_THIRD_PARTY_LIBS += -lsrtp-$(TARGET_NAME)
44else
45APP_THIRD_PARTY_LIBS += -lsrtp
46APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libsrtp.$(SHLIB_SUFFIX)
47endif
48endif
49
50ifeq (@ac_pjmedia_resample@,libresample)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050051APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX)
52ifeq ($(PJ_SHARED_LIBRARIES),)
Tristan Matthews0a329cc2013-07-17 13:20:14 -040053ifeq (@ac_resample_dll@,1)
54export PJ_RESAMPLE_DLL := 1
Alexandre Lision8af73cb2013-12-10 14:11:20 -050055APP_THIRD_PARTY_LIBS += -lresample
56APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX)
Tristan Matthews0a329cc2013-07-17 13:20:14 -040057else
Alexandre Lision8af73cb2013-12-10 14:11:20 -050058APP_THIRD_PARTY_LIBS += -lresample-$(TARGET_NAME)
59endif
60else
61APP_THIRD_PARTY_LIBS += -lresample
62APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFIX)
Tristan Matthews0a329cc2013-07-17 13:20:14 -040063endif
Alexandre Lision0e143012014-01-22 11:02:46 -050064endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -040065
66ifneq (@ac_no_gsm_codec@,1)
67ifeq (@ac_external_gsm@,1)
68# External GSM library
69APP_THIRD_PARTY_EXT += -lgsm
70else
Tristan Matthews0a329cc2013-07-17 13:20:14 -040071APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050072ifeq ($(PJ_SHARED_LIBRARIES),)
73APP_THIRD_PARTY_LIBS += -lgsmcodec-$(TARGET_NAME)
74else
75APP_THIRD_PARTY_LIBS += -lgsmcodec
76APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libgsmcodec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libgsmcodec.$(SHLIB_SUFFIX)
77endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -040078endif
79endif
80
81ifneq (@ac_no_speex_codec@,1)
82ifeq (@ac_external_speex@,1)
83APP_THIRD_PARTY_EXT += -lspeex -lspeexdsp
84else
Tristan Matthews0a329cc2013-07-17 13:20:14 -040085APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050086ifeq ($(PJ_SHARED_LIBRARIES),)
87APP_THIRD_PARTY_LIBS += -lspeex-$(TARGET_NAME)
88else
89APP_THIRD_PARTY_LIBS += -lspeex
90APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libspeex.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libspeex.$(SHLIB_SUFFIX)
91endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -040092endif
93endif
94
95ifneq (@ac_no_ilbc_codec@,1)
Tristan Matthews0a329cc2013-07-17 13:20:14 -040096APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libilbccodec-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -050097ifeq ($(PJ_SHARED_LIBRARIES),)
98APP_THIRD_PARTY_LIBS += -lilbccodec-$(TARGET_NAME)
99else
100APP_THIRD_PARTY_LIBS += -lilbccodec
101APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libilbccodec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libilbccodec.$(SHLIB_SUFFIX)
102endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400103endif
104
105ifneq (@ac_no_g7221_codec@,1)
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400106APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libg7221codec-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500107ifeq ($(PJ_SHARED_LIBRARIES),)
108APP_THIRD_PARTY_LIBS += -lg7221codec-$(TARGET_NAME)
109else
110APP_THIRD_PARTY_LIBS += -lg7221codec
111APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libg7221codec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libg7221codec.$(SHLIB_SUFFIX)
112endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400113endif
114
115ifneq ($(findstring pa,@ac_pjmedia_snd@),)
116ifeq (@ac_external_pa@,1)
117# External PA
118APP_THIRD_PARTY_EXT += -lportaudio
119else
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400120APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio-$(LIB_SUFFIX)
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500121ifeq ($(PJ_SHARED_LIBRARIES),)
122APP_THIRD_PARTY_LIBS += -lportaudio-$(TARGET_NAME)
123else
124APP_THIRD_PARTY_LIBS += -lportaudio
125APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libportaudio.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libportaudio.$(SHLIB_SUFFIX)
126endif
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400127endif
128endif
129
130# Additional flags
131@ac_build_mak_vars@
132
133#
134# Video
135# Note: there are duplicated macros in pjmedia/os-auto.mak.in (and that's not
136# good!
137
138# SDL flags
139SDL_CFLAGS = @ac_sdl_cflags@
140SDL_LDFLAGS = @ac_sdl_ldflags@
141
142# FFMPEG dlags
143FFMPEG_CFLAGS = @ac_ffmpeg_cflags@
144FFMPEG_LDFLAGS = @ac_ffmpeg_ldflags@
145
146# Video4Linux2
147V4L2_CFLAGS = @ac_v4l2_cflags@
148V4L2_LDFLAGS = @ac_v4l2_ldflags@
149
150# QT
151AC_PJMEDIA_VIDEO_HAS_QT = @ac_pjmedia_video_has_qt@
152QT_CFLAGS = @ac_qt_cflags@
153
154# iOS
155IOS_CFLAGS = @ac_ios_cflags@
156
157# PJMEDIA features exclusion
158PJ_VIDEO_CFLAGS += $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \
159 $(IOS_CFLAGS)
160PJ_VIDEO_LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS)
161
162
163# CFLAGS, LDFLAGS, and LIBS to be used by applications
164export APP_CC := @CC@
165export APP_CXX := @CXX@
166export APP_CFLAGS := -DPJ_AUTOCONF=1\
167 @CFLAGS@\
168 $(PJ_VIDEO_CFLAGS) \
169 -I$(PJDIR)/pjlib/include\
170 -I$(PJDIR)/pjlib-util/include\
171 -I$(PJDIR)/pjnath/include\
172 -I$(PJDIR)/pjmedia/include\
173 -I$(PJDIR)/pjsip/include
174export APP_CXXFLAGS := $(APP_CFLAGS)
Alexandre Lision67916dd2014-01-24 13:33:04 -0500175# 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
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400182export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\
183 -L$(PJDIR)/pjlib-util/lib\
184 -L$(PJDIR)/pjnath/lib\
185 -L$(PJDIR)/pjmedia/lib\
186 -L$(PJDIR)/pjsip/lib\
187 -L$(PJDIR)/third_party/lib\
188 $(PJ_VIDEO_LDFLAGS) \
Alexandre Lision67916dd2014-01-24 13:33:04 -0500189 -static-libstdc++ \
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400190 @LDFLAGS@
Alexandre Lision0e143012014-01-22 11:02:46 -0500191
Alexandre Lision67916dd2014-01-24 13:33:04 -0500192# 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
Alexandre Lision0e143012014-01-22 11:02:46 -0500199export APP_LIB_FILES = \
Alexandre Lision67916dd2014-01-24 13:33:04 -0500200 $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) \
Alexandre Lision0e143012014-01-22 11:02:46 -0500201 $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400202 $(PJ_DIR)/pjsip/lib/libpjsip-ua-$(LIB_SUFFIX) \
203 $(PJ_DIR)/pjsip/lib/libpjsip-simple-$(LIB_SUFFIX) \
204 $(PJ_DIR)/pjsip/lib/libpjsip-$(LIB_SUFFIX) \
205 $(PJ_DIR)/pjmedia/lib/libpjmedia-codec-$(LIB_SUFFIX) \
206 $(PJ_DIR)/pjmedia/lib/libpjmedia-videodev-$(LIB_SUFFIX) \
207 $(PJ_DIR)/pjmedia/lib/libpjmedia-$(LIB_SUFFIX) \
208 $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev-$(LIB_SUFFIX) \
209 $(PJ_DIR)/pjnath/lib/libpjnath-$(LIB_SUFFIX) \
210 $(PJ_DIR)/pjlib-util/lib/libpjlib-util-$(LIB_SUFFIX) \
211 $(APP_THIRD_PARTY_LIB_FILES) \
212 $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX)
213
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500214ifeq ($(PJ_SHARED_LIBRARIES),)
215export PJLIB_LDLIB := -lpj-$(TARGET_NAME)
216export PJLIB_UTIL_LDLIB := -lpjlib-util-$(TARGET_NAME)
217export PJNATH_LDLIB := -lpjnath-$(TARGET_NAME)
218export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev-$(TARGET_NAME)
219export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev-$(TARGET_NAME)
220export PJMEDIA_LDLIB := -lpjmedia-$(TARGET_NAME)
221export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec-$(TARGET_NAME)
222export PJSIP_LDLIB := -lpjsip-$(TARGET_NAME)
223export PJSIP_SIMPLE_LDLIB := -lpjsip-simple-$(TARGET_NAME)
224export PJSIP_UA_LDLIB := -lpjsip-ua-$(TARGET_NAME)
225export PJSUA_LIB_LDLIB := -lpjsua-$(TARGET_NAME)
Alexandre Lision0e143012014-01-22 11:02:46 -0500226export PJSUA2_LIB_LDLIB := -lpjsua2-$(TARGET_NAME)
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500227else
228export PJLIB_LDLIB := -lpj
229export PJLIB_UTIL_LDLIB := -lpjlib-util
230export PJNATH_LDLIB := -lpjnath
231export PJMEDIA_AUDIODEV_LDLIB := -lpjmedia-audiodev
232export PJMEDIA_VIDEODEV_LDLIB := -lpjmedia-videodev
233export PJMEDIA_LDLIB := -lpjmedia
234export PJMEDIA_CODEC_LDLIB := -lpjmedia-codec
235export PJSIP_LDLIB := -lpjsip
236export PJSIP_SIMPLE_LDLIB := -lpjsip-simple
237export PJSIP_UA_LDLIB := -lpjsip-ua
238export PJSUA_LIB_LDLIB := -lpjsua
Alexandre Lision0e143012014-01-22 11:02:46 -0500239export PJSUA2_LIB_LDLIB := -lpjsua2
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500240
Alexandre Lision67916dd2014-01-24 13:33:04 -0500241APP_LIB_FILES += $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsua.$(SHLIB_SUFFIX) \
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500242 $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-ua.$(SHLIB_SUFFIX) \
243 $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip-simple.$(SHLIB_SUFFIX) \
244 $(PJ_DIR)/pjsip/lib/libpjsip.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjsip/lib/libpjsip.$(SHLIB_SUFFIX) \
245 $(PJ_DIR)/pjmedia/lib/libpjmedia-codec.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-codec.$(SHLIB_SUFFIX) \
246 $(PJ_DIR)/pjmedia/lib/libpjmedia-videodev.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-videodev.$(SHLIB_SUFFIX) \
247 $(PJ_DIR)/pjmedia/lib/libpjmedia.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia.$(SHLIB_SUFFIX) \
248 $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev.$(SHLIB_SUFFIX) \
249 $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjnath/lib/libpjnath.$(SHLIB_SUFFIX) \
250 $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib-util/lib/libpjlib-util.$(SHLIB_SUFFIX) \
251 $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/pjlib/lib/libpj.$(SHLIB_SUFFIX)
252endif
253
Alexandre Lision67916dd2014-01-24 13:33:04 -0500254export APP_LDLIBS := $(PJSUA2_LIB_LDLIB) \
255 $(PJSUA_LIB_LDLIB) \
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500256 $(PJSIP_UA_LDLIB) \
257 $(PJSIP_SIMPLE_LDLIB) \
258 $(PJSIP_LDLIB) \
259 $(PJMEDIA_CODEC_LDLIB) \
260 $(PJMEDIA_LDLIB) \
261 $(PJMEDIA_VIDEODEV_LDLIB) \
262 $(PJMEDIA_AUDIODEV_LDLIB) \
263 $(PJNATH_LDLIB) \
264 $(PJLIB_UTIL_LDLIB) \
265 $(APP_THIRD_PARTY_LIBS)\
266 $(APP_THIRD_PARTY_EXT)\
267 $(PJLIB_LDLIB) \
268 @LIBS@
269
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400270# Here are the variabels to use if application is using the library
271# from within the source distribution
272export PJ_CC := $(APP_CC)
273export PJ_CXX := $(APP_CXX)
274export PJ_CFLAGS := $(APP_CFLAGS)
275export PJ_CXXFLAGS := $(APP_CXXFLAGS)
276export PJ_LDFLAGS := $(APP_LDFLAGS)
277export PJ_LDLIBS := $(APP_LDLIBS)
278export PJ_LIB_FILES := $(APP_LIB_FILES)
279
280# And here are the variables to use if application is using the
281# library from the install location (i.e. --prefix)
282export PJ_INSTALL_DIR := @prefix@
Alexandre Lision8af73cb2013-12-10 14:11:20 -0500283export PJ_INSTALL_INC_DIR := @includedir@
284export PJ_INSTALL_LIB_DIR := @libdir@
Tristan Matthews0a329cc2013-07-17 13:20:14 -0400285export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
286export PJ_INSTALL_CXXFLAGS := $(PJ_INSTALL_CFLAGS)
287export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)