mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Merge "pjproject_bundled: Improve reliability of pjproject download"
This commit is contained in:
98
configure
vendored
98
configure
vendored
@@ -1231,6 +1231,7 @@ PBX_BISON
|
|||||||
OPENSSL
|
OPENSSL
|
||||||
SHA1SUM
|
SHA1SUM
|
||||||
LDCONFIG
|
LDCONFIG
|
||||||
|
DOWNLOAD_TIMEOUT
|
||||||
DOWNLOAD_TO_STDOUT
|
DOWNLOAD_TO_STDOUT
|
||||||
DOWNLOAD
|
DOWNLOAD
|
||||||
FETCH
|
FETCH
|
||||||
@@ -1257,6 +1258,8 @@ COMPRESS
|
|||||||
FIND
|
FIND
|
||||||
PYTHON
|
PYTHON
|
||||||
FLEX
|
FLEX
|
||||||
|
CUT
|
||||||
|
CAT
|
||||||
CMP
|
CMP
|
||||||
BISON
|
BISON
|
||||||
GNU_LD
|
GNU_LD
|
||||||
@@ -6804,6 +6807,88 @@ $as_echo "no" >&6; }
|
|||||||
fi
|
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.
|
# Extract the first word of "flex", so it can be a program name with args.
|
||||||
set dummy flex; ac_word=$2
|
set dummy flex; ac_word=$2
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||||
@@ -7874,9 +7959,11 @@ fi
|
|||||||
if test "${WGET}" != ":" ; then
|
if test "${WGET}" != ":" ; then
|
||||||
DOWNLOAD=${WGET}
|
DOWNLOAD=${WGET}
|
||||||
DOWNLOAD_TO_STDOUT="${WGET} -O-"
|
DOWNLOAD_TO_STDOUT="${WGET} -O-"
|
||||||
|
DOWNLOAD_TIMEOUT='--timeout=$1'
|
||||||
else if test "${CURL}" != ":" ; then
|
else if test "${CURL}" != ":" ; then
|
||||||
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
|
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
|
||||||
DOWNLOAD_TO_STDOUT="${CURL} -L --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
|
else
|
||||||
# Extract the first word of "fetch", so it can be a program name with args.
|
# Extract the first word of "fetch", so it can be a program name with args.
|
||||||
set dummy fetch; ac_word=$2
|
set dummy fetch; ac_word=$2
|
||||||
@@ -7921,11 +8008,14 @@ fi
|
|||||||
|
|
||||||
DOWNLOAD=${FETCH}
|
DOWNLOAD=${FETCH}
|
||||||
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
|
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
|
||||||
|
DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Extract the first word of "ldconfig", so it can be a program name with args.
|
# Extract the first word of "ldconfig", so it can be a program name with args.
|
||||||
set dummy ldconfig; ac_word=$2
|
set dummy ldconfig; ac_word=$2
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||||
@@ -9247,8 +9337,14 @@ $as_echo "configuring" >&6; }
|
|||||||
if test "${NM}" = ":" ; then
|
if test "${NM}" = ":" ; then
|
||||||
as_fn_error $? "nm is required to build bundled pjproject" "$LINENO" 5
|
as_fn_error $? "nm is required to build bundled pjproject" "$LINENO" 5
|
||||||
fi
|
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
|
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} configure
|
||||||
if test $? -ne 0 ; then
|
if test $? -ne 0 ; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
|
||||||
|
@@ -263,6 +263,7 @@ AC_SUBST(GNU_LD)
|
|||||||
|
|
||||||
AC_PATH_PROG([BISON], [bison], :)
|
AC_PATH_PROG([BISON], [bison], :)
|
||||||
AC_PATH_PROG([CMP], [cmp], :)
|
AC_PATH_PROG([CMP], [cmp], :)
|
||||||
|
AC_PATH_PROG([CAT], [cat], :)
|
||||||
AC_PATH_PROG([FLEX], [flex], :)
|
AC_PATH_PROG([FLEX], [flex], :)
|
||||||
AC_PATH_PROG([GREP], [grep], :)
|
AC_PATH_PROG([GREP], [grep], :)
|
||||||
AC_PATH_PROG([PYTHON], [python], :)
|
AC_PATH_PROG([PYTHON], [python], :)
|
||||||
@@ -293,18 +294,23 @@ AC_PATH_PROG([NM], [nm], :)
|
|||||||
if test "${WGET}" != ":" ; then
|
if test "${WGET}" != ":" ; then
|
||||||
DOWNLOAD=${WGET}
|
DOWNLOAD=${WGET}
|
||||||
DOWNLOAD_TO_STDOUT="${WGET} -O-"
|
DOWNLOAD_TO_STDOUT="${WGET} -O-"
|
||||||
|
DOWNLOAD_TIMEOUT='--timeout=$1'
|
||||||
else if test "${CURL}" != ":" ; then
|
else if test "${CURL}" != ":" ; then
|
||||||
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
|
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
|
||||||
DOWNLOAD_TO_STDOUT="${CURL} -L --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
|
else
|
||||||
AC_PATH_PROG([FETCH], [fetch], [:])
|
AC_PATH_PROG([FETCH], [fetch], [:])
|
||||||
DOWNLOAD=${FETCH}
|
DOWNLOAD=${FETCH}
|
||||||
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
|
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
|
||||||
|
DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(DOWNLOAD)
|
AC_SUBST(DOWNLOAD)
|
||||||
AC_SUBST(DOWNLOAD_TO_STDOUT)
|
AC_SUBST(DOWNLOAD_TO_STDOUT)
|
||||||
|
AC_SUBST(DOWNLOAD_TIMEOUT)
|
||||||
|
|
||||||
AC_PATH_PROG([LDCONFIG], [ldconfig], :)
|
AC_PATH_PROG([LDCONFIG], [ldconfig], :)
|
||||||
AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
|
AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
|
||||||
AC_PATH_PROG([OPENSSL], [openssl], :)
|
AC_PATH_PROG([OPENSSL], [openssl], :)
|
||||||
|
@@ -28,6 +28,7 @@ WGET=@WGET@
|
|||||||
FETCH=@FETCH@
|
FETCH=@FETCH@
|
||||||
DOWNLOAD=@DOWNLOAD@
|
DOWNLOAD=@DOWNLOAD@
|
||||||
DOWNLOAD_TO_STDOUT=@DOWNLOAD_TO_STDOUT@
|
DOWNLOAD_TO_STDOUT=@DOWNLOAD_TO_STDOUT@
|
||||||
|
DOWNLOAD_MAX_TIMEOUT=@DOWNLOAD_MAX_TIMEOUT@
|
||||||
SOUNDS_CACHE_DIR=@SOUNDS_CACHE_DIR@
|
SOUNDS_CACHE_DIR=@SOUNDS_CACHE_DIR@
|
||||||
EXTERNALS_CACHE_DIR=@EXTERNALS_CACHE_DIR@
|
EXTERNALS_CACHE_DIR=@EXTERNALS_CACHE_DIR@
|
||||||
RUBBER=@RUBBER@
|
RUBBER=@RUBBER@
|
||||||
@@ -46,6 +47,7 @@ TAR=@TAR@
|
|||||||
PATCH=@PATCH@
|
PATCH=@PATCH@
|
||||||
SED=@SED@
|
SED=@SED@
|
||||||
NM=@NM@
|
NM=@NM@
|
||||||
|
CAT=@CAT@
|
||||||
|
|
||||||
BUILD_PLATFORM=@BUILD_PLATFORM@
|
BUILD_PLATFORM=@BUILD_PLATFORM@
|
||||||
BUILD_CPU=@BUILD_CPU@
|
BUILD_CPU=@BUILD_CPU@
|
||||||
|
4
third-party/Makefile.rules
vendored
4
third-party/Makefile.rules
vendored
@@ -26,4 +26,8 @@ export TAR
|
|||||||
export PATCH
|
export PATCH
|
||||||
export SED
|
export SED
|
||||||
export NM
|
export NM
|
||||||
|
export MD5
|
||||||
|
export CAT
|
||||||
export DOWNLOAD
|
export DOWNLOAD
|
||||||
|
export DOWNLOAD_TO_STDOUT
|
||||||
|
export DOWNLOAD_TIMEOUT
|
||||||
|
25
third-party/pjproject/Makefile
vendored
25
third-party/pjproject/Makefile
vendored
@@ -75,14 +75,31 @@ include ../Makefile.rules
|
|||||||
include Makefile.rules
|
include Makefile.rules
|
||||||
|
|
||||||
ECHO_PREFIX := $(ECHO_PREFIX) echo '[pjproject] '
|
ECHO_PREFIX := $(ECHO_PREFIX) echo '[pjproject] '
|
||||||
|
SHELL_ECHO_PREFIX := echo '[pjproject] '
|
||||||
|
|
||||||
_all: $(TARGETS)
|
_all: $(TARGETS)
|
||||||
|
|
||||||
DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
|
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
|
||||||
|
|
||||||
$(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2: ../versions.mak
|
.DELETE_ON_ERROR:
|
||||||
$(ECHO_PREFIX) Downloading $(PJPROJECT_URL)/$(@F) to $@
|
|
||||||
$(CMD_PREFIX) $(DOWNLOAD_TO_STDOUT) $(PJPROJECT_URL)/$(@F) > $@
|
DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
|
||||||
|
TARBALL = $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
|
||||||
|
PJMD5SUM = $(patsubst %.tar.bz2,%.md5,$(TARBALL))
|
||||||
|
|
||||||
|
$(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
|
source/.unpacked: $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
|
||||||
$(ECHO_PREFIX) Unpacking $<
|
$(ECHO_PREFIX) Unpacking $<
|
||||||
|
8
third-party/pjproject/configure.m4
vendored
8
third-party/pjproject/configure.m4
vendored
@@ -28,8 +28,14 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
|
|||||||
if test "${NM}" = ":" ; then
|
if test "${NM}" = ":" ; then
|
||||||
AC_MSG_ERROR(nm is required to build bundled pjproject)
|
AC_MSG_ERROR(nm is required to build bundled pjproject)
|
||||||
fi
|
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
|
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} EXTERNALS_CACHE_DIR=${EXTERNALS_CACHE_DIR} configure
|
||||||
if test $? -ne 0 ; then
|
if test $? -ne 0 ; then
|
||||||
AC_MSG_RESULT(failed)
|
AC_MSG_RESULT(failed)
|
||||||
|
Reference in New Issue
Block a user