freeswitch-stable: backport pcre fix
[feed/telephony.git] / net / freeswitch-stable / Makefile
index 9124ca8d7a42bac77e96d3f87a70cacace13fe7c..c416b60d0dd7092c6320ecc2d96b7de9a559d663 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PRG_NAME:=freeswitch
 PKG_NAME:=$(PRG_NAME)-stable
 PKG_VERSION:=1.6.20
-PKG_RELEASE:=4
+PKG_RELEASE:=8
 PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
 
 PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).tar.xz
@@ -218,7 +218,7 @@ FS_STABLE_MOD_AVAILABLE:= \
        yuv
 
 PKG_CONFIG_DEPENDS:= \
-       $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_STABLE_MOD_AVAILABLE)) \
+       $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(subst _,-,$(FS_STABLE_MOD_AVAILABLE))) \
        CONFIG_FS_STABLE_WITH_DEBUG \
        CONFIG_FS_STABLE_WITH_FREETYPE \
        CONFIG_FS_STABLE_WITH_LIBYUV \
@@ -237,7 +237,21 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl \
        CONFIG_SOFT_FLOAT
 
+include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
+# iconv support
+include $(INCLUDE_DIR)/nls.mk
+#######################################################
+# mod_gsmopen can't detect if iconv's inbuf is const. #
+#                                                     #
+#                  musl    uclibc                     #
+# libiconv-stub    -       -                          #
+# libiconv-full    -       const                      #
+#                                                     #
+#######################################################
+ifeq ($(ICONV_FULL)$(CONFIG_USE_UCLIBC),1y)
+TARGET_CFLAGS+=-DFS_STABLE_ICONV_INBUF_CONST
+endif
 
 FS_STABLE_PERL_FEED:=$(TOPDIR)/feeds/packages/lang/perl
 
@@ -250,14 +264,6 @@ FS_STABLE_PERL_LIBS:=$(shell grep "^libs=" \
 
 FS_STABLE_PYTHON_SITE_DIR:=$(FS_STABLE_LIB_DIR)/python$(PYTHON_VERSION)/site-packages
 
-# musl and glibc include their own iconv, but uclibc does not
-ifneq ($(CONFIG_USE_UCLIBC),)
-TARGET_CPPFLAGS+= \
-       -I$(STAGING_DIR)/usr/lib/libiconv-full/include
-TARGET_LDFLAGS += \
-       -L$(STAGING_DIR)/usr/lib/libiconv-full/lib
-endif
-
 define Download/files
 define Download/$(1)
   FILE:=$(2)
@@ -331,19 +337,19 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(FTDM))
 endef
 
 define Package/$(PKG_LIBFTDM)/FTModule
-define Package/$(PKG_LIBFTDM)-ftmod-$(1)
+define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))
 $(call Package/$(PKG_LIBFTDM)/Default)
-  DEPENDS:=PACKAGE_$(PKG_LIBFTDM)-ftmod-$(1):$(PKG_LIBFTDM) \
-         $(patsubst +%,+PACKAGE_$(PKG_LIBFTDM)-ftmod-$(1):%,$(4))
+  DEPENDS:=PACKAGE_$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1)):$(PKG_LIBFTDM) \
+         $(patsubst +%,+PACKAGE_$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1)):%,$(4))
   TITLE:=$(2) FreeTDM module
 endef
-define Package/$(PKG_LIBFTDM)-ftmod-$(1)/description
+define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))/description
 $(subst \n,$(newline),$(3))
 endef
-define Package/$(PKG_LIBFTDM)-ftmod-$(1)/install
+define Package/$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))/install
 $(call Package/$(PKG_LIBFTDM)/install/ftmod,$$(1),$(1))
 endef
-$$(eval $$(call BuildPackage,$(PKG_LIBFTDM)-ftmod-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_LIBFTDM)-ftmod-$(subst _,-,$(1))))
 endef
 
 define Package/$(PKG_NAME)/Default
@@ -359,11 +365,12 @@ $(call Package/$(PKG_NAME)/Default)
   MENU:=1
   USERID:=$(PRG_NAME)=372:$(PRG_NAME)=372
   DEPENDS:= \
+         $(CXX_DEPENDS) \
+         $(ICONV_DEPENDS) \
          +FS_STABLE_WITH_FREETYPE:libfreetype \
          +FS_STABLE_WITH_ODBC:unixodbc \
          +FS_STABLE_WITH_PGSQL:libpq \
          +FS_STABLE_WITH_PNG:libpng \
-         +USE_UCLIBC:libiconv-full \
          +libcurl \
          +libedit \
          +libopenssl \
@@ -373,7 +380,6 @@ $(call Package/$(PKG_NAME)/Default)
          +libspeex \
          +libspeexdsp \
          +libsqlite3 \
-         +libstdcpp \
          +libuuid \
          +zlib
   CONFLICTS:=$(PRG_NAME)
@@ -531,45 +537,45 @@ define Package/$(PKG_NAME)-misc-timezones/install
 endef
 
 define Package/$(PKG_NAME)/Example
-define Package/$(PKG_NAME)-example-$(1)
+define Package/$(PKG_NAME)-example-$(subst _,-,$(1))
 $(call Package/$(PKG_NAME)/Default)
   TITLE:=Example configuration
   DEPENDS:=$(PKG_NAME)
   PKGARCH:=all
 endef
-define Package/$(PKG_NAME)-example-$(1)/description
+define Package/$(PKG_NAME)-example-$(subst _,-,$(1))/description
 This package does not install any configuration for FreeSWITCH into
 /etc/freeswitch. The system administrator is completely responsible
 for that directory. If you install one of the example configuration
 packages, it will install the corresponding sample configuration to
 /usr/share/freeswitch/examples where you can take a look at it.
 endef
-define Package/$(PKG_NAME)-example-$(1)/install
+define Package/$(PKG_NAME)-example-$(subst _,-,$(1))/install
 $(call Package/$(PKG_NAME)/install/dir,$$(1)$(FS_STABLE_EXAMPLES_DIR)/$(1),$(PKG_BUILD_DIR)/conf/$(1))
 endef
-$$(eval $$(call BuildPackage,$(PKG_NAME)-example-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_NAME)-example-$(subst _,-,$(1))))
 endef
 
 define Package/$(PKG_NAME)/Language
-define Package/$(PKG_NAME)-lang-$(1)
+define Package/$(PKG_NAME)-lang-$(subst _,-,$(1))
 $(call Package/$(PKG_NAME)/Default)
   TITLE:=$(2) language files
   DEPENDS:=$(PKG_NAME)
   PKGARCH:=all
 endef
-define Package/$(PKG_NAME)-lang-$(1)/description
+define Package/$(PKG_NAME)-lang-$(subst _,-,$(1))/description
 This package includes the $(2) language files for FreeSWITCH.
 endef
-define Package/$(PKG_NAME)-lang-$(1)/install
+define Package/$(PKG_NAME)-lang-$(subst _,-,$(1))/install
 $(call Package/$(PKG_NAME)/install/dir,$$(1)$(FS_STABLE_LANG_DIR)/$(1),$(PKG_BUILD_DIR)/conf/vanilla/lang/$(1))
 endef
-$$(eval $$(call BuildPackage,$(PKG_NAME)-lang-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_NAME)-lang-$(subst _,-,$(1))))
 endef
 
 # The next package generator is for miscellaneous files that only
 # require being copied from PKG_INSTALL_DIR to the ipkg.
 define Package/$(PKG_NAME)/Misc
-define Package/$(PKG_NAME)-$(1)
+define Package/$(PKG_NAME)-$(subst _,-,$(1))
 $(call Package/$(PKG_NAME)/Default)
   TITLE:=$(2)
   DEPENDS:=$(PKG_NAME)
@@ -577,25 +583,25 @@ $(call Package/$(PKG_NAME)/Default)
   PKGARCH:=all
   endif
 endef
-define Package/$(PKG_NAME)-$(1)/description
+define Package/$(PKG_NAME)-$(subst _,-,$(1))/description
 $(subst \n,$(newline),$(3))
 endef
-define Package/$(PKG_NAME)-$(1)/install
+define Package/$(PKG_NAME)-$(subst _,-,$(1))/install
 $(call Package/$(PKG_NAME)/install/dir,$$(1)$(5),$(PKG_INSTALL_DIR)$(4))
 endef
-$$(eval $$(call BuildPackage,$(PKG_NAME)-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_NAME)-$(subst _,-,$(1))))
 endef
 
 define Package/$(PKG_NAME)/Module
-define Package/$(PKG_NAME)-mod-$(1)
+define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))
 $(call Package/$(PKG_NAME)/Default)
   TITLE:=$(2) module
-  DEPENDS:=$(PKG_NAME) $(patsubst +%,+PACKAGE_$(PKG_NAME)-mod-$(1):%,$(4))
+  DEPENDS:=$(PKG_NAME) $(patsubst +%,+PACKAGE_$(PKG_NAME)-mod-$(subst _,-,$(1)):%,$(4))
 endef
-define Package/$(PKG_NAME)-mod-$(1)/description
+define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))/description
 $(subst \n,$(newline),$(3))
 endef
-define Package/$(PKG_NAME)-mod-$(1)/install
+define Package/$(PKG_NAME)-mod-$(subst _,-,$(1))/install
 $(call Package/$(PKG_NAME)/install/mod,$$(1),$(1))
 ifeq ($(CONFIG_FS_STABLE_WITH_MODCONF),y)
 $(call Package/$(PKG_NAME)/install/dir,$$(1)$(FS_STABLE_EXAMPLES_DIR)/mod_$(1),$(PKG_BUILD_DIR)/src/mod/*/mod_$(1)/conf)
@@ -616,25 +622,25 @@ ifeq ($(1),python)
                                        $$(1)$(FS_STABLE_PYTHON_SITE_DIR)
 endif
 endef
-$$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(subst _,-,$(1))))
 endef
 
 define Package/$(PKG_NAME)/Util
-define Package/$(PKG_NAME)-util-$(1)
+define Package/$(PKG_NAME)-util-$(subst _,-,$(1))
 $(call Package/$(PKG_NAME)/Default)
   TITLE:=$(2) utility
-  DEPENDS:=$(PKG_NAME) $(patsubst +%,+PACKAGE_$(PKG_NAME)-util-$(1):%,$(4))
+  DEPENDS:=$(PKG_NAME) $(patsubst +%,+PACKAGE_$(PKG_NAME)-util-$(subst _,-,$(1)):%,$(4))
   ifeq ($(5),y)
   PKGARCH:=all
   endif
 endef
-define Package/$(PKG_NAME)-util-$(1)/description
+define Package/$(PKG_NAME)-util-$(subst _,-,$(1))/description
 $(subst \n,$(newline),$(3))
 endef
-define Package/$(PKG_NAME)-util-$(1)/install
+define Package/$(PKG_NAME)-util-$(subst _,-,$(1))/install
 $(call Package/$(PKG_NAME)/install/bin,$$(1),$(1))
 endef
-$$(eval $$(call BuildPackage,$(PKG_NAME)-util-$(1)))
+$$(eval $$(call BuildPackage,$(PKG_NAME)-util-$(subst _,-,$(1))))
 endef
 
 CONFIGURE_ARGS+= \
@@ -673,7 +679,7 @@ CONFIGURE_ARGS+= \
        --with-python=no
 endif
 
-ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang_event)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-kazoo),)
+ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-kazoo),)
 CONFIGURE_ARGS+= \
        --with-erlang=no
 endif
@@ -741,9 +747,9 @@ CONFIGURE_VARS+= \
        PERL="$(PERL_CMD)" \
        PERL_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -I$(STAGING_DIR)$(PERL_SITELIB)/CORE" \
        PERL_INC="-I$(STAGING_DIR)$(PERL_SITELIB)/CORE" \
-       PERL_LDFLAGS="$(FPIC) -Wl,-rpath,$(PERL_SITELIB)/CORE -L$(STAGING_DIR)$(PERL_SITELIB)/CORE -lperl" \
+       PERL_LDFLAGS="-Wl,-rpath,$(PERL_SITELIB)/CORE -L$(STAGING_DIR)$(PERL_SITELIB)/CORE -lperl" \
        PERL_LIBDIR="-L$(PERL_SITELIB)/CORE" \
-       PERL_LIBS="-lpthread $(FS_STABLE_PERL_LIBS) $(EXTRA_LIBDIRS:%=-L%) $(EXTRA_LIBS:%=-l%)" \
+       PERL_LIBS="$(FS_STABLE_PERL_LIBS) $(EXTRA_LIBDIRS:%=-L%) $(EXTRA_LIBS:%=-l%)" \
        PERL_SITEDIR="$(PERL_SITELIB)"
 else
 CONFIGURE_VARS+= \
@@ -754,7 +760,7 @@ endif
 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-python),)
 CONFIGURE_VARS+= \
        PYTHON_CFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION)" \
-       PYTHON_LDFLAGS="-lpython$(PYTHON_VERSION) -ldl -lpthread -lm -Xlinker -export-dynamic" \
+       PYTHON_LDFLAGS="-lpython$(PYTHON_VERSION)" \
        PYTHON_LIB="python$(PYTHON_VERSION)" \
        PYTHON_LIBDIR="$(FS_STABLE_LIB_DIR)" \
        PYTHON_SITE_DIR="$(FS_STABLE_PYTHON_SITE_DIR)"
@@ -877,7 +883,7 @@ FS_STABLE_FREERADIUS_CLIENT_HASH:=3fc609af328258e00345389d5478b099fe4ea3ad694d04
 FS_STABLE_V8_FILE:=v8-3.24.14.tar.bz2
 FS_STABLE_V8_HASH:=395f4eaf5580b973b1e33fe0aa27f8d013ddf1b163ad76992c50dd91ff182828
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event_zmq),)
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
 $(eval $(call Download/files,zmq,$(FS_STABLE_ZEROMQ_FILE),$(FS_STABLE_ZEROMQ_URL),$(FS_STABLE_ZEROMQ_HASH)))
 endif
 
@@ -887,7 +893,7 @@ $(eval $(call Download/files,sphinxbase,$(FS_STABLE_SPHINXBASE_FILE),$(FS_STABLE
 $(eval $(call Download/files,communicator,$(FS_STABLE_SPHINXMODEL_FILE),$(FS_STABLE_LIBS_URL),$(FS_STABLE_SPHINXMODEL_HASH)))
 endif
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-radius_cdr),)
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-radius-cdr),)
 $(eval $(call Download/files,freeradius-client,$(FS_STABLE_FREERADIUS_CLIENT_FILE),$(FS_STABLE_LIBS_URL),$(FS_STABLE_FREERADIUS_CLIENT_HASH)))
 endif
 
@@ -910,14 +916,14 @@ define Build/Prepare
        echo '#codecs/mod_yuv' >> $(PKG_BUILD_DIR)/modules.conf
        echo '#event_handlers/mod_event_test' >> $(PKG_BUILD_DIR)/modules.conf
 
-       $(SED) 's|$(FS_STABLE_ANCHOR)|APR_SETVAR(LDFLAGS,$(FS_STABLE_APR_LIBS) $(TARGET_LDFLAGS))|' \
+       $(SED) 's|$(FS_STABLE_ANCHOR)|APR_SETVAR(LDFLAGS,[$(FS_STABLE_APR_LIBS) $(TARGET_LDFLAGS)])|' \
                $(PKG_BUILD_DIR)/libs/unimrcp/build/acmacros/apr.m4
 endef
 
 define Build/Configure
        $(SED) '/^#/!s/^/#/' $(PKG_BUILD_DIR)/modules.conf
        $(foreach m,$(FS_STABLE_MOD_AVAILABLE),
-               $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
+               $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(subst _,-,$(m))),
                $(SED) '/mod_$(m)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf))
 
 # Hack for misc-grammar - needs mod_pocketsphinx to provide grammar files
@@ -946,7 +952,7 @@ endef
 
 define Build/Compile
 # Copy some source files if certain modules are selected
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event_zmq),)
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
        $(CP) $(DL_DIR)/$(FS_STABLE_ZEROMQ_FILE) $(PKG_BUILD_DIR)/libs
 endif
 
@@ -956,7 +962,7 @@ ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-pocketsphinx)$(CONFIG_PACKAGE_$(PKG_NAME
        $(CP) $(DL_DIR)/$(FS_STABLE_SPHINXMODEL_FILE) $(PKG_BUILD_DIR)/libs
 endif
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-radius_cdr),)
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-radius-cdr),)
        $(CP) $(DL_DIR)/$(FS_STABLE_FREERADIUS_CLIENT_FILE) $(PKG_BUILD_DIR)/libs
 endif
 
@@ -1141,7 +1147,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,esl,Single ESL,This module adds an API
 $(eval $(call Package/$(PKG_NAME)/Module,event_multicast,Multicast Event,Multicast Event System for FreeSWITCH.,))
 $(eval $(call Package/$(PKG_NAME)/Module,event_socket,Event socket,Sends events via a single socket. Needed for fs_cli.,))
 $(eval $(call Package/$(PKG_NAME)/Module,event_test,Event test,Event demo module.,))
-$(eval $(call Package/$(PKG_NAME)/Module,event_zmq,ZMQ event,ZMQ event module.,))
+$(eval $(call Package/$(PKG_NAME)/Module,event_zmq,ZMQ event,ZMQ event module.,@!USE_UCLIBCXX))
 $(eval $(call Package/$(PKG_NAME)/Module,expr,Expr,This module adds expr support for expression evaluation.,))
 $(eval $(call Package/$(PKG_NAME)/Module,fifo,FIFO,This module adds a first-in first-out queue system.,))
 $(eval $(call Package/$(PKG_NAME)/Module,format_cdr,Multiformat CDR,A superset of mod_json_cdr and mod_xml_cdr.,))
@@ -1225,7 +1231,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,tone_stream,Tone stream,Tone generation
 $(eval $(call Package/$(PKG_NAME)/Module,translate,Number translation,This module implements number translation.,))
 $(eval $(call Package/$(PKG_NAME)/Module,tts_commandline,TTS command-line,Run a command-line and play the output file.,))
 $(eval $(call Package/$(PKG_NAME)/Module,unimrcp,UniMRCP,Allows communication with Media Resource Control Protocol servers.,))
-$(eval $(call Package/$(PKG_NAME)/Module,v8,V8,This package contains mod_v8 for FreeSWITCH.,@FS_STABLE_WITH_V8 @arm||i386||mipsel||x86_64))
+$(eval $(call Package/$(PKG_NAME)/Module,v8,V8,This package contains mod_v8 for FreeSWITCH.,@!USE_UCLIBCXX @FS_STABLE_WITH_V8 @arm||i386||mipsel||x86_64))
 $(eval $(call Package/$(PKG_NAME)/Module,valet_parking,Valet parking,This module implements the valet call parking strategy.,))
 $(eval $(call Package/$(PKG_NAME)/Module,verto,Verto,Verto signaling protocol.,))
 $(eval $(call Package/$(PKG_NAME)/Module,vmd,Voicemail detection,This module detects voicemail beeps.,))
@@ -1250,7 +1256,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,yuv,Raw YUV,Raw YUV I420 video codec su
 ################################
 
 $(eval $(call Package/$(PKG_NAME)/Util,fs_cli,CLI,The fs_cli program is a Command-Line Interface that allows a user to\nconnect to a FreeSWITCH instance running on the local or a remote\nsystem.,,n))
-$(eval $(call Package/$(PKG_NAME)/Util,fs_encode,Sound file conversion,Format conversion of sound files so the result can be used by\nmod_native_file.,+$(PKG_NAME)-mod-native_file +$(PKG_NAME)-mod-sndfile +$(PKG_NAME)-mod-spandsp,n))
+$(eval $(call Package/$(PKG_NAME)/Util,fs_encode,Sound file conversion,Format conversion of sound files so the result can be used by\nmod_native_file.,+$(PKG_NAME)-mod-native-file +$(PKG_NAME)-mod-sndfile +$(PKG_NAME)-mod-spandsp,n))
 $(eval $(call Package/$(PKG_NAME)/Util,fs_ivrd,IVR daemon,The FreeSWITCH IVR daemon is an abstraction layer that sits on top of\nthe ESL. The basic idea is that the ivrd will allow the user to have\na STDIN/STDOUT interface for simple call control.,,n))
 $(eval $(call Package/$(PKG_NAME)/Util,gentls_cert,TLS certificate,Can be used to create TLS certificates and setup CAs.,+openssl-util,y))
 $(eval $(call Package/$(PKG_NAME)/Util,tone2wav,Sound file generation,Generates a sound file from a teletone script. The output can be in\nany format that is supported by libsndfile.,+$(PKG_NAME)-mod-sndfile,n))