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: zhihao wang <accept.acm@gmail.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH] libxl/build: print a pretty message if flex/bison are needed but not found
Date: Fri, 13 Apr 2012 11:02:40 +0100	[thread overview]
Message-ID: <1334311360-32847-1-git-send-email-roger.pau@citrix.com> (raw)

This patchs 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 nice error message if Bison or Flex
are needed but not found.

Please run autogen after applying this patch.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Cc: zhihao wang <accept.acm@gmail.com>
Cc: Ian Campbell <Ian.Campbell@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 3da0c82..8ccdc92 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -75,6 +75,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 ac8b810..e8ec8e9 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
+	$(error Flex is needed to compile libxl, please install it and rerun \
+	configure)
+endif
+
+ifeq ($(BISON),)
+%.c %.h:: %.y
+	$(error 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)

             reply	other threads:[~2012-04-13 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 10:02 Roger Pau Monne [this message]
2012-04-24 16:47 ` [PATCH] libxl/build: print a pretty message if flex/bison are needed but not found 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=1334311360-32847-1-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=accept.acm@gmail.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).