FreeSWITCH:
[feed/telephony.git] / net / freeswitch / patches / configure_ac.patch
diff --git a/net/freeswitch/patches/configure_ac.patch b/net/freeswitch/patches/configure_ac.patch
new file mode 100644 (file)
index 0000000..86386ec
--- /dev/null
@@ -0,0 +1,160 @@
+--- 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
+@@ -379,9 +382,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
+              *darwin*)
+@@ -861,7 +861,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],,,[
+@@ -1177,14 +1176,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
+@@ -1205,7 +1204,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],[
+@@ -1287,18 +1286,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"
+@@ -1311,12 +1310,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"])
+@@ -1325,17 +1327,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)
+@@ -1443,6 +1447,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"],