summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--cdr/cdr_radius.c6
-rw-r--r--cel/cel_radius.c6
-rwxr-xr-xconfigure215
-rw-r--r--configure.ac16
-rw-r--r--include/asterisk/autoconfig.h.in6
-rw-r--r--main/Makefile4
-rw-r--r--main/app.c10
-rw-r--r--makeopts.in2
-rw-r--r--third-party/Makefile.rules4
-rw-r--r--third-party/pjproject/Makefile23
-rw-r--r--third-party/pjproject/configure.m48
12 files changed, 282 insertions, 22 deletions
diff --git a/CHANGES b/CHANGES
index 3db847d83..cb3fe951d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -19,6 +19,10 @@ Build System
Asterisk built with LOW_MEMORY can now successfully load binary modules
built without LOW_MEMORY and vice versa.
+ * RADIUS backends for CEL and CDR can now also be built using the radcli
+ client library, in addition to the existing support for building them
+ using either freeradius or radiusclient-ng.
+
Core
------------------
* ASTERISK_REGISTER_FILE was no longer useful and has been removed. Sources
diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index af434f618..f6b311def 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -39,11 +39,7 @@
#include "asterisk.h"
-#ifdef FREERADIUS_CLIENT
-#include <freeradius-client.h>
-#else
-#include <radiusclient-ng.h>
-#endif
+#include RADIUS_HEADER_STR
#include "asterisk/channel.h"
#include "asterisk/cdr.h"
diff --git a/cel/cel_radius.c b/cel/cel_radius.c
index e31cb5edc..250d6a778 100644
--- a/cel/cel_radius.c
+++ b/cel/cel_radius.c
@@ -33,11 +33,7 @@
#include "asterisk.h"
-#ifdef FREERADIUS_CLIENT
-#include <freeradius-client.h>
-#else
-#include <radiusclient-ng.h>
-#endif
+#include RADIUS_HEADER_STR
#include "asterisk/channel.h"
#include "asterisk/cel.h"
diff --git a/configure b/configure
index b3661c0fc..c7821cc29 100755
--- a/configure
+++ b/configure
@@ -1231,6 +1231,7 @@ PBX_BISON
OPENSSL
SHA1SUM
LDCONFIG
+DOWNLOAD_TIMEOUT
DOWNLOAD_TO_STDOUT
DOWNLOAD
FETCH
@@ -1257,6 +1258,8 @@ COMPRESS
FIND
PYTHON
FLEX
+CUT
+CAT
CMP
BISON
GNU_LD
@@ -6804,6 +6807,88 @@ $as_echo "no" >&6; }
fi
+# Extract the first word of "cat", so it can be a program name with args.
+set dummy cat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_CAT" && ac_cv_path_CAT=":"
+ ;;
+esac
+fi
+CAT=$ac_cv_path_CAT
+if test -n "$CAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5
+$as_echo "$CAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "cut", so it can be a program name with args.
+set dummy cut; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CUT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CUT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CUT="$CUT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_CUT" && ac_cv_path_CUT=":"
+ ;;
+esac
+fi
+CUT=$ac_cv_path_CUT
+if test -n "$CUT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5
+$as_echo "$CUT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7874,9 +7959,11 @@ fi
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
DOWNLOAD_TO_STDOUT="${WGET} -O-"
+ DOWNLOAD_TIMEOUT='--timeout=$1'
else if test "${CURL}" != ":" ; then
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
DOWNLOAD_TO_STDOUT="${CURL} -L --progress-bar -w \"%{url_effective}\n\""
+ DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
else
# Extract the first word of "fetch", so it can be a program name with args.
set dummy fetch; ac_word=$2
@@ -7921,11 +8008,14 @@ fi
DOWNLOAD=${FETCH}
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+ DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
fi
fi
+
+
# Extract the first word of "ldconfig", so it can be a program name with args.
set dummy ldconfig; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9247,8 +9337,14 @@ $as_echo "configuring" >&6; }
if test "${NM}" = ":" ; then
as_fn_error $? "nm is required to build bundled pjproject" "$LINENO" 5
fi
+ if test "${MD5}" = ":" ; then
+ as_fn_error $? "md5dum is required to build bundled pjproject" "$LINENO" 5
+ fi
+ if test "${CAT}" = ":" ; then
+ as_fn_error $? "cat is required to build bundled pjproject" "$LINENO" 5
+ fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} configure
if test $? -ne 0 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
@@ -31088,7 +31184,7 @@ fi
if test "x${PBX_RADIUS}" = "x1"; then
-$as_echo "#define FREERADIUS_CLIENT /**/" >>confdefs.h
+$as_echo "#define RADIUS_HEADER_STR <freeradius-client.h>" >>confdefs.h
else
@@ -31195,6 +31291,121 @@ _ACEOF
fi
+ if test "x${PBX_RADIUS}" = "x1"; then
+
+$as_echo "#define RADIUS_HEADER_STR <radiusclient-ng.h>" >>confdefs.h
+
+ else
+
+if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then
+ pbxlibdir=""
+ # if --with-RADIUS=DIR has been specified, use it.
+ if test "x${RADIUS_DIR}" != "x"; then
+ if test -d ${RADIUS_DIR}/lib; then
+ pbxlibdir="-L${RADIUS_DIR}/lib"
+ else
+ pbxlibdir="-L${RADIUS_DIR}"
+ fi
+ fi
+ pbxfuncname="rc_read_config"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_RADIUS_FOUND=yes
+ else
+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} "
+ as_ac_Lib=`$as_echo "ac_cv_lib_radcli_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lradcli" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lradcli... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lradcli ${pbxlibdir} $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+ AST_RADIUS_FOUND=yes
+else
+ AST_RADIUS_FOUND=no
+fi
+
+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+ fi
+
+ # now check for the header.
+ if test "${AST_RADIUS_FOUND}" = "yes"; then
+ RADIUS_LIB="${pbxlibdir} -lradcli "
+ # if --with-RADIUS=DIR has been specified, use it.
+ if test "x${RADIUS_DIR}" != "x"; then
+ RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
+ fi
+ RADIUS_INCLUDE="${RADIUS_INCLUDE} "
+ if test "xradcli/radcli.h" = "x" ; then # no header, assume found
+ RADIUS_HEADER_FOUND="1"
+ else # check for the header
+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}"
+ ac_fn_c_check_header_mongrel "$LINENO" "radcli/radcli.h" "ac_cv_header_radcli_radcli_h" "$ac_includes_default"
+if test "x$ac_cv_header_radcli_radcli_h" = xyes; then :
+ RADIUS_HEADER_FOUND=1
+else
+ RADIUS_HEADER_FOUND=0
+fi
+
+
+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+ fi
+ if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
+ RADIUS_LIB=""
+ RADIUS_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ RADIUS_LIB=""
+ fi
+ PBX_RADIUS=1
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RADIUS 1
+_ACEOF
+
+ fi
+ fi
+fi
+
+
+ if test "x${PBX_RADIUS}" = "x1"; then
+
+$as_echo "#define RADIUS_HEADER_STR <radcli/radcli.h>" >>confdefs.h
+
+ fi
+ fi
fi
diff --git a/configure.ac b/configure.ac
index c7f219d57..0f9b3442b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,6 +263,7 @@ AC_SUBST(GNU_LD)
AC_PATH_PROG([BISON], [bison], :)
AC_PATH_PROG([CMP], [cmp], :)
+AC_PATH_PROG([CAT], [cat], :)
AC_PATH_PROG([FLEX], [flex], :)
AC_PATH_PROG([GREP], [grep], :)
AC_PATH_PROG([PYTHON], [python], :)
@@ -293,18 +294,23 @@ AC_PATH_PROG([NM], [nm], :)
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
DOWNLOAD_TO_STDOUT="${WGET} -O-"
+ DOWNLOAD_TIMEOUT='--timeout=$1'
else if test "${CURL}" != ":" ; then
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
DOWNLOAD_TO_STDOUT="${CURL} -L --progress-bar -w \"%{url_effective}\n\""
+ DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
else
AC_PATH_PROG([FETCH], [fetch], [:])
DOWNLOAD=${FETCH}
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+ DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
fi
fi
AC_SUBST(DOWNLOAD)
AC_SUBST(DOWNLOAD_TO_STDOUT)
+AC_SUBST(DOWNLOAD_TIMEOUT)
+
AC_PATH_PROG([LDCONFIG], [ldconfig], :)
AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
AC_PATH_PROG([OPENSSL], [openssl], :)
@@ -2366,9 +2372,17 @@ AST_EXT_LIB_CHECK([LUA], [lua], [luaL_openlib], [lua.h], [-lm])
# just different header filenames and different SONAMEs
AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
if test "x${PBX_RADIUS}" = "x1"; then
- AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client library])
+ AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header])
else
AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
+ if test "x${PBX_RADIUS}" = "x1"; then
+ AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header])
+ else
+ AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h])
+ if test "x${PBX_RADIUS}" = "x1"; then
+ AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header])
+ fi
+ fi
fi
AST_EXT_LIB_CHECK([CODEC2], [codec2], [codec2_create], [codec2/codec2.h])
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index b50484ad6..e8bd8118a 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -28,9 +28,6 @@
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
-/* Use the FreeRADIUS-client library */
-#undef FREERADIUS_CLIENT
-
/* Define to 1 if anonymous semaphores work. */
#undef HAS_WORKING_SEMAPHORE
@@ -1311,6 +1308,9 @@
/* Define if your system needs braces around PTHREAD_ONCE_INIT */
#undef PTHREAD_ONCE_INIT_NEEDS_BRACES
+/* Name of RADIUS library include header */
+#undef RADIUS_HEADER_STR
+
/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1
diff --git a/main/Makefile b/main/Makefile
index 0c1b11ed8..95c3c70c6 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -287,7 +287,7 @@ endif
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): _ASTLDFLAGS+=-Wl,-soname=$(ASTPJ_LIB) $(PJ_LDFLAGS)
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskpj\" -DAST_NOT_MODULE $(PJ_CFLAGS)
-$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): LIBS+=$(PJPROJECT_LDLIBS) -lssl -lcrypto -luuid -lm -lpthread
+$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): LIBS+=$(PJPROJECT_LDLIBS) -lssl -lcrypto -luuid -lm -lpthread $(RT_LIB)
ifeq ($(GNU_LD),1)
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): SO_SUPPRESS_SYMBOLS=-Wl,--version-script,libasteriskpj.exports,--warn-common
endif
@@ -312,7 +312,7 @@ ASTPJ_LIB:=libasteriskpj.dylib
# /lib or /usr/lib
$(ASTPJ_LIB): _ASTLDFLAGS+=-dynamiclib -install_name $(ASTLIBDIR)/$(ASTPJ_LIB) $(PJ_LDFLAGS)
$(ASTPJ_LIB): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskpj\" $(PJ_CFLAGS) -DAST_NOT_MODULE
-$(ASTPJ_LIB): LIBS+=$(PJPROJECT_LIBS) -lssl -lcrypto -luuid -lm -lrt -lpthread
+$(ASTPJ_LIB): LIBS+=$(PJPROJECT_LIBS) -lssl -lcrypto -luuid -lm -lpthread $(RT_LIB)
$(ASTPJ_LIB): SOLINK=$(DYLINK)
# Special rules for building a shared library (not a dynamically loadable module)
diff --git a/main/app.c b/main/app.c
index 621153e25..f2e3a0fe0 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1071,6 +1071,7 @@ static int control_streamfile(struct ast_channel *chan,
int res;
long pause_restart_point = 0;
long offset = 0;
+ struct ast_silence_generator *silgen = NULL;
if (!file) {
return -1;
@@ -1161,6 +1162,10 @@ static int control_streamfile(struct ast_channel *chan,
if ((suspend && strchr(suspend, res)) || res == AST_CONTROL_STREAM_SUSPEND) {
pause_restart_point = ast_tellstream(ast_channel_stream(chan));
+
+ if (ast_opt_transmit_silence) {
+ silgen = ast_channel_start_silence_generator(chan);
+ }
ast_test_suite_event_notify("PLAYBACK","Channel: %s\r\n"
"Control: %s\r\n",
ast_channel_name(chan),
@@ -1174,6 +1179,11 @@ static int control_streamfile(struct ast_channel *chan,
break;
}
}
+ if (silgen) {
+ ast_channel_stop_silence_generator(chan, silgen);
+ silgen = NULL;
+ }
+
if ((suspend && (res == *suspend)) || res == AST_CONTROL_STREAM_SUSPEND) {
res = 0;
ast_test_suite_event_notify("PLAYBACK","Channel: %s\r\n"
diff --git a/makeopts.in b/makeopts.in
index a145b02e6..c67e2f2b6 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -28,6 +28,7 @@ WGET=@WGET@
FETCH=@FETCH@
DOWNLOAD=@DOWNLOAD@
DOWNLOAD_TO_STDOUT=@DOWNLOAD_TO_STDOUT@
+DOWNLOAD_MAX_TIMEOUT=@DOWNLOAD_MAX_TIMEOUT@
SOUNDS_CACHE_DIR=@SOUNDS_CACHE_DIR@
EXTERNALS_CACHE_DIR=@EXTERNALS_CACHE_DIR@
RUBBER=@RUBBER@
@@ -46,6 +47,7 @@ TAR=@TAR@
PATCH=@PATCH@
SED=@SED@
NM=@NM@
+CAT=@CAT@
BUILD_PLATFORM=@BUILD_PLATFORM@
BUILD_CPU=@BUILD_CPU@
diff --git a/third-party/Makefile.rules b/third-party/Makefile.rules
index 4f804dd0e..f8b72ba6d 100644
--- a/third-party/Makefile.rules
+++ b/third-party/Makefile.rules
@@ -26,4 +26,8 @@ export TAR
export PATCH
export SED
export NM
+export MD5
+export CAT
export DOWNLOAD
+export DOWNLOAD_TO_STDOUT
+export DOWNLOAD_TIMEOUT
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 5a4c2d1b6..3f50a89b9 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -75,14 +75,31 @@ include ../Makefile.rules
include Makefile.rules
ECHO_PREFIX := $(ECHO_PREFIX) echo '[pjproject] '
+SHELL_ECHO_PREFIX := echo '[pjproject] '
_all: $(TARGETS)
+define download_from_pjproject
+ ($(SHELL_ECHO_PREFIX) Downloading $(PJPROJECT_URL)/$(@F) to $@ ;\
+ $(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,10) $(PJPROJECT_URL)/$(@F) > $@ &&\
+ $(SHELL_ECHO_PREFIX) Downloading $(PJPROJECT_URL)/MD5SUM to $(PJMD5SUM) &&\
+ $(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,10) $(PJPROJECT_URL)/MD5SUM.TXT > $(PJMD5SUM) &&\
+ ($(SHELL_ECHO_PREFIX) Verifying $@ &&\
+ tarball_sum=$$($(CAT) $@ | $(MD5) | $(SED) -n -r -e "s/^([^ ]+)\s+.*/\1/gp") ;\
+ required_sum=$$($(SED) -n -r -e "s/^([^ ]+)\s+$(@F)/\1/gp" $(PJMD5SUM)) ;\
+ if [ "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ; fi) &&\
+ $(SHELL_ECHO_PREFIX) Verify successful ; exit 0)
+endef
+
+.DELETE_ON_ERROR:
+
DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
+TARBALL = $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
+PJMD5SUM = $(patsubst %.tar.bz2,%.md5,$(TARBALL))
-$(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2: ../versions.mak
- $(ECHO_PREFIX) Downloading $(PJPROJECT_URL)/$(@F) to $@
- $(CMD_PREFIX) $(DOWNLOAD_TO_STDOUT) $(PJPROJECT_URL)/$(@F) > $@
+$(TARBALL): ../versions.mak
+ $(CMD_PREFIX) $(download_from_pjproject) || (rm -rf $@ ;\
+ $(SHELL_ECHO_PREFIX) Retrying download ; sleep 3 ; $(download_from_pjproject))
source/.unpacked: $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
$(ECHO_PREFIX) Unpacking $<
diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4
index 7c60c2a02..8294d8ef9 100644
--- a/third-party/pjproject/configure.m4
+++ b/third-party/pjproject/configure.m4
@@ -28,8 +28,14 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
if test "${NM}" = ":" ; then
AC_MSG_ERROR(nm is required to build bundled pjproject)
fi
+ if test "${MD5}" = ":" ; then
+ AC_MSG_ERROR(md5sum is required to build bundled pjproject)
+ fi
+ if test "${CAT}" = ":" ; then
+ AC_MSG_ERROR(cat is required to build bundled pjproject)
+ fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} configure
if test $? -ne 0 ; then
AC_MSG_RESULT(failed)