[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] autoconf: check for wget and ftp


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 31 Oct 2012 02:55:12 +0000
  • Delivery-date: Wed, 31 Oct 2012 02:55:24 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxx>
# Date 1351620662 0
# Node ID f6d5b3bf74a83fe84eb2909657b7f1db7f0f8253
# Parent  ab2dc9b9f68dc4561619a50b05c6409834eda65e
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@xxxxxxx>
Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r ab2dc9b9f68d -r f6d5b3bf74a8 config/StdGNU.mk
--- a/config/StdGNU.mk  Tue Oct 30 16:46:07 2012 +0100
+++ b/config/StdGNU.mk  Tue Oct 30 18:11:02 2012 +0000
@@ -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 -r ab2dc9b9f68d -r f6d5b3bf74a8 config/Tools.mk.in
--- a/config/Tools.mk.in        Tue Oct 30 16:46:07 2012 +0100
+++ b/config/Tools.mk.in        Tue Oct 30 18:11:02 2012 +0000
@@ -22,6 +22,7 @@ AS86                := @AS86@
 LD86                := @LD86@
 BCC                 := @BCC@
 IASL                := @IASL@
+FETCHER             := @FETCHER@
 
 # Extra folder for libs/includes
 PREPEND_INCLUDES    := @PREPEND_INCLUDES@
diff -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure
--- a/tools/configure   Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure   Tue Oct 30 18:11:02 2012 +0000
@@ -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 "$h
 
 
 
+
+
 # Enable/disable options
 
 # Check whether --enable-githttp was given.
@@ -6095,6 +6100,108 @@ else
 
 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 -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/configure.ac
--- a/tools/configure.ac        Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/configure.ac        Tue Oct 30 18:11:02 2012 +0000
@@ -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 -r ab2dc9b9f68d -r f6d5b3bf74a8 tools/firmware/etherboot/Makefile
--- a/tools/firmware/etherboot/Makefile Tue Oct 30 16:46:07 2012 +0100
+++ b/tools/firmware/etherboot/Makefile Tue Oct 30 18:11:02 2012 +0000
@@ -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); \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.