1. Remove old patches.
Signed-off-by: Mazi Lo <openwrt.mazilo@recursor.net>
+++ /dev/null
---- /dev/null
-+++ b/build/openwrt_rules.mk
-@@ -0,0 +1,7 @@
-+OPENWRT_DIR=$(shell (cd $(BASE)/../../..;pwd))
-+STAGING_PREFIX=$(OPENWRT_DIR)/staging_dir/host
-+STAGING_DIR=$(OPENWRT_DIR)/staging_dir/$(shell (cd $(BASE)/..;basename `pwd`))
-+ARCH="$(shell grep CONFIG_ARCH $(OPENWRT_DIR)/.config|cut -d= -d'"' -f2)"
-+GNU_TARGET_NAME=$(ARCH)-openwrt-linux
-+
-+include $(OPENWRT_DIR)/rules.mk
+++ /dev/null
---- a/build/modules.conf.in
-+++ b/build/modules.conf.in
-@@ -35,6 +35,7 @@ applications/mod_httapi
- #applications/mod_rad_auth
- #applications/mod_redis
- #applications/mod_rss
-+#applications/mod_skel
- #applications/mod_sonar
- applications/mod_sms
- #applications/mod_snapshot
+++ /dev/null
---- a/build/config/erlang.m4
-+++ b/build/config/erlang.m4
-@@ -1,6 +1,6 @@
- AC_DEFUN([CHECK_ERLANG], [
- #
--# Erlang checks for mod_erlang_event
-+# Erlang check
- #
- AC_ARG_WITH(
- [erlang],
-@@ -19,22 +19,23 @@ then
- if test ! -x "$with_erlang" ; then
- AC_MSG_ERROR([Specified erlang does not exist or is not executable: $with_erlang])
- fi
-- AC_MSG_RESULT([$with_erlang])
-- AC_SUBST([ERLANG], ["$with_erlang"])
-+ AC_MSG_RESULT(["$with_erlang/bin/erl"])
-+ AC_SUBST([ERL],["$with_erlang/bin/erl"])
- else
-- AC_PATH_PROG([ERLANG], ["erl"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
-+ AC_ERLANG_NEED_ERL(["$with_erlang/bin"])
- fi
-
-- if test "$ERLANG" != "no" ; then
-+ if test "$ERL" != "no" ; then
- AC_MSG_CHECKING([erlang version])
-- ERLANG_VER="`$ERLANG -version 2>&1 | cut -d' ' -f6`"
-+ ERLANG_VER="`$ERL -version 2>&1 | cut -d' ' -f6`"
-
- if test -z "$ERLANG_VER" ; then
- AC_MSG_ERROR([Unable to detect erlang version])
-+ else
-+ AC_MSG_RESULT([$ERLANG_VER])
- fi
-- AC_MSG_RESULT([$ERLANG_VER])
-
-- ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
-+ ERLANG_LIBDIR=`$ERL -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
- AC_MSG_CHECKING([erlang libdir])
- if test -z "`echo $ERLANG_LIBDIR`" ; then
- AC_MSG_ERROR([failed])
-@@ -42,9 +43,16 @@ then
- ERLANG_LDFLAGS="-L$ERLANG_LIBDIR $ERLANG_LDFLAGS"
- LIBS="-L$ERLANG_LIBDIR $LIBS"
- fi
-+
-+ #
-+ # Don't use the above ERLANG_LDFLAGS
-+ #
-+ ERLANG_LIBDIR="${STAGING_DIR}/usr/lib"
-+ ERLANG_LDFLAGS="-L$ERLANG_LIBDIR"
-+ LIBS="-L$ERLANG_LIBDIR $LIBS"
- AC_MSG_RESULT([$ERLANG_LIBDIR])
-
-- ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
-+ ERLANG_INCDIR=`$ERL -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
- AC_MSG_CHECKING([erlang incdir])
- if test -z "`echo $ERLANG_INCDIR`" ; then
- AC_MSG_ERROR([failed])
-@@ -58,10 +66,11 @@ then
-
- ERLANG_LIB="ei"
-
-- # check liei
-+ # check libei
- AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"])
- # maybe someday ei will actually expose this?
-- AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
-+ # until then, we comment it out
-+ #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
-
- if test "$has_libei" = "no" ; then
- AS_IF([test "$with_erlang" = "try"],
-@@ -75,7 +84,7 @@ then
- )
- else
- ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei"
-- AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
-+ AC_MSG_NOTICE([Your erlang seems OK. You can now use ErLang in your codes.])
- AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS])
- AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
- fi
-@@ -85,12 +94,12 @@ then
-
- else
- AS_IF([test "$with_erlang" = "try"],
-- [AC_MSG_WARN([Could not find erlang, mod_erlang_event will not build, use --with-erlang to specify the location])],
-+ [AC_MSG_WARN([Could not find erlang, codes depend on erlang will not build, use --with-erlang to specify the location])],
- [AC_MSG_ERROR([Could not find erlang, use --with-erlang to specify the location])]
- )
- fi
- else
-- AC_MSG_WARN([erlang support disabled, building mod_erlang_event will fail!])
-+ AC_MSG_WARN([erlang support disabled!])
- fi
-
- ])
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -229,13 +229,16 @@ AX_COMPILER_VENDOR
- if test "x${cross_compiling}" = "xyes"; then
- CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
- case "$host" in
-- arm*-linux-gnueabi*|arm*-*-linux-gnueabi*)
-+ arm*-linux-gnueabi*|arm*-*-linux-*)
- # spandsp modem
- ac_cv_file__dev_ptmx=yes
- # libjs
- export ac_cv_va_copy=yes
-+ # sofia-sip
-+ export ac_cv_dev_urandom=yes
- # srtp
- export ac_cv_file__dev_urandom=yes
-+ export ac_cv_file___dev_urandom_=yes
- # rpl_malloc
- export ac_cv_func_realloc_0_nonnull=yes
- export ac_cv_func_malloc_0_nonnull=yes
-@@ -248,7 +251,7 @@ if test "x${cross_compiling}" = "xyes";
- export apr_cv_mutex_recursive=yes
- export ac_cv_func_pthread_rwlock_init=yes
- export apr_cv_type_rwlock_t=yes
-- export apr_cv_process_shared_works=yes
-+ export apr_cv_process_shared_works=no
- export apr_cv_mutex_robust_shared=yes
- ;;
- esac
-@@ -378,9 +381,6 @@ elif test "x${ax_cv_c_compiler_vendor}"
- elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
- APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
- APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
-- if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then
-- APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
-- fi
- if test "${enable_64}" = "yes"; then
- case "$host" in
- *darwin12.*|*darwin11.*|*darwin10.*|*darwin9.*|*darwin8.*)
-@@ -839,7 +839,6 @@ AC_CHECK_LIB(pthread, pthread_setschedpa
-
- AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
-
--AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
- AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
-
- AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
-@@ -1163,14 +1162,14 @@ case $host in
- ;;
- esac
-
--if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then
-- AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.])
-+if ! test -x "${STAGING_DIR}/../host/bin/pkg-config"; then
-+ AC_MSG_ERROR([Missing tools/pkg-config package needed to configure FreeSWITCH.])
- fi
-
--# temporary workaround for Debian libldns-dev package bug
--if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
-- path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
--fi
-+#
-+# Workaround for OpenWRT pkg-config
-+#
-+path_push_unique PKG_CONFIG_PATH ${STAGING_DIR}/usr/lib/pkg-config
-
- module_enabled() {
- grep -v -e "\#" -e "^\$" modules.conf | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null
-@@ -1191,7 +1190,7 @@ PKG_CHECK_MODULES([LDNS], [libldns >= 1.
- AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns])
- AS_IF([test -z "$LDNS_LIBS"],[
- if module_enabled mod_enum; then
-- AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf])
-+ AC_MSG_ERROR([You need to either install libldns or disable mod_enum in modules.conf])
- else
- AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])
- fi],[
-@@ -1269,18 +1268,18 @@ AM_CONDITIONAL([HAVE_MYSQL],[test "$foun
- # perl checks
- #
-
--AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
--
--# -a "x$ac_cv_have_EXTERN_h" != "xno"
-+AC_CHECK_PROG([PERL],[perl],[ac_cv_have_perl=yes],[ac_cv_have_perl=no],[${STAGING_DIR}/../host/usr/bin])
-+PERL=$as_dir/$ac_word$ac_exec_ext
-
- if test "x$ac_cv_have_perl" != "xno"; then
-- PERL=perl
-- PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
-- PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
-- PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
-- PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
-- PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
-- PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
-+ PERL_SITELIB="/usr/lib/perl5/5.20"
-+ PERL_SITEDIR="${STAGING_DIR}${PERL_SITELIB}"
-+ PERL_COREDIR="${PERL_SITEDIR}/CORE"
-+ PERL_INC="-I${PERL_COREDIR}"
-+ PERL_CFLAGS="-w -DMULTIPLICITY -fwrapv -fno-strict-aliasing -pipe -fstack-protector ${PERL_INC} -DEMBED_PERL"
-+ PERL_LIBDIR="-L${PERL_COREDIR}"
-+ PERL_LIBS="-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc "
-+ PERL_LDFLAGS="${LDFLAGS} -lpthread ${PERL_LIBS}"
-
- save_CFLAGS="$CFLAGS"
- CFLAGS="$PERL_CFLAGS"
-@@ -1293,12 +1292,15 @@ if test "x$ac_cv_have_perl" != "xno"; th
- AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
- LDFLAGS="$save_LDFLAGS"
-
-- AC_SUBST(PERL_SITEDIR)
-- AC_SUBST(PERL_LIBDIR)
-- AC_SUBST(PERL_LIBS)
-+ AC_SUBST(PERL)
- AC_SUBST(PERL_CFLAGS)
-- AC_SUBST(PERL_LDFLAGS)
-+ AC_SUBST(PERL_COREDIR)
- AC_SUBST(PERL_INC)
-+ AC_SUBST(PERL_LDFLAGS)
-+ AC_SUBST(PERL_LIBDIR)
-+ AC_SUBST(PERL_LIBS)
-+ AC_SUBST(PERL_SITEDIR)
-+ AC_SUBST(PERL_SITELIB)
- fi
-
- AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno" -a "x$ac_cv_use_libperl" != "xno"])
-@@ -1307,17 +1309,19 @@ AM_CONDITIONAL([HAVE_PERL],[test "x$ac_c
- # php checks
- #
-
--AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
--AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
-+AC_CHECK_PROG([PHP],[php],[ac_cv_have_php=yes],[ac_cv_have_php=no],[${STAGING_DIR}/../host/usr/bin:/usr/bin])
-+PHP=$as_dir/$ac_word$ac_exec_ext
-+
-+AC_CHECK_PROG([PHP_CONFIG],[php-config],[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no],[${STAGING_DIR}/../host/usr/bin])
-+PHP_CONFIG=$as_dir/$ac_word$ac_exec_ext
-+
- AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
-
- if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
-- PHP=php
-- PHP_CONFIG=php-config
- PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
-- PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`"
-+ PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypt(o|))//g;s/^/-lcrypto/g'`"
- PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
-- PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
-+ PHP_INC_DIR="`$PHP_CONFIG --include-dir`"
- PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
- PHP_CFLAGS="`$PHP_CONFIG --includes`"
- AC_SUBST(PHP_LDFLAGS)
-@@ -1425,6 +1429,7 @@ then
- AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
- AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
- AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
-+ AC_SUBST([PYTHON_LIB], [$PYTHON_LIB])
- fi
- else
- AS_IF([test "$with_python" = "try"],
+++ /dev/null
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,3 +1,7 @@
-+BASE=.
-+
-+include $(BASE)/build/openwrt_rules.mk
-+
- EXTRA_DIST =
- SUBDIRS = . src build
- AUTOMAKE_OPTIONS = foreign subdir-objects
-@@ -172,7 +176,6 @@ ZRTP_LIBS = -lbn -lzrtp
- libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS)
- libfreeswitch_la_LIBADD += $(ZRTP_LIBS)
- CORE_LIBS += libs/libzrtp/libzrtp.a
--LIBS += libs/libzrtp/third_party/bnlib/libbn.a
- endif
-
- library_includedir = $(includedir)
-@@ -311,7 +314,7 @@ endif
- $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf
-
- src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
-- cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
-+ cat $(switch_srcdir)/src/include/switch_cpp.h | $(STAGING_DIR)/../host/usr/bin/perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
- # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \
- # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \
- # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \
-@@ -374,7 +377,7 @@ fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthrea
- nodist_freeswitch_SOURCES = src/include/switch_version.h
- freeswitch_SOURCES = src/switch.c
- freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
--freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
-+freeswitch_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) -lpthread
- freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
-
- if HAVE_ODBC
-@@ -633,7 +636,9 @@ sndfile-reconf:
-
- tiff-reconf:
- cd libs/tiff-4.0.2 && autoreconf -fi
-- cd libs/tiff-4.0.2 && sh ./configure.gnu $(MY_DEFAULT_ARGS)
-+ cd libs/tiff-4.0.2 && sh ./configure.gnu $(MY_DEFAULT_ARGS) --host="$(GNU_TARGET_NAME)" --prefix="/usr"
-+ cd libs/spandsp && autoreconf -fi
-+ cd libs/spandsp && sh ./configure.gnu $(MY_DEFAULT_ARGS) --host="$(GNU_TARGET_NAME)" --prefix="/usr"
- cd libs/tiff-4.0.2 && make
-
- python-reconf:
-@@ -653,9 +658,6 @@ iks-reconf:
- $(MAKE) mod_dingaling-clean
-
- spandsp-reconf: tiff-reconf
-- cd libs/spandsp && $(MAKE) clean || echo
-- cd libs/spandsp && autoreconf -fi
-- cd libs/spandsp && sh ./configure.gnu $(MY_DEFAULT_ARGS)
- cd libs/spandsp && $(MAKE)
-
- sofia-reconf:
+++ /dev/null
---- a/libs/libcodec2/src/Makefile.am
-+++ b/libs/libcodec2/src/Makefile.am
-@@ -88,6 +88,12 @@ codebookge.$(OBJEXT): codebookge.c
-
- codebook.lo: codebook.c
-
-+generate_codebook:
-+ $(CC_FOR_BUILD) -o generate_codebook generate_codebook.c -lm
-+
-+genlspdtcb:
-+ $(CC_FOR_BUILD) -o genlspdtcb genlspdtcb.c -lm
-+
- codebook.c: generate_codebook $(CODEBOOKS)
- ./generate_codebook lsp_cb $(CODEBOOKS) > codebook.c
-
+++ /dev/null
---- a/libs/libzrtp/include/zrtp_config.h
-+++ b/libs/libzrtp/include/zrtp_config.h
-@@ -68,8 +68,16 @@
- * If the byte order is not specified manually in zrtp_config_user.h - try to detect it automatically
- */
- #if !defined(ZRTP_BYTE_ORDER)
-+#if defined(linux) || defined(__linux)
-
--#if defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \
-+#include <endian.h>
-+#if __BYTE_ORDER == __LITTLE_ENDIAN
-+#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN
-+#elif __BYTE_ORDER == __BIG_ENDIAN
-+#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN
-+#endif
-+
-+#elif defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \
- defined(__i386) || defined(_M_IX86) || defined(__I86__)
- /*
- * Generic i386 processor family, little-endian
+++ /dev/null
---- a/libs/sofia-sip/configure.gnu
-+++ b/libs/sofia-sip/configure.gnu
-@@ -1,4 +1,4 @@
- #! /bin/sh
- srcpath=$(dirname $0 2>/dev/null ) || srcpath="."
--$srcpath/configure "$@" --with-pic --with-glib=no --disable-shared --without-doxygen --disable-stun
-+$srcpath/configure "$@" --with-pic --with-glib=no --disable-shared --without-doxygen
-
+++ /dev/null
---- a/libs/spandsp/src/spandsp/fast_convert.h
-+++ b/libs/spandsp/src/spandsp/fast_convert.h
-@@ -195,7 +195,7 @@ extern "C"
- {
- return (long int) (x);
- }
--#elif defined(__ppc__) || defined(__powerpc__)
-+#elif 0 /* defined(__ppc__) || defined(__powerpc__) */
- static __inline__ long int lfastrint(register double x)
- {
- int res[2];
+++ /dev/null
---- a/libs/spandsp/src/t4_rx.c
-+++ b/libs/spandsp/src/t4_rx.c
-@@ -50,7 +50,7 @@
- #include "spandsp/stdbool.h"
- #endif
- #include "floating_fudge.h"
--#include <tiffio.h>
-+#include <tiffiop.h>
-
- #include "spandsp/telephony.h"
- #include "spandsp/alloc.h"
+++ /dev/null
---- a/libs/spandsp/src/t4_tx.c
-+++ b/libs/spandsp/src/t4_tx.c
-@@ -50,7 +50,7 @@
- #include "spandsp/stdbool.h"
- #endif
- #include "floating_fudge.h"
--#include <tiffio.h>
-+#include <tiffiop.h>
-
- #include "spandsp/telephony.h"
- #include "spandsp/alloc.h"
+++ /dev/null
---- a/libs/srtp/configure.ac
-+++ b/libs/srtp/configure.ac
-@@ -130,9 +130,12 @@ if test "$enable_kernel_linux" = "yes";
- fi
- AC_MSG_RESULT($enable_kernel_linux)
-
--dnl Check for /dev/urandom
--AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
-- [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
-+
-+dnl Check for /dev/urandom ONLY when NOT cross compiling
-+if test "$cross_compiling" != yes; then
-+ AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
-+ [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
-+fi
-
- dnl Checks for header files.
- AC_HEADER_STDC
+++ /dev/null
---- a/libs/xmlrpc-c/config.mk.in
-+++ b/libs/xmlrpc-c/config.mk.in
-@@ -335,8 +335,8 @@ endif
- # The cross compiling user can update config.mk or override
- # BUILDTOOL_CC on a make command.
-
--BUILDTOOL_CC = $(CC)
--BUILDTOOL_CCLD = $(CCLD)
-+BUILDTOOL_CC = $(HOSTCC)
-+BUILDTOOL_CCLD = $(HOSTCC)
-
- # Here are the commands 'make install' uses to install various kinds of files:
-
+++ /dev/null
---- a/libs/xmlrpc-c/lib/expat/gennmtab/Makefile
-+++ b/libs/xmlrpc-c/lib/expat/gennmtab/Makefile
-@@ -1,3 +1,5 @@
-+TOPDIR=$(shell (cd $(SRCDIR)/../../../../..; pwd))
-+
- ifeq ($(SRCDIR),)
- updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
- EXPATDIR := $(call updir,$(CURDIR))
-@@ -7,6 +9,7 @@ ifeq ($(SRCDIR),)
- endif
- SUBDIR := lib/expat/gennmtab
-
-+include $(TOPDIR)/rules.mk
- include $(BLDDIR)/config.mk
-
- LDFLAGS = $(LADD)
+++ /dev/null
---- a/src/include/timerfd_wrap.h
-+++ b/src/include/timerfd_wrap.h
-@@ -55,20 +55,12 @@ SWITCH_BEGIN_EXTERN_C
-
-
- #ifndef __NR_timerfd
--#if defined(__x86_64__)
--#define __NR_timerfd_create 283
--#define __NR_timerfd_settime 286
--#define __NR_timerfd_gettime 287
--#elif defined(__i386__)
--#define __NR_timerfd_create 322
--#define __NR_timerfd_settime 325
--#define __NR_timerfd_gettime 326
--#else
--#error invalid system
--#endif
-+#include <linux/unistd.h>
- #endif
-
--#define TFD_TIMER_ABSTIME (1 << 0)
-+#ifndef TFD_TIMER_ABSTIME
-+#include <sys/timerfd.h>
-+#endif
-
- int timerfd_create(int clockid, int flags)
- {
+++ /dev/null
---- a/src/mod/codecs/mod_celt/Makefile.am
-+++ b/src/mod/codecs/mod_celt/Makefile.am
-@@ -19,7 +19,7 @@ $(CELT_DIR):
-
- $(CELT_BUILDDIR)/Makefile: $(CELT_DIR)
- mkdir -p $(CELT_BUILDDIR)
-- cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(CELT_DIR)
-+ cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(CELT_DIR) --with-ogg=$(STAGING_DIR)/usr
- $(TOUCH_TARGET)
-
- $(CELT_LA): $(CELT_BUILDDIR)/Makefile
+++ /dev/null
---- a/src/mod/codecs/mod_isac/typedefs.h
-+++ b/src/mod/codecs/mod_isac/typedefs.h
-@@ -66,7 +66,7 @@
- #define WEBRTC_ARCH_X86
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
--#elif defined(__ARMEL__)
-+#elif defined(__ARMEL__) || defined(__mips__)
- // TODO(andrew): We'd prefer to control platform defines here, but this is
- // currently provided by the Android makefiles. Commented to avoid duplicate
- // definition warnings.
+++ /dev/null
---- a/src/mod/codecs/mod_opus/Makefile.am
-+++ b/src/mod/codecs/mod_opus/Makefile.am
-@@ -19,7 +19,7 @@ $(OPUS_DIR)/configure:
-
- $(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR)/configure
- mkdir -p $(OPUS_BUILDDIR)
-- cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure $(MY_DEFAULT_ARGS)
-+ cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure $(MY_DEFAULT_ARGS) --host=$(host) --disable-shared --with-pic --srcdir=$(OPUS_DIR)
- $(TOUCH_TARGET)
-
- $(OPUS_LA): $(OPUS_BUILDDIR)/Makefile
+++ /dev/null
---- a/src/mod/directories/mod_ldap/Makefile.am
-+++ b/src/mod/directories/mod_ldap/Makefile.am
-@@ -13,7 +13,7 @@ mod_ldap_la_CFLAGS = $(AM_CFLAGS) -DWI
- mod_ldap_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(LDAPLA) $(LIBLBERLA)
- mod_ldap_la_LDFLAGS = -avoid-version -module -no-undefined -shared
-
--MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" --disable-slapd --disable-bdb --disable-hdb
-+MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" --with-yielding_select=yes --disable-slapd --disable-bdb --disable-hdb
-
- $(MODNAME).lo: $(LDAPLA) $(LIBLBERLA)
-
+++ /dev/null
---- a/src/mod/endpoints/mod_gsmopen/Makefile.am
-+++ b/src/mod/endpoints/mod_gsmopen/Makefile.am
-@@ -12,7 +12,7 @@ SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libsp
- mod_LTLIBRARIES = mod_gsmopen.la
- mod_gsmopen_la_SOURCES = mod_gsmopen.cpp gsmopen_protocol.cpp
- mod_gsmopen_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS)
--mod_gsmopen_la_CPPFLAGS = -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I.
-+mod_gsmopen_la_CPPFLAGS = -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -fpermissive
- mod_gsmopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TIFF_LA)
- mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmme
-
+++ /dev/null
---- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in
-+++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in
-@@ -56,21 +56,6 @@ dnl Checks for programs.
- AC_PROG_CPP
- AC_PROG_CXX
-
--dnl check for gcc 2.95.x
--AC_TRY_RUN([
--#include <unistd.h>
--main()
--{
--#if defined(__GNUC__) && \
-- ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
-- return 1;
--#endif
-- return 0;
--}
--],,
--[echo "need at least gcc 2.95 to compile correctly"
--exit 1])
--
- dnl check for alloca
- AC_FUNC_ALLOCA
-
+++ /dev/null
---- a/src/mod/endpoints/mod_verto/Makefile.am
-+++ b/src/mod/endpoints/mod_verto/Makefile.am
-@@ -9,19 +9,19 @@ mod_verto_la_LIBADD = $(switch_builddi
- mod_verto_la_LDFLAGS = -avoid-version -module -no-undefined -shared
-
- if HAVE_PERL
--#perldir = $(PERL_SITEDIR)
--noinst_LTLIBRARIES = MCAST.la
-+perldir = "$(PERL_SITELIB)"
-+perl_LTLIBRARIES = MCAST.la
- MCAST_la_SOURCES = mcast/mcast_wrap.cpp mcast/perlxsi.c mcast/mcast.c mcast/mcast_cpp.cpp
- MCAST_la_CFLAGS = $(CC_CFLAGS) $(CFLAGS) $(SWITCH_AM_CFLAGS) $(PERL_CFLAGS)
- MCAST_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS) $(CXXFLAGS) -w $(PERL_INC)
- MCAST_la_CPPFLAGS = -I$(switch_srcdir)/src/mod/endpoints/mod_verto/mcast
- MCAST_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PERL_LDFLAGS)
-
--#install-data-local: perlmod-install
-+install-data-local: perlmod-install
-
--#perlmod-install: install-perlLTLIBRARIES
--# install -d -m 755 $(DESTDIR)$(PERL_SITEDIR)
--# install -m 755 mcast/MCAST.pm $(DESTDIR)$(PERL_SITEDIR)
-+perlmod-install: install-perlLTLIBRARIES
-+ install -d -m 755 $(DESTDIR)$(perldir)
-+ install -m 755 mcast/MCAST.pm $(DESTDIR)$(perldir)
- endif
-
- mcast/esl_wrap.cpp:
+++ /dev/null
---- a/src/mod/languages/mod_perl/Makefile.am
-+++ b/src/mod/languages/mod_perl/Makefile.am
-@@ -1,22 +1,22 @@
- include $(top_srcdir)/build/modmake.rulesam
- MODNAME=mod_perl
--PERL = perl
--PERL_LIBDIR =-L`perl -MConfig -e 'print $$Config{archlib}'`/CORE
--PERL_LIBS =`perl -MConfig -e 'print $$Config{libs}'`
-
--perldir=$(prefix)/perl
-+perldir="$(PERL_SITELIB)"
-+
- mod_LTLIBRARIES = mod_perl.la
- perl_LTLIBRARIES = freeswitch.la
- mod_perl_la_SOURCES = mod_perl.c freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c
- mod_perl_la_CFLAGS = $(AM_CFLAGS)
- mod_perl_la_CXXFLAGS = $(AM_CXXFLAGS)
--mod_perl_la_CPPFLAGS = -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/
-+mod_perl_la_CPPFLAGS = ${PERL_CFLAGS} -I$(switch_srcdir)/libs/libteletone/src/
- mod_perl_la_LIBADD = $(switch_builddir)/libfreeswitch.la
--mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared `$(PERL) -MExtUtils::Embed -e ldopts` `$(PERL) -MConfig -e 'print $$Config{libs}'`
-+#mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared `$(PERL) -MExtUtils::Embed -e ldopts` `$(PERL) -MConfig -e 'print $$Config{libs}'`
-+mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared ${PERL_LDFLAGS}
-
- freeswitch_la_SOURCES = freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c
- freeswitch_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(LDFLAGS)
--freeswitch_la_CPPFLAGS = -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/
-+freeswitch_la_CPPFLAGS = ${PERL_CFLAGS} -I$(switch_srcdir)/libs/libteletone/src/
-+
- reswig: swigclean mod_perl_wrap.cpp
-
- swigclean: clean