xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] libxl/build: print a warning if flex/bison are needed
@ 2012-04-25  9:14 Roger Pau Monne
  2012-04-25 10:45 ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monne @ 2012-04-25  9:14 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Roger Pau Monne

This patch adds better support for both Flex and Bison, which might
be needed to compile libxl. Now configure script sets BISON and FLEX
Makefile vars if bison and flex are found, but doesn't complain if
they are not found.

Also, added some Makefile soccery to print a warning message if
Bison or Flex are needed but not found.

Please run autogen after applying this patch.

Changes since v1:

 * Print a warning message instead of an error if flex/bison are
   needed but not found.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/configure.ac   |    2 ++
 tools/libxl/Makefile |   16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index 250dffd..47becfe 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -77,6 +77,8 @@ AC_PROG_CC
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
+AC_PATH_PROG([BISON], [bison])
+AC_PATH_PROG([FLEX], [flex])
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
 AS_IF([test "x$xapi" = "xy"], [
     AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 0ac43bd..13de15d 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -48,6 +48,18 @@ please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
 endif
 
+ifeq ($(FLEX),)
+%.c %.h:: %.l
+	$(warning Flex is needed to compile libxl, please install it and rerun \
+	configure)
+endif
+
+ifeq ($(BISON),)
+%.c %.h:: %.y
+	$(warning Bison is needed to compile libxl, please install it an rerun \
+	configure)
+endif
+
 LIBXL_LIBS += -lyajl
 
 LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
@@ -83,11 +95,11 @@ all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
 
 $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): $(AUTOINCS)
 
-%.c %.h: %.y
+%.c %.h:: %.y
 	@rm -f $*.[ch]
 	$(BISON) --output=$*.c $<
 
-%.c %.h: %.l
+%.c %.h:: %.l
 	@rm -f $*.[ch]
 	$(FLEX) --header-file=$*.h --outfile=$*.c $<
 
-- 
1.7.7.5 (Apple Git-26)

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

* Re: [PATCH v2] libxl/build: print a warning if flex/bison are needed
  2012-04-25  9:14 [PATCH v2] libxl/build: print a warning if flex/bison are needed Roger Pau Monne
@ 2012-04-25 10:45 ` Ian Jackson
  2012-04-25 10:46   ` Roger Pau Monne
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2012-04-25 10:45 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel@lists.xen.org

Roger Pau Monne writes ("[PATCH v2] libxl/build: print a warning if flex/bison are needed"):
> This patch adds better support for both Flex and Bison, which might
> be needed to compile libxl. Now configure script sets BISON and FLEX
> Makefile vars if bison and flex are found, but doesn't complain if
> they are not found.
> 
> Also, added some Makefile soccery to print a warning message if
> Bison or Flex are needed but not found.

Marvellous.  I have applied this.  I altered the warning message
slightly:

 +ifeq ($(FLEX),)
 +%.c %.h:: %.l
-+      $(warning Flex is needed to compile libxl, please install it and rerun \
-+      configure)
++      $(warning Flex is needed to rebuild some libxl parsers and \
++                scanners, please install it and rerun configure)
 +endif
 +
 +ifeq ($(BISON),)
 +%.c %.h:: %.y
-+      $(warning Bison is needed to compile libxl, please install it an rerun \
-+      configure)
++      $(warning Bison is needed to rebuild some libxl parsers and \
++                scanners, please install it an rerun configure)
 +endif
 +

I trust that's OK.

Thanks,
Ian.

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

* Re: [PATCH v2] libxl/build: print a warning if flex/bison are needed
  2012-04-25 10:45 ` Ian Jackson
@ 2012-04-25 10:46   ` Roger Pau Monne
  0 siblings, 0 replies; 3+ messages in thread
From: Roger Pau Monne @ 2012-04-25 10:46 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel@lists.xen.org

Ian Jackson escribió:
> Roger Pau Monne writes ("[PATCH v2] libxl/build: print a warning if flex/bison are needed"):
>> This patch adds better support for both Flex and Bison, which might
>> be needed to compile libxl. Now configure script sets BISON and FLEX
>> Makefile vars if bison and flex are found, but doesn't complain if
>> they are not found.
>>
>> Also, added some Makefile soccery to print a warning message if
>> Bison or Flex are needed but not found.
>
> Marvellous.  I have applied this.  I altered the warning message
> slightly:
>
>   +ifeq ($(FLEX),)
>   +%.c %.h:: %.l
> -+      $(warning Flex is needed to compile libxl, please install it and rerun \
> -+      configure)
> ++      $(warning Flex is needed to rebuild some libxl parsers and \
> ++                scanners, please install it and rerun configure)
>   +endif
>   +
>   +ifeq ($(BISON),)
>   +%.c %.h:: %.y
> -+      $(warning Bison is needed to compile libxl, please install it an rerun \
> -+      configure)
> ++      $(warning Bison is needed to rebuild some libxl parsers and \
> ++                scanners, please install it an rerun configure)
>   +endif
>   +
>
> I trust that's OK.

Sure, thanks!

> Thanks,
> Ian.

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

end of thread, other threads:[~2012-04-25 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25  9:14 [PATCH v2] libxl/build: print a warning if flex/bison are needed Roger Pau Monne
2012-04-25 10:45 ` Ian Jackson
2012-04-25 10:46   ` Roger Pau Monne

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