[Asterisk-code-review] BuildSystem: Add the tool ftp to alternatively download exte... (asterisk[13])

Alexander Traud asteriskteam at digium.com
Fri Mar 9 06:28:04 CST 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/8496


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/96/8496/1

diff --git a/configure b/configure
index 3442d57..45012ac 100755
--- a/configure
+++ b/configure
@@ -1202,6 +1202,7 @@
 DOWNLOAD_TIMEOUT
 DOWNLOAD_TO_STDOUT
 DOWNLOAD
+FTP
 FETCH
 NM
 PATCH
@@ -7760,6 +7761,9 @@
 
 
 
+DOWNLOAD=
+DOWNLOAD_TO_STDOUT=
+DOWNLOAD_TIMEOUT=
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
   DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
@@ -7810,13 +7814,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 d9148c0..27f9180 100644
--- a/configure.ac
+++ b/configure.ac
@@ -282,6 +282,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-"
@@ -291,13 +294,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/8496
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf9120a918bec75d5a571c0f0c9b7f2eec636f87
Gerrit-Change-Number: 8496
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/c8645fb3/attachment.html>


More information about the asterisk-code-review mailing list