Add an sha1sum-workalike for platforms which don't have it (like Mac OS X)
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 18 May 2010 22:49:13 +0000 (22:49 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 18 May 2010 22:49:13 +0000 (22:49 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263905 65c4cc65-6c06-0410-ace0-fbb531ad65f3

build_tools/sha1sum-sh [new file with mode: 0755]
configure
configure.ac
makeopts.in
sounds/Makefile

diff --git a/build_tools/sha1sum-sh b/build_tools/sha1sum-sh
new file mode 100755 (executable)
index 0000000..33d53f1
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+check=0
+status=0
+
+while [ x"$1" != x ]; do
+       case $1 in
+       -c)
+               check=1
+               shift
+               continue;;
+       --status)
+               status=1
+               shift
+               continue;;
+       -*)
+               if [ $status = 0 ]; then
+                       echo "Unrecognized option $1" 1>&2
+               fi
+               exit 1
+               ;;
+       *)
+               dst=$1
+               shift
+               continue;;
+       esac
+done
+
+if [ x"$dst" = x ]; then
+       if [ $status = 0 ]; then
+               echo "Usage: $0 [<options>] <filename>" 1>&2
+       fi
+       exit 1
+fi
+
+if [ $check = 1 ]; then
+       if [ -f $dst ]; then
+               sum1=`cut -d' ' -f1 $dst`
+               file=`cut -d' ' -f3 $dst`
+               sum2=`openssl sha1 $file | cut -d' ' -f2`
+               if [ x"$sum1" = x"$sum2" ]; then
+                       if [ $status = 0 ]; then
+                               echo "$dst: OK"
+                       fi
+                       exit 0
+               else
+                       if [ $status = 0 ]; then
+                               echo "$dst: FAILED"
+                       fi
+                       exit 1
+               fi
+       else
+               echo "$0: $dst: No such file or directory" 1>&2
+               exit 1
+       fi
+else
+       if [ x"$status" = x1 ]; then
+               echo "$0: the --status option is meaningful only when verifying checksums" 1>&2
+               exit 1
+       fi
+
+       if [ -f $dst ]; then
+               sum=`openssl sha1 $dst | cut -d' ' -f2`
+               echo "$dst  $sum"
+               exit 0
+       else
+               echo "$0: $dst: No such file or directory" 1>&2
+               exit 1
+       fi
+fi
+
index 3c0eb88..cb27ad5 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 263028 .
+# From configure.ac Revision: 263724 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -705,6 +705,10 @@ STRIP
 ac_ct_STRIP
 AR
 ac_ct_AR
+SHA1SUM
+ac_ct_SHA1SUM
+OPENSSL
+ac_ct_OPENSSL
 GNU_LD
 BISON
 FLEX
@@ -6993,6 +6997,214 @@ esac
   fi
 fi
 
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in sha1sum
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_SHA1SUM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$SHA1SUM"; then
+  ac_cv_prog_SHA1SUM="$SHA1SUM" # Let the user override the test.
+else
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_SHA1SUM="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+SHA1SUM=$ac_cv_prog_SHA1SUM
+if test -n "$SHA1SUM"; then
+  { echo "$as_me:$LINENO: result: $SHA1SUM" >&5
+echo "${ECHO_T}$SHA1SUM" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$SHA1SUM" && break
+  done
+fi
+if test -z "$SHA1SUM"; then
+  ac_ct_SHA1SUM=$SHA1SUM
+  for ac_prog in sha1sum
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_SHA1SUM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_SHA1SUM"; then
+  ac_cv_prog_ac_ct_SHA1SUM="$ac_ct_SHA1SUM" # Let the user override the test.
+else
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_SHA1SUM="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_SHA1SUM=$ac_cv_prog_ac_ct_SHA1SUM
+if test -n "$ac_ct_SHA1SUM"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_SHA1SUM" >&5
+echo "${ECHO_T}$ac_ct_SHA1SUM" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_SHA1SUM" && break
+done
+
+  if test "x$ac_ct_SHA1SUM" = x; then
+    SHA1SUM="$ac_aux_dir/build_tools/sha1sum-sh"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    SHA1SUM=$ac_ct_SHA1SUM
+  fi
+fi
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in openssl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_OPENSSL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OPENSSL"; then
+  ac_cv_prog_OPENSSL="$OPENSSL" # Let the user override the test.
+else
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OPENSSL="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OPENSSL=$ac_cv_prog_OPENSSL
+if test -n "$OPENSSL"; then
+  { echo "$as_me:$LINENO: result: $OPENSSL" >&5
+echo "${ECHO_T}$OPENSSL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$OPENSSL" && break
+  done
+fi
+if test -z "$OPENSSL"; then
+  ac_ct_OPENSSL=$OPENSSL
+  for ac_prog in openssl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_OPENSSL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OPENSSL"; then
+  ac_cv_prog_ac_ct_OPENSSL="$ac_ct_OPENSSL" # Let the user override the test.
+else
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OPENSSL="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OPENSSL=$ac_cv_prog_ac_ct_OPENSSL
+if test -n "$ac_ct_OPENSSL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OPENSSL" >&5
+echo "${ECHO_T}$ac_ct_OPENSSL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_OPENSSL" && break
+done
+
+  if test "x$ac_ct_OPENSSL" = x; then
+    OPENSSL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OPENSSL=$ac_ct_OPENSSL
+  fi
+fi
+
 
 GNU_LD=0
 if test "x$with_gnu_ld" = "xyes" ; then
@@ -49981,6 +50193,10 @@ STRIP!$STRIP$ac_delim
 ac_ct_STRIP!$ac_ct_STRIP$ac_delim
 AR!$AR$ac_delim
 ac_ct_AR!$ac_ct_AR$ac_delim
+SHA1SUM!$SHA1SUM$ac_delim
+ac_ct_SHA1SUM!$ac_ct_SHA1SUM$ac_delim
+OPENSSL!$OPENSSL$ac_delim
+ac_ct_OPENSSL!$ac_ct_OPENSSL$ac_delim
 GNU_LD!$GNU_LD$ac_delim
 BISON!$BISON$ac_delim
 FLEX!$FLEX$ac_delim
@@ -49988,10 +50204,6 @@ FIND!$FIND$ac_delim
 COMPRESS!$COMPRESS$ac_delim
 BASENAME!$BASENAME$ac_delim
 DIRNAME!$DIRNAME$ac_delim
-LN!$LN$ac_delim
-DOT!$DOT$ac_delim
-WGET!$WGET$ac_delim
-CURL!$CURL$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -50033,6 +50245,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+LN!$LN$ac_delim
+DOT!$DOT$ac_delim
+WGET!$WGET$ac_delim
+CURL!$CURL$ac_delim
 RUBBER!$RUBBER$ac_delim
 CATDVI!$CATDVI$ac_delim
 KPATHSEA!$KPATHSEA$ac_delim
@@ -50126,10 +50342,6 @@ IODBC_INCLUDE!$IODBC_INCLUDE$ac_delim
 IODBC_DIR!$IODBC_DIR$ac_delim
 PBX_IODBC!$PBX_IODBC$ac_delim
 ISDNNET_LIB!$ISDNNET_LIB$ac_delim
-ISDNNET_INCLUDE!$ISDNNET_INCLUDE$ac_delim
-ISDNNET_DIR!$ISDNNET_DIR$ac_delim
-PBX_ISDNNET!$PBX_ISDNNET$ac_delim
-JACK_LIB!$JACK_LIB$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -50171,6 +50383,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+ISDNNET_INCLUDE!$ISDNNET_INCLUDE$ac_delim
+ISDNNET_DIR!$ISDNNET_DIR$ac_delim
+PBX_ISDNNET!$PBX_ISDNNET$ac_delim
+JACK_LIB!$JACK_LIB$ac_delim
 JACK_INCLUDE!$JACK_INCLUDE$ac_delim
 JACK_DIR!$JACK_DIR$ac_delim
 PBX_JACK!$PBX_JACK$ac_delim
@@ -50264,10 +50480,6 @@ PRI_SUBADDR_DIR!$PRI_SUBADDR_DIR$ac_delim
 PBX_PRI_SUBADDR!$PBX_PRI_SUBADDR$ac_delim
 PRI_CALL_HOLD_LIB!$PRI_CALL_HOLD_LIB$ac_delim
 PRI_CALL_HOLD_INCLUDE!$PRI_CALL_HOLD_INCLUDE$ac_delim
-PRI_CALL_HOLD_DIR!$PRI_CALL_HOLD_DIR$ac_delim
-PBX_PRI_CALL_HOLD!$PBX_PRI_CALL_HOLD$ac_delim
-PRI_CALL_REROUTING_LIB!$PRI_CALL_REROUTING_LIB$ac_delim
-PRI_CALL_REROUTING_INCLUDE!$PRI_CALL_REROUTING_INCLUDE$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -50309,6 +50521,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+PRI_CALL_HOLD_DIR!$PRI_CALL_HOLD_DIR$ac_delim
+PBX_PRI_CALL_HOLD!$PBX_PRI_CALL_HOLD$ac_delim
+PRI_CALL_REROUTING_LIB!$PRI_CALL_REROUTING_LIB$ac_delim
+PRI_CALL_REROUTING_INCLUDE!$PRI_CALL_REROUTING_INCLUDE$ac_delim
 PRI_CALL_REROUTING_DIR!$PRI_CALL_REROUTING_DIR$ac_delim
 PBX_PRI_CALL_REROUTING!$PBX_PRI_CALL_REROUTING$ac_delim
 PRI_SETUP_KEYPAD_LIB!$PRI_SETUP_KEYPAD_LIB$ac_delim
@@ -50402,10 +50618,6 @@ OPENSSL_DIR!$OPENSSL_DIR$ac_delim
 PBX_OPENSSL!$PBX_OPENSSL$ac_delim
 FREETDS_LIB!$FREETDS_LIB$ac_delim
 FREETDS_INCLUDE!$FREETDS_INCLUDE$ac_delim
-FREETDS_DIR!$FREETDS_DIR$ac_delim
-PBX_FREETDS!$PBX_FREETDS$ac_delim
-TERMCAP_LIB!$TERMCAP_LIB$ac_delim
-TERMCAP_INCLUDE!$TERMCAP_INCLUDE$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -50447,6 +50659,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+FREETDS_DIR!$FREETDS_DIR$ac_delim
+PBX_FREETDS!$PBX_FREETDS$ac_delim
+TERMCAP_LIB!$TERMCAP_LIB$ac_delim
+TERMCAP_INCLUDE!$TERMCAP_INCLUDE$ac_delim
 TERMCAP_DIR!$TERMCAP_DIR$ac_delim
 PBX_TERMCAP!$PBX_TERMCAP$ac_delim
 TINFO_LIB!$TINFO_LIB$ac_delim
@@ -50540,10 +50756,6 @@ PBX_SYSLOG_FACILITY_LOG_AUTHPRIV!$PBX_SYSLOG_FACILITY_LOG_AUTHPRIV$ac_delim
 PBX_SYSLOG_FACILITY_LOG_CRON!$PBX_SYSLOG_FACILITY_LOG_CRON$ac_delim
 PBX_SYSLOG_FACILITY_LOG_DAEMON!$PBX_SYSLOG_FACILITY_LOG_DAEMON$ac_delim
 PBX_SYSLOG_FACILITY_LOG_FTP!$PBX_SYSLOG_FACILITY_LOG_FTP$ac_delim
-PBX_SYSLOG_FACILITY_LOG_KERN!$PBX_SYSLOG_FACILITY_LOG_KERN$ac_delim
-PBX_SYSLOG_FACILITY_LOG_LPR!$PBX_SYSLOG_FACILITY_LOG_LPR$ac_delim
-PBX_SYSLOG_FACILITY_LOG_MAIL!$PBX_SYSLOG_FACILITY_LOG_MAIL$ac_delim
-PBX_SYSLOG_FACILITY_LOG_NEWS!$PBX_SYSLOG_FACILITY_LOG_NEWS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -50585,13 +50797,17 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+PBX_SYSLOG_FACILITY_LOG_KERN!$PBX_SYSLOG_FACILITY_LOG_KERN$ac_delim
+PBX_SYSLOG_FACILITY_LOG_LPR!$PBX_SYSLOG_FACILITY_LOG_LPR$ac_delim
+PBX_SYSLOG_FACILITY_LOG_MAIL!$PBX_SYSLOG_FACILITY_LOG_MAIL$ac_delim
+PBX_SYSLOG_FACILITY_LOG_NEWS!$PBX_SYSLOG_FACILITY_LOG_NEWS$ac_delim
 PBX_SYSLOG_FACILITY_LOG_SYSLOG!$PBX_SYSLOG_FACILITY_LOG_SYSLOG$ac_delim
 PBX_SYSLOG_FACILITY_LOG_UUCP!$PBX_SYSLOG_FACILITY_LOG_UUCP$ac_delim
 PBX_SYSLOG!$PBX_SYSLOG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 8; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index a4d85e0..c643f5b 100644 (file)
@@ -178,6 +178,8 @@ AST_CHECK_GNU_MAKE
 
 AC_CHECK_TOOLS([STRIP], [strip gstrip], :)
 AC_CHECK_TOOLS([AR], [ar gar], :)
+AC_CHECK_TOOLS([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
+AC_CHECK_TOOLS([OPENSSL], [openssl], :)
 
 GNU_LD=0
 if test "x$with_gnu_ld" = "xyes" ; then
index 134ad03..cbea640 100644 (file)
@@ -29,6 +29,8 @@ CATDVI=@CATDVI@
 KPATHSEA=@KPATHSEA@
 XMLSTARLET=@XMLSTARLET@
 MD5=@MD5@
+SHA1SUM=@SHA1SUM@
+OPENSSL=@OPENSSL@
 
 BUILD_PLATFORM=@BUILD_PLATFORM@
 BUILD_CPU=@BUILD_CPU@
index 0d1adeb..eb638b6 100644 (file)
@@ -64,8 +64,8 @@ MM:=$(subst -SIREN14,-siren14,$(MM))
 MOH:=$(MM:MOH-%=asterisk-moh-%-$(MOH_VERSION).tar.gz)
 MOH_TAGS:=$(MM:MOH-%=$(MOH_DIR)/.asterisk-moh-%-$(MOH_VERSION))
 # If "fetch" is used, --continue is not a valid option.
-ifneq ($(findstring wget,$(WGET)),)
-WGET_ARGS:=--continue $(WGET_EXTRA_ARGS)
+ifneq ($(findstring wget,$(DOWNLOAD)),)
+DOWNLOAD+=--continue $(WGET_EXTRA_ARGS)
 endif
 
 EMPTY:=
@@ -78,8 +78,9 @@ $$($(1))/.asterisk-$(2)$(if $(3),-$(3),)-%: have_download
        $(CMD_PREFIX)PACKAGE=$$(subst $$($(1))/.asterisk,asterisk,$$@).tar.gz; $(BS)
        if test ! -f $$$${PACKAGE}; then $(BS)
          if test ! -f $$(SOUNDS_CACHE_DIR)/$$$${PACKAGE}; then $(BS)
-           (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$$${PACKAGE} $$(SOUNDS_URL)/$$$${PACKAGE}.sha1 $(BS)
-              && sha1sum -c --status $$$${PACKAGE}.sha1) || $(BS)
+           (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(SOUNDS_URL)/$$$${PACKAGE} && $(BS)
+                  $$(DOWNLOAD) $$(SOUNDS_URL)/$$$${PACKAGE}.sha1 $(BS)
+              && $$(SHA1SUM) -c --status $$$${PACKAGE}.sha1) || $(BS)
             (echo "Bad checksum: $$$${PACKAGE}" 1>&2; exit 1)); $(BS)
          fi; $(BS)
          cp -p $$(SOUNDS_CACHE_DIR)/$$$${PACKAGE} .; $(BS)
@@ -94,8 +95,9 @@ define sound_download_rule
 asterisk-$(1)-%.tar.gz: have_download
        $(CMD_PREFIX)if test ! -f $$@ && test ! -f $$(SOUNDS_DIR)/.$$(subst .tar.gz,,$/$@); then $(BS)
          if test ! -f $$(SOUNDS_CACHE_DIR)/$$@; then $(BS)
-           (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$@ $$(SOUNDS_URL)/$$@.sha1 $(BS)
-              && sha1sum -c --status $$@.sha1) || $(BS)
+           (cd $$(SOUNDS_CACHE_DIR); ($$(DOWNLOAD) $$(SOUNDS_URL)/$$@ && $(BS)
+                  $$(DOWNLOAD) $$(SOUNDS_URL)/$$@.sha1 $(BS)
+              && $$(SHA1SUM) -c --status $$@.sha1) || $(BS)
             (echo "Bad checksum: $$@" 1>&2; exit 1)); $(BS)
          fi; $(BS)
          cp -p $$(SOUNDS_CACHE_DIR)/$$@ .; $(BS)
@@ -108,7 +110,7 @@ define sound_format_lang_rule
 $$($(1))/.asterisk-$(2)$(if $(3),-$(3),)-%: have_download
        $(CMD_PREFIX)PACKAGE=$$(subst $$($(1))/.asterisk,asterisk,$$@).tar.gz; $(BS)
        if test ! -f $$$${PACKAGE}; then $(BS)
-         ($$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$$${PACKAGE} || exit 1); $(BS)
+         ($$(DOWNLOAD) $$(SOUNDS_URL)/$$$${PACKAGE} || exit 1); $(BS)
        fi; $(BS)
 $(if $($(4)_VERSION),\
 $(EMPTY)       rm -f $$(subst -$$($(4)_VERSION),,$$@)-* && $(BS)
@@ -119,7 +121,7 @@ endef
 define sound_download_rule
 asterisk-$(1)-%.tar.gz: have_download
        $(CMD_PREFIX)if test ! -f $$@ && test ! -f $$(SOUNDS_DIR)/.$$(subst .tar.gz,,$$@); then $(BS)
-         $$(DOWNLOAD) $$(WGET_ARGS) $$(SOUNDS_URL)/$$@; $(BS)
+         $$(DOWNLOAD) $$(SOUNDS_URL)/$$@; $(BS)
        fi
 endef