xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] autoconf: check for wget and ftp
@ 2012-10-30  9:22 Roger Pau Monne
  2012-10-30  9:22 ` [PATCH 2/2] autoconf: bash is not needed on NetBSD Roger Pau Monne
  2012-10-30 15:02 ` [PATCH 1/2] autoconf: check for wget and ftp Ian Jackson
  0 siblings, 2 replies; 8+ messages in thread
From: Roger Pau Monne @ 2012-10-30  9:22 UTC (permalink / raw)
  To: xen-devel; +Cc: Christoph Egger, Roger Pau Monne

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)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-30 18:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30  9:22 [PATCH 1/2] autoconf: check for wget and ftp Roger Pau Monne
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

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).