xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xen.org
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 1/2] autoconf: check for wget and ftp
Date: Tue, 30 Oct 2012 10:22:37 +0100	[thread overview]
Message-ID: <1351588958-75040-1-git-send-email-roger.pau@citrix.com> (raw)

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.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
Please run autoconf after applying this patch.
---
 config/StdGNU.mk                  |    2 --
 config/Tools.mk.in                |    1 +
 tools/configure.ac                |    2 ++
 tools/firmware/etherboot/Makefile |    2 +-
 tools/m4/fetcher.m4               |   14 ++++++++++++++
 5 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 tools/m4/fetcher.m4

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index b6adbbe..3febe8d 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 a6ecf48..a78f211 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.ac b/tools/configure.ac
index 3318fea..e708f01 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 a195888..15561fc 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); \
diff --git a/tools/m4/fetcher.m4 b/tools/m4/fetcher.m4
new file mode 100644
index 0000000..86f33b3
--- /dev/null
+++ b/tools/m4/fetcher.m4
@@ -0,0 +1,14 @@
+AC_DEFUN([AX_CHECK_FETCHER], [
+AC_PATH_PROG([WGET],[wget], [no])
+AS_IF([test x"$WGET" != x"no"], [
+    FETCHER="$WGET -c -O"
+], [
+    AC_PATH_PROG([FTP],[ftp], [no])
+    AS_IF([test x"$FTP" != x"no"], [
+        FETCHER="$FTP -o"
+    ], [
+        AC_MSG_ERROR([cannot find wget or ftp])
+    ])
+])
+AC_SUBST(FETCHER)
+])
-- 
1.7.7.5 (Apple Git-26)

             reply	other threads:[~2012-10-30  9:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30  9:22 Roger Pau Monne [this message]
2012-10-30  9:22 ` [PATCH 2/2] autoconf: bash is not needed on NetBSD Roger Pau Monne
2012-10-30 14:58   ` Ian Jackson
2012-10-30 15:02 ` [PATCH 1/2] autoconf: check for wget and ftp Ian Jackson
2012-10-30 16:32   ` Roger Pau Monné
2012-10-30 17:32     ` Ian Jackson
2012-10-30 17:48       ` Roger Pau Monné
2012-10-30 18:11         ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351588958-75040-1-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Christoph.Egger@amd.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).