FreeBSD 6.1 does not include wget by default. However, it has fetch which will

work just fine for our purposes of downloading the sounds packages.  So, check
for both wget and fetch and the configure script and use what was found to
download them.  If neither one was found, and sound packages are selected that
must be downloaded, the install process will print out an informative error
message indicating the situation.

Also, fix a couple places where "make" was hard coded into some output messages
by replacing them with the $(MAKE) variable.

(issue #8451, initial patch by pabelanger, with additional modifications by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-12-01 23:16:28 +00:00
parent 8cbe6025b6
commit fee1970293
5 changed files with 154 additions and 32 deletions

View File

@@ -57,6 +57,7 @@ export DESTDIR
export PROC export PROC
export SOLINK export SOLINK
export STRIP export STRIP
export DOWNLOAD
# even though we could use '-include makeopts' here, use a wildcard # even though we could use '-include makeopts' here, use a wildcard
# lookup anyway, so that make won't try to build makeopts if it doesn't # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -273,14 +274,14 @@ all: _all
@echo " + Asterisk has successfully been built, and +" @echo " + Asterisk has successfully been built, and +"
@echo " + can be installed by running: +" @echo " + can be installed by running: +"
@echo " + +" @echo " + +"
@echo " + make install +" @echo " + $(MAKE) install +"
@echo " +-------------------------------------------+" @echo " +-------------------------------------------+"
_all: cleantest $(SUBDIRS) _all: cleantest $(SUBDIRS)
makeopts: configure makeopts: configure
@echo "****" @echo "****"
@echo "**** The configure script must be executed before running 'make'." @echo "**** The configure script must be executed before running '$(MAKE)'."
@echo "****" @echo "****"
@exit 1 @exit 1

110
configure vendored
View File

@@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.ac Revision: 47327 . # From configure.ac Revision: 47758 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60a. # Generated by GNU Autoconf 2.60a.
# #
@@ -691,6 +691,9 @@ DIRNAME
LN LN
DOT DOT
STRIP STRIP
WGET
FETCH
DOWNLOAD
AST_DEVMODE AST_DEVMODE
ALSA_LIB ALSA_LIB
ALSA_INCLUDE ALSA_INCLUDE
@@ -5568,6 +5571,94 @@ echo "${ECHO_T}no" >&6; }
fi fi
# Extract the first word of "wget", so it can be a program name with args.
set dummy wget; 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_path_WGET+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $WGET in
[\\/]* | ?:[\\/]*)
ac_cv_path_WGET="$WGET" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WGET" && ac_cv_path_WGET=":"
;;
esac
fi
WGET=$ac_cv_path_WGET
if test -n "$WGET"; then
{ echo "$as_me:$LINENO: result: $WGET" >&5
echo "${ECHO_T}$WGET" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
else
# Extract the first word of "fetch", so it can be a program name with args.
set dummy fetch; 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_path_FETCH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $FETCH in
[\\/]* | ?:[\\/]*)
ac_cv_path_FETCH="$FETCH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_FETCH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_FETCH" && ac_cv_path_FETCH=":"
;;
esac
fi
FETCH=$ac_cv_path_FETCH
if test -n "$FETCH"; then
{ echo "$as_me:$LINENO: result: $FETCH" >&5
echo "${ECHO_T}$FETCH" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
DOWNLOAD=${FETCH}
fi
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
@@ -31677,14 +31768,14 @@ DIRNAME!$DIRNAME$ac_delim
LN!$LN$ac_delim LN!$LN$ac_delim
DOT!$DOT$ac_delim DOT!$DOT$ac_delim
STRIP!$STRIP$ac_delim STRIP!$STRIP$ac_delim
WGET!$WGET$ac_delim
FETCH!$FETCH$ac_delim
DOWNLOAD!$DOWNLOAD$ac_delim
AST_DEVMODE!$AST_DEVMODE$ac_delim AST_DEVMODE!$AST_DEVMODE$ac_delim
ALSA_LIB!$ALSA_LIB$ac_delim ALSA_LIB!$ALSA_LIB$ac_delim
ALSA_INCLUDE!$ALSA_INCLUDE$ac_delim ALSA_INCLUDE!$ALSA_INCLUDE$ac_delim
PBX_ALSA!$PBX_ALSA$ac_delim PBX_ALSA!$PBX_ALSA$ac_delim
CURL_LIB!$CURL_LIB$ac_delim CURL_LIB!$CURL_LIB$ac_delim
CURL_INCLUDE!$CURL_INCLUDE$ac_delim
PBX_CURL!$PBX_CURL$ac_delim
CURSES_LIB!$CURSES_LIB$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -31726,6 +31817,9 @@ _ACEOF
ac_delim='%!_!# ' ac_delim='%!_!# '
for ac_last_try in false false false false false :; do for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF cat >conf$$subs.sed <<_ACEOF
CURL_INCLUDE!$CURL_INCLUDE$ac_delim
PBX_CURL!$PBX_CURL$ac_delim
CURSES_LIB!$CURSES_LIB$ac_delim
CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim
PBX_CURSES!$PBX_CURSES$ac_delim PBX_CURSES!$PBX_CURSES$ac_delim
GNUTLS_LIB!$GNUTLS_LIB$ac_delim GNUTLS_LIB!$GNUTLS_LIB$ac_delim
@@ -31820,9 +31914,6 @@ TONEZONE_INCLUDE!$TONEZONE_INCLUDE$ac_delim
PBX_TONEZONE!$PBX_TONEZONE$ac_delim PBX_TONEZONE!$PBX_TONEZONE$ac_delim
VORBIS_LIB!$VORBIS_LIB$ac_delim VORBIS_LIB!$VORBIS_LIB$ac_delim
VORBIS_INCLUDE!$VORBIS_INCLUDE$ac_delim VORBIS_INCLUDE!$VORBIS_INCLUDE$ac_delim
PBX_VORBIS!$PBX_VORBIS$ac_delim
VPB_LIB!$VPB_LIB$ac_delim
VPB_INCLUDE!$VPB_INCLUDE$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -31864,6 +31955,9 @@ _ACEOF
ac_delim='%!_!# ' ac_delim='%!_!# '
for ac_last_try in false false false false false :; do for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF cat >conf$$subs.sed <<_ACEOF
PBX_VORBIS!$PBX_VORBIS$ac_delim
VPB_LIB!$VPB_LIB$ac_delim
VPB_INCLUDE!$VPB_INCLUDE$ac_delim
PBX_VPB!$PBX_VPB$ac_delim PBX_VPB!$PBX_VPB$ac_delim
ZLIB_LIB!$ZLIB_LIB$ac_delim ZLIB_LIB!$ZLIB_LIB$ac_delim
ZLIB_INCLUDE!$ZLIB_INCLUDE$ac_delim ZLIB_INCLUDE!$ZLIB_INCLUDE$ac_delim
@@ -31903,7 +31997,7 @@ CURL!$CURL$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 37; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 40; then
break break
elif $ac_last_try; then elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@@ -149,6 +149,14 @@ AC_PATH_PROG([SHELL], [sh], :)
AC_PATH_PROG([LN], [ln], :) AC_PATH_PROG([LN], [ln], :)
AC_PATH_PROG([DOT], [dot], :) AC_PATH_PROG([DOT], [dot], :)
AC_PATH_PROG([STRIP], [strip], :) AC_PATH_PROG([STRIP], [strip], :)
AC_PATH_PROG([WGET], [wget], :)
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
else
AC_PATH_PROG([FETCH], [fetch], [:])
DOWNLOAD=${FETCH}
fi
AC_SUBST(DOWNLOAD)
AC_LANG(C) AC_LANG(C)

View File

@@ -19,6 +19,9 @@ LN=@LN@
QTMOC=@QTMOC@ QTMOC=@QTMOC@
DOT=@DOT@ DOT=@DOT@
STRIP=@STRIP@ STRIP=@STRIP@
WGET=@WGET@
FETCH=@FETCH@
DOWNLOAD=@DOWNLOAD@
BUILD_PLATFORM=@BUILD_PLATFORM@ BUILD_PLATFORM=@BUILD_PLATFORM@
BUILD_CPU=@BUILD_CPU@ BUILD_CPU=@BUILD_CPU@

View File

@@ -11,9 +11,9 @@
# the GNU General Public License # the GNU General Public License
# #
.PHONY: dist-clean all uninstall .PHONY: dist-clean all uninstall have_download install
-include $(ASTTOPDIR)/menuselect.makeopts -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/makeopts
PWD:=$(shell pwd) PWD:=$(shell pwd)
SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
@@ -56,69 +56,85 @@ WGET_ARGS:=--continue
all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH) all: $(CORE_SOUNDS) $(EXTRA_SOUNDS) $(MOH)
$(SOUNDS_DIR)/.asterisk-core-sounds-en-%: have_download:
@if test "$(DOWNLOAD)" = ":" ; then \
echo "**************************************************"; \
echo "*** ***"; \
echo "*** You must have either wget or fetch to be ***"; \
echo "*** able to automatically download and install ***"; \
echo "*** the requested sound packages. ***"; \
echo "*** ***"; \
echo "*** Please install one of these, or remove any ***"; \
echo "*** extra sound package selections in ***"; \
echo "*** menuselecct before installing Asterisk. ***"; \
echo "*** ***"; \
echo "**************************************************"; \
exit 1; \
fi
$(SOUNDS_DIR)/.asterisk-core-sounds-en-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(SOUNDS_DIR)/.asterisk-core-sounds-es-%: $(SOUNDS_DIR)/.asterisk-core-sounds-es-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: $(SOUNDS_DIR)/.asterisk-core-sounds-fr-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(CORE_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-en-%: $(SOUNDS_DIR)/.asterisk-extra-sounds-en-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-es-%: $(SOUNDS_DIR)/.asterisk-extra-sounds-es-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR)/es; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%: $(SOUNDS_DIR)/.asterisk-extra-sounds-fr-%: have_download
@PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(SOUNDS_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \ rm -f $(subst -$(EXTRA_SOUNDS_VERSION),,$@)-* && \
(cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(SOUNDS_DIR)/fr; cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
$(MOH_DIR)/.asterisk-moh-%: $(MOH_DIR)/.asterisk-moh-%: have_download
@PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \ @PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then wget $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \ if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \ if test ! -f $${PACKAGE}; then exit 1; fi; \
(cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \ (cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xf -) && \
touch $@ touch $@
asterisk-core-%.tar.gz: asterisk-core-%.tar.gz: have_download
@wget $(WGET_ARGS) $(SOUNDS_URL)/$@ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
asterisk-extra-%.tar.gz: asterisk-extra-%.tar.gz: have_download
@wget $(WGET_ARGS) $(SOUNDS_URL)/$@ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
asterisk-moh-%.tar.gz: asterisk-moh-%.tar.gz: have_download
@wget $(WGET_ARGS) $(SOUNDS_URL)/$@ @$(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$@
dist-clean: dist-clean:
rm -f *.tar.gz rm -f *.tar.gz