mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
d9abcb8495
commit
5fce16c040
3 files changed
+96
-2
No files matched your search
Vendored
+80
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
+14
-2
@@ -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 $<
|
||||
|
||||
|
||||