All of lore.kernel.org
 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

* [PATCH 2/2] autoconf: bash is not needed on NetBSD
  2012-10-30  9:22 [PATCH 1/2] autoconf: check for wget and ftp Roger Pau Monne
@ 2012-10-30  9:22 ` 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
  1 sibling, 1 reply; 8+ messages in thread
From: Roger Pau Monne @ 2012-10-30  9:22 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

Remove check for bash on NetBSD, since it is not needed for hotplug
scripts (NetBSD hotplug scripts use sh) or the build system.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/configure.ac |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index e708f01..47607ae 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -93,7 +93,11 @@ AS_IF([test "x$ocamltools" = "xy"], [
         ocamltools="n"
     ])
 ])
-AX_PATH_PROG_OR_FAIL([BASH], [bash])
+case "$host_os" in
+linux*)
+    AX_PATH_PROG_OR_FAIL([BASH], [bash])
+    ;;
+esac
 AS_IF([echo "$PYTHON" | grep -q "^/"], [
     PYTHONPATH=$PYTHON
     PYTHON=`basename $PYTHONPATH`
-- 
1.7.7.5 (Apple Git-26)

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

* Re: [PATCH 2/2] autoconf: bash is not needed on NetBSD
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2012-10-30 14:58 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[Xen-devel] [PATCH 2/2] autoconf: bash is not needed on NetBSD"):
> Remove check for bash on NetBSD, since it is not needed for hotplug
> scripts (NetBSD hotplug scripts use sh) or the build system.

Is it really the case that we have no bashisms in our build system ?
I'm not convinced that even if this is true it's a property worth the
effort to preserve.

Ian.

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

* Re: [PATCH 1/2] autoconf: check for wget and ftp
  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 15:02 ` Ian Jackson
  2012-10-30 16:32   ` Roger Pau Monné
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Jackson @ 2012-10-30 15:02 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Christoph Egger, xen-devel

Roger Pau Monne writes ("[Xen-devel] [PATCH 1/2] 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.

I don't think this can be right; wget is used in many more places.  At
the very least it looks like it will break the stubdom build since
that is full of WGET.  Did you grep for WGET ?

Does "ftp -o blah.tar.gz http://xenbits.xen.org/xen-extfiles/blah.tar.gz"
really work on NetBSD and download to the local file "blah.tar.gz" ?

Ian.

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

* Re: [PATCH 1/2] autoconf: check for wget and ftp
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Pau Monné @ 2012-10-30 16:32 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Christoph Egger, xen-devel

On 30/10/12 16:02, Ian Jackson wrote:
> Roger Pau Monne writes ("[Xen-devel] [PATCH 1/2] 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.
> 
> I don't think this can be right; wget is used in many more places.  At
> the very least it looks like it will break the stubdom build since
> that is full of WGET.  Did you grep for WGET ?

Does stubdom build import config/Tools.mk? I thought it was only used to
build the tools directory. If that's the case I don't think it will
break anything, since we define a new variable $FETCHER, that shouldn't
be used anywhere else, so the rest will continue to use the hardcoded
wget, or whatever it was using prior to this patch.

> Does "ftp -o blah.tar.gz http://xenbits.xen.org/xen-extfiles/blah.tar.gz"
> really work on NetBSD and download to the local file "blah.tar.gz" ?

Yes.

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

* Re: [PATCH 1/2] autoconf: check for wget and ftp
  2012-10-30 16:32   ` Roger Pau Monné
@ 2012-10-30 17:32     ` Ian Jackson
  2012-10-30 17:48       ` Roger Pau Monné
  0 siblings, 1 reply; 8+ messages in thread
From: Ian Jackson @ 2012-10-30 17:32 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: Christoph Egger, xen-devel

Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 1/2] autoconf: check for wget and ftp"):
> On 30/10/12 16:02, Ian Jackson wrote:
> > I don't think this can be right; wget is used in many more places.  At
> > the very least it looks like it will break the stubdom build since
> > that is full of WGET.  Did you grep for WGET ?
> 
> Does stubdom build import config/Tools.mk? I thought it was only used to
> build the tools directory. If that's the case I don't think it will
> break anything, since we define a new variable $FETCHER, that shouldn't
> be used anywhere else, so the rest will continue to use the hardcoded
> wget, or whatever it was using prior to this patch.

Err, yes, it seems stubdom/Makefile has its own definition of wget.
But stubdom builds are still going to be broken without wget then ?

Ian.

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

* Re: [PATCH 1/2] autoconf: check for wget and ftp
  2012-10-30 17:32     ` Ian Jackson
@ 2012-10-30 17:48       ` Roger Pau Monné
  2012-10-30 18:11         ` Ian Jackson
  0 siblings, 1 reply; 8+ messages in thread
From: Roger Pau Monné @ 2012-10-30 17:48 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Christoph Egger, xen-devel

On 30/10/12 18:32, Ian Jackson wrote:
> Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 1/2] autoconf: check for wget and ftp"):
>> On 30/10/12 16:02, Ian Jackson wrote:
>>> I don't think this can be right; wget is used in many more places.  At
>>> the very least it looks like it will break the stubdom build since
>>> that is full of WGET.  Did you grep for WGET ?
>>
>> Does stubdom build import config/Tools.mk? I thought it was only used to
>> build the tools directory. If that's the case I don't think it will
>> break anything, since we define a new variable $FETCHER, that shouldn't
>> be used anywhere else, so the rest will continue to use the hardcoded
>> wget, or whatever it was using prior to this patch.
> 
> Err, yes, it seems stubdom/Makefile has its own definition of wget.
> But stubdom builds are still going to be broken without wget then ?

Yes, but I don't think we should check for the requirements of stubdoms
build process if we are not going to include config/Tools.mk to build
them. For example NetBSD cannot build stubdoms (for other reasons), so
we shouldn't enforce wget presence in configure.

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

* Re: [PATCH 1/2] autoconf: check for wget and ftp
  2012-10-30 17:48       ` Roger Pau Monné
@ 2012-10-30 18:11         ` Ian Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2012-10-30 18:11 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Christoph Egger, xen-devel

Roger Pau Monne writes ("Re: [Xen-devel] [PATCH 1/2] autoconf: check for wget and ftp"):
> On 30/10/12 18:32, Ian Jackson wrote:
> > Err, yes, it seems stubdom/Makefile has its own definition of wget.
> > But stubdom builds are still going to be broken without wget then ?
> 
> Yes, but I don't think we should check for the requirements of stubdoms
> build process if we are not going to include config/Tools.mk to build
> them. For example NetBSD cannot build stubdoms (for other reasons), so
> we shouldn't enforce wget presence in configure.

Fair enough, thanks for the explanation.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.