[Asterisk-code-review] BuildSystem: Add the tool ftp to alternatively download exte... (asterisk[15])
Alexander Traud
asteriskteam at digium.com
Fri Mar 9 06:28:14 CST 2018
Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/8497
Change subject: BuildSystem: Add the tool ftp to alternatively download external parts.
......................................................................
BuildSystem: Add the tool ftp to alternatively download external parts.
The build system supports the tools wget, curl (mainly for macOS), and fetch
(mainly for FreeBSD) to download external parts, for example the PJProject. On
NetBSD and OpenBSD, the default tool for HTTP(s) downloads is called ftp.
Beside adding ftp, this change fixes the test for the variable
DOWNLOAD_TO_STDOUT in the file third-party/pjproject/configure.m4, because that
test expects an empty variable. However, that variable was never empty.
ASTERISK-27732
Change-Id: Ibf9120a918bec75d5a571c0f0c9b7f2eec636f87
---
M configure
M configure.ac
2 files changed, 71 insertions(+), 8 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/8497/1
diff --git a/configure b/configure
index 2456b0c..1576d6c 100755
--- a/configure
+++ b/configure
@@ -1230,6 +1230,7 @@
DOWNLOAD_TIMEOUT
DOWNLOAD_TO_STDOUT
DOWNLOAD
+FTP
FETCH
NM
PATCH
@@ -7799,6 +7800,9 @@
+DOWNLOAD=
+DOWNLOAD_TO_STDOUT=
+DOWNLOAD_TIMEOUT=
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
@@ -7849,13 +7853,61 @@
fi
- DOWNLOAD=${FETCH}
- DOWNLOAD_TO_STDOUT="${FETCH} -o-"
- DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+ if test "${FETCH}" != ":" ; then
+ DOWNLOAD=${FETCH}
+ DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+ DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+ else
+ # Extract the first word of "ftp", so it can be a program name with args.
+set dummy ftp; 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_FTP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $FTP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_FTP="$FTP" # 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_FTP="$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_FTP" && ac_cv_path_FTP=":"
+ ;;
+esac
fi
+FTP=$ac_cv_path_FTP
+if test -n "$FTP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FTP" >&5
+$as_echo "$FTP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+ if test "${FTP}" != ":" ; then
+ DOWNLOAD=${FTP}
+ DOWNLOAD_TO_STDOUT="${FTP} -o-"
+ DOWNLOAD_TIMEOUT='-q $(or $2,$1)'
+ fi
+ fi
+fi
+fi
+
diff --git a/configure.ac b/configure.ac
index 571987c..9c6c25a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,6 +281,9 @@
AC_PATH_PROG([SED], [sed], :)
AC_PATH_PROG([NM], [nm], :)
+DOWNLOAD=
+DOWNLOAD_TO_STDOUT=
+DOWNLOAD_TIMEOUT=
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
@@ -290,13 +293,21 @@
DOWNLOAD_TO_STDOUT="${CURL} -Ls"
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)'
+ AC_PATH_PROG([FETCH], [fetch], :)
+ if test "${FETCH}" != ":" ; then
+ DOWNLOAD=${FETCH}
+ DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+ DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+ else
+ AC_PATH_PROG([FTP], [ftp], :)
+ if test "${FTP}" != ":" ; then
+ DOWNLOAD=${FTP}
+ DOWNLOAD_TO_STDOUT="${FTP} -o-"
+ DOWNLOAD_TIMEOUT='-q $(or $2,$1)'
+ fi
+ fi
fi
fi
-
AC_SUBST(DOWNLOAD)
AC_SUBST(DOWNLOAD_TO_STDOUT)
AC_SUBST(DOWNLOAD_TIMEOUT)
--
To view, visit https://gerrit.asterisk.org/8497
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf9120a918bec75d5a571c0f0c9b7f2eec636f87
Gerrit-Change-Number: 8497
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180309/4813f9f6/attachment-0001.html>
More information about the asterisk-code-review
mailing list