[Mesa-dev] [PATCH 2/4] Use AC_PROG_YACC/LEX

Gaetan Nadon memsize at videotron.ca
Sat Jan 14 15:33:49 PST 2012


On 12-01-14 11:16 AM, Matt Turner wrote:
> Needed for automake. Using AC_PROG_PATH(bison/flex) causes automake to
> fail to build .y and .l files.
>
> It is up to the builder to use bison/flex instead of yacc/lex.
>
> Signed-off-by: Matt Turner <mattst88 at gmail.com>
> ---
>  configs/autoconf.in |    4 ++--
>  configure.ac        |   13 ++++++++-----
>  2 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/configs/autoconf.in b/configs/autoconf.in
> index 3e5da79..f5b5a94 100644
> --- a/configs/autoconf.in
> +++ b/configs/autoconf.in
> @@ -62,8 +62,8 @@ PYTHON2 = @PYTHON2@
>  PYTHON_FLAGS = -t -O -O
>  
>  # Flex and Bison for GLSL compiler
> -FLEX = @FLEX@
> -BISON = @BISON@
> +FLEX = @LEX@
> +BISON = @YACC@
>  
>  # Library names (base name)
>  GL_LIB = @GL_LIB@
> diff --git a/configure.ac b/configure.ac
> index 388e180..97c0f3e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -53,11 +53,14 @@ if test "x$MKDEP" = "x"; then
>      AC_MSG_ERROR([makedepend is required to build Mesa])
>  fi
>  
> -AC_PATH_PROG([FLEX], [flex])
> -test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
> -
> -AC_PATH_PROG([BISON], [bison])
> -test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
> +AC_PROG_YACC
> +AC_PATH_PROG([YACC_INST], $YACC)
> +if test ! -f "$srcdir/gram.c"; then
> +    if test -z "$YACC_INST"; then
> +        AC_MSG_ERROR([yacc not found - unable to compile gram.y])
> +    fi
> +fi
> +AC_PROG_LEX
>  
Have you tested this patch? The files gram.c and gram.y are the files
from the modules where the code was obtained. You need to replace this
with an actual filename from mesa, for example, glcpp-parse.y with the
propoer subdirs.

The reasons for this test is to allow building from a tarball when
bison/flex are not available, but the generated code is.
>  dnl Our fallback install-sh is a symlink to minstall. Use the existing
>  dnl configuration in that case.



More information about the mesa-dev mailing list