|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl, configure: print a warning if flex/bison are needed
# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxx>
# Date 1335350649 -3600
# Node ID 841b7e3bd1f99f6a61fde8e2bf670a3327135184
# Parent e428eae1838c0c384a6f311750e3024a257a3793
libxl, configure: 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.
[ Improved the warning message slightly. -iwj ]
Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
diff -r e428eae1838c -r 841b7e3bd1f9 tools/configure
--- a/tools/configure Wed Apr 25 11:38:26 2012 +0100
+++ b/tools/configure Wed Apr 25 11:44:09 2012 +0100
@@ -5017,6 +5017,86 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+# Extract the first word of "bison", so it can be a program name with args.
+set dummy bison; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BISON+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $BISON in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x
"$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext"
>&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+BISON=$ac_cv_path_BISON
+if test -n "$BISON"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
+$as_echo "$BISON" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FLEX+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $FLEX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_FLEX="$FLEX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x
"$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext"
>&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+FLEX=$ac_cv_path_FLEX
+if test -n "$FLEX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5
+$as_echo "$FLEX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
diff -r e428eae1838c -r 841b7e3bd1f9 tools/configure.ac
--- a/tools/configure.ac Wed Apr 25 11:38:26 2012 +0100
+++ b/tools/configure.ac Wed Apr 25 11:44:09 2012 +0100
@@ -80,6 +80,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 -r e428eae1838c -r 841b7e3bd1f9 tools/libxl/Makefile
--- a/tools/libxl/Makefile Wed Apr 25 11:38:26 2012 +0100
+++ b/tools/libxl/Makefile Wed Apr 25 11:44:09 2012 +0100
@@ -48,6 +48,18 @@ please check libxl_linux.c and libxl_net
endif
endif
+ifeq ($(FLEX),)
+%.c %.h:: %.l
+ $(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 rebuild some libxl parsers and \
+ scanners, 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 \
@@ -82,11 +94,11 @@ all: $(CLIENTS) libxenlight.so libxenlig
$(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 $<
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |