Add --disable-pjsua2 option for targets which lacks C++ (#2630)

This commit is contained in:
Alex Kalmuk 2021-01-28 05:45:32 +03:00 committed by GitHub
parent da33d931cb
commit 974cb47351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 6 deletions

View File

@ -121,8 +121,10 @@ cmp_wav:
install:
mkdir -p $(DESTDIR)$(libdir)/
# cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/
cp -af $(APP_LIBXX_FILES) $(DESTDIR)$(libdir)/
cp -af $(APP_LIB_FILES) $(DESTDIR)$(libdir)/
if [ "$(PJ_EXCLUDE_PJSUA2)x" = "x" ] ; then \
cp -af $(PJ_DIR)/pjsip/lib/libpjsua2-$(LIB_SUFFIX) $(DESTDIR)$(libdir)/; \
fi
mkdir -p $(DESTDIR)$(includedir)/
for d in pjlib pjlib-util pjnath pjmedia pjsip; do \
cp -RLf $$d/include/* $(DESTDIR)$(includedir)/; \
@ -145,5 +147,5 @@ uninstall:
done; \
done
rmdir $(DESTDIR)$(includedir) 2> /dev/null || true
$(RM) $(addprefix $(DESTDIR)$(libdir)/,$(notdir $(APP_LIB_FILES)))
$(RM) $(addprefix $(DESTDIR)$(libdir)/,$(notdir $(APP_LIBXX_FILES)))
rmdir $(DESTDIR)$(libdir) 2> /dev/null || true

View File

@ -700,6 +700,7 @@ ac_external_srtp_lib
ac_external_srtp
ac_external_gsm
ac_external_speex
ac_no_pjsua2
ac_shared_libraries
ac_linux_poll
ac_os_objs
@ -791,6 +792,7 @@ enable_option_checking
enable_floating_point
enable_epoll
enable_shared
enable_pjsua2
with_external_speex
with_external_gsm
with_external_srtp
@ -1473,6 +1475,8 @@ Optional Features:
Disable floating point where possible
--enable-epoll Use /dev/epoll ioqueue on Linux (experimental)
--enable-shared Build shared libraries
--disable-pjsua2 Exclude pjsua2 library and application from the
build
--disable-resample Disable resampling implementations
--disable-sound Exclude sound (i.e. use null sound)
--disable-video Disable video feature
@ -5942,6 +5946,21 @@ fi
# Check whether --enable-pjsua2 was given.
if test "${enable_pjsua2+set}" = set; then :
enableval=$enable_pjsua2; if test "$enable_pjsua2" = "no"; then
ac_no_pjsua2=1
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building pjsua2 library and application... no" >&5
$as_echo "Building pjsua2 library and application... no" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building pjsua2 library and application... yes" >&5
$as_echo "Building pjsua2 library and application... yes" >&6; }
fi
case $target in
*mingw* | *cygw* | *win32* | *w32* )
ac_os_objs="$ac_os_objs file_access_win32.o file_io_win32.o os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o sock_qos_bsd.o unicode_win32.o"

View File

@ -468,6 +468,17 @@ AC_ARG_ENABLE(shared,
AC_MSG_RESULT([Building shared libraries... no])
)
AC_SUBST(ac_no_pjsua2)
AC_ARG_ENABLE(pjsua2,
AS_HELP_STRING([--disable-pjsua2],
[Exclude pjsua2 library and application from the build]),
[if test "$enable_pjsua2" = "no"; then
[ac_no_pjsua2=1]
AC_MSG_RESULT([Building pjsua2 library and application... no])
fi],
AC_MSG_RESULT([Building pjsua2 library and application... yes])
)
dnl ######################
dnl # OS specific files

View File

@ -24,6 +24,10 @@ ifeq (@ac_shared_libraries@,1)
export PJ_SHARED_LIBRARIES := 1
endif
ifeq (@ac_no_pjsua2@,1)
export PJ_EXCLUDE_PJSUA2 := 1
endif
ifndef EXCLUDE_APP
ifeq ($(findstring android,$(TARGET_NAME)),)
export EXCLUDE_APP := 0
@ -289,6 +293,10 @@ APP_LIBXX_FILES += $(PJ_DIR)/pjsip/lib/libpjsua2.$(SHLIB_SUFFIX).$(PJ_VERSION_MA
$(ADD_LIB_FILES)
endif
ifeq ($(PJ_EXCLUDE_PJSUA2),1)
export PJSUA2_LIB_LDLIB :=
endif
export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \
$(PJSIP_UA_LDLIB) \
$(PJSIP_SIMPLE_LDLIB) \

View File

@ -55,6 +55,10 @@ EXES := $(foreach file, $(SAMPLES), $(file)$(HOST_EXE))
PJSUA2_EXES := $(foreach file, $(PJSUA2_SAMPLES), $(file)$(HOST_EXE))
endif
ifeq ($(PJ_EXCLUDE_PJSUA2),1)
PJSUA2_EXES :=
endif
.PHONY: $(EXES)
.PHONY: $(PJSUA2_EXES)

View File

@ -208,9 +208,13 @@ export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
TARGETS := $(PJSIP_LIB) $(PJSIP_SONAME) \
$(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) \
$(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) \
$(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) \
$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME)
TARGETS_EXE := $(TEST_EXE) $(PJSUA2_TEST_EXE)
$(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME)
TARGETS_EXE := $(TEST_EXE)
ifeq ($(PJ_EXCLUDE_PJSUA2),)
TARGETS += $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME)
TARGETS_EXE += $(PJSUA2_TEST_EXE)
endif
all: $(TARGETS) $(TARGETS_EXE)