diff --git a/ChangeLog b/ChangeLog index b1770bf4b..e8fa86033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-04-10 BVK Chaitanya + + Fix FreeBSD build. + + * configure.ac: Flex version check. + * conf/common.rmk: Add -Wno-error to sh.mod. + * script/yylex.l: Remove all #pragma. + 2010-04-10 Vladimir Serbinenko * include/grub/util/misc.h (canonicalise_file_name): Add missing diff --git a/conf/common.rmk b/conf/common.rmk index 9987011a1..952be558c 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -656,7 +656,7 @@ normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For sh.mod. sh_mod_SOURCES = script/main.c script/script.c script/execute.c \ script/function.c script/lexer.c grub_script.tab.c grub_script.yy.c -sh_mod_CFLAGS = $(COMMON_CFLAGS) $(POSIX_CFLAGS) +sh_mod_CFLAGS = $(COMMON_CFLAGS) $(POSIX_CFLAGS) -Wno-error sh_mod_LDFLAGS = $(COMMON_LDFLAGS) ifneq (, $(FONT_SOURCE)) diff --git a/configure.ac b/configure.ac index a31264685..cabae08e3 100644 --- a/configure.ac +++ b/configure.ac @@ -170,11 +170,6 @@ if test "x$CMP" = x; then AC_MSG_ERROR([cmp is not found]) fi -AC_CHECK_PROGS([LEX], [flex]) -if test "x$LEX" = x; then - AC_MSG_ERROR([flex is not found]) -fi - AC_CHECK_PROGS([YACC], [bison]) if test "x$YACC" = x; then AC_MSG_ERROR([bison is not found]) @@ -189,9 +184,21 @@ done AC_PROG_INSTALL AC_PROG_AWK +AC_PROG_LEX AC_PROG_MAKE_SET AC_PROG_MKDIR_P +if test "x$LEX" = x; then + AC_MSG_ERROR([flex is not found]) +else + version=`$LEX --version | $AWK '{ split($NF,x,"."); print x[[1]]*10000+x[[2]]*100+x[[3]]; }'` + if test -n "$version" -a "$version" -ge 20535; then + : + else + AC_MSG_ERROR([flex is too old. GRUB requires 2.5.35 or above]) + fi +fi + # These are not a "must". AC_PATH_PROG(RUBY, ruby) AC_PATH_PROG(MAKEINFO, makeinfo) diff --git a/script/yylex.l b/script/yylex.l index 4d7c66448..0cf33c951 100644 --- a/script/yylex.l +++ b/script/yylex.l @@ -86,12 +86,6 @@ typedef size_t yy_size_t; #define exit(...) #endif -#pragma GCC diagnostic warning "-Wunused-variable" -#pragma GCC diagnostic warning "-Wunused-function" -#pragma GCC diagnostic warning "-Wunused-parameter" -#pragma GCC diagnostic warning "-Wstrict-prototypes" -#pragma GCC diagnostic warning "-Wmissing-prototypes" - } %option ecs