aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2012-10-30 18:11:02 +0000
committerRoger Pau Monne <roger.pau@citrix.com>2012-10-30 18:11:02 +0000
commit26104b09f9269bed2805423ba0f398254c324eee (patch)
tree94251e75270a3202ed3c935321b8cfe4df101684
parentecf9846a6a200e8c8cfb26d409d18fd9615df9b9 (diff)
downloadxen-26104b09f9269bed2805423ba0f398254c324eee.tar.gz
xen-26104b09f9269bed2805423ba0f398254c324eee.tar.bz2
xen-26104b09f9269bed2805423ba0f398254c324eee.zip
autoconf: check for wget and ftp
Some OSes don't come with wget by default, so ftp should be choosen on those. Add an autoconf check to check for wget and ftp, and replace the usage of hardcoded wget in tools. [ Stubdom builds still use wget unconditionally. -iwj ] Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--config/StdGNU.mk2
-rw-r--r--config/Tools.mk.in1
-rwxr-xr-xtools/configure107
-rw-r--r--tools/configure.ac2
-rw-r--r--tools/firmware/etherboot/Makefile2
5 files changed, 111 insertions, 3 deletions
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index b6adbbe422..3febe8dc28 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -22,8 +22,6 @@ MSGMERGE = msgmerge
# Allow git to be wrappered in the environment
GIT ?= git
-WGET ?= wget -c
-
INSTALL = install
INSTALL_DIR = $(INSTALL) -d -m0755 -p
INSTALL_DATA = $(INSTALL) -m0644 -p
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index a6ecf48dfd..a78f2113e3 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -22,6 +22,7 @@ AS86 := @AS86@
LD86 := @LD86@
BCC := @BCC@
IASL := @IASL@
+FETCHER := @FETCHER@
# Extra folder for libs/includes
PREPEND_INCLUDES := @PREPEND_INCLUDES@
diff --git a/tools/configure b/tools/configure
index 6292a264c3..edf42f6b0d 100755
--- a/tools/configure
+++ b/tools/configure
@@ -606,6 +606,9 @@ libgcrypt
EXTFS_LIBS
system_aio
zlib
+FETCHER
+FTP
+WGET
glib_LIBS
glib_CFLAGS
PKG_CONFIG_LIBDIR
@@ -2392,6 +2395,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
# Enable/disable options
# Check whether --enable-githttp was given.
@@ -6095,6 +6100,108 @@ $as_echo "yes" >&6; }
fi
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WGET+set}" = set; then :
+ $as_echo_n "(cached) " >&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_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_WGET="$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_WGET" && ac_cv_path_WGET="no"
+ ;;
+esac
+fi
+WGET=$ac_cv_path_WGET
+if test -n "$WGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5
+$as_echo "$WGET" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"$WGET" != x"no"; then :
+
+ FETCHER="$WGET -c -O"
+
+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 test "${ac_cv_path_FTP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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="no"
+ ;;
+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 x"$FTP" != x"no"; then :
+
+ FETCHER="$FTP -o"
+
+else
+
+ as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+
+fi
+
+fi
+
+
+
# Checks for libraries.
ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
if test "x$ac_cv_header_bzlib_h" = x""yes; then :
diff --git a/tools/configure.ac b/tools/configure.ac
index 3318fea958..e708f015de 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -35,6 +35,7 @@ m4_include([m4/curses.m4])
m4_include([m4/pthread.m4])
m4_include([m4/ptyfuncs.m4])
m4_include([m4/extfs.m4])
+m4_include([m4/fetcher.m4])
# Enable/disable options
AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
@@ -117,6 +118,7 @@ esac
AX_CHECK_UUID
AX_CHECK_CURSES
PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.12])
+AX_CHECK_FETCHER
# Checks for libraries.
AC_CHECK_HEADER([bzlib.h], [
diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile
index a195888dff..15561fc0a8 100644
--- a/tools/firmware/etherboot/Makefile
+++ b/tools/firmware/etherboot/Makefile
@@ -28,7 +28,7 @@ all: $(ROMS)
$(MAKE) -C $D/src bin/$(*F).rom
$T:
- if ! wget -O _$T $(IPXE_TARBALL_URL); then \
+ if ! $(FETCHER) _$T $(IPXE_TARBALL_URL); then \
$(GIT) clone $(IPXE_GIT_URL) $D.git; \
(cd $D.git && $(GIT) archive --format=tar --prefix=$D/ \
$(IPXE_GIT_TAG) | gzip >../_$T); \