diff options
author | Roger Pau Monne <roger.pau@citrix.com> | 2012-04-25 11:44:09 +0100 |
---|---|---|
committer | Roger Pau Monne <roger.pau@citrix.com> | 2012-04-25 11:44:09 +0100 |
commit | 5fce16c040f5e4fae51c5ad0db08f2cf3cd26094 (patch) | |
tree | 6e1c5b271c6543ce752002fa411d543512a0fb8f /tools | |
parent | d9abcb8495b2d481611f8d47b45680e5d9984a33 (diff) | |
download | xen-5fce16c040f5e4fae51c5ad0db08f2cf3cd26094.tar.gz xen-5fce16c040f5e4fae51c5ad0db08f2cf3cd26094.tar.bz2 xen-5fce16c040f5e4fae51c5ad0db08f2cf3cd26094.zip |
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@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/configure | 80 | ||||
-rw-r--r-- | tools/configure.ac | 2 | ||||
-rw-r--r-- | tools/libxl/Makefile | 16 |
3 files changed, 96 insertions, 2 deletions
diff --git a/tools/configure b/tools/configure index 6f60047cc5..897e061c28 100755 --- a/tools/configure +++ b/tools/configure @@ -5017,6 +5017,86 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' 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 --git a/tools/configure.ac b/tools/configure.ac index 11a743f485..57c887d15a 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -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 --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 2f63a671de..54694542a3 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 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 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 $< |