[Mesa-dev] [PATCH 2/2] configure.ac: error out if python/mako is not found when required
Matt Turner
mattst88 at gmail.com
Wed Apr 1 10:44:54 PDT 2015
On Mon, Mar 23, 2015 at 10:49 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> In case of using a distribution tarball (or a dirty git tree) one can
> have the generated sources locally. Make configure.ac error out
> otherwise, to alert that about the unmet requirement(s) of python/mako.
>
> Cc: Matt Turner <mattst88 at gmail.com>
> Suggested-by: Matt Turner <mattst88 at gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
> configure.ac | 45 +++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 43 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3e5b6f5..10a36cc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -123,8 +123,49 @@ if test "x$INDENT" != "xcat"; then
> fi
>
> AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
> -if test -n "$PYTHON2" -a "x$acv_mako_found" != "xyes"; then
> - AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
> +
> +if test -z "$PYTHON2"; then
> + if test ! -f "$srcdir/src/gallium/auxiliary/indices/u_indices_gen.c" -o \
> + ! -f "$srcdir/src/gallium/auxiliary/indices/u_unfilled_gen.c" -o \
> + ! -f "$srcdir/src/gallium/auxiliary/util/u_format_table.c" -o \
> + ! -f "$srcdir/src/glx/indirect.c" -o \
> + ! -f "$srcdir/src/glx/indirect.h" -o \
> + ! -f "$srcdir/src/glx/indirect_init.c" -o \
> + ! -f "$srcdir/src/glx/indirect_size.c" -o \
> + ! -f "$srcdir/src/glx/indirect_size.h" -o \
> + ! -f "$srcdir/src/mapi/es1api/glapi_mapi_tmp.h" -o \
> + ! -f "$srcdir/src/mapi/es2api/glapi_mapi_tmp.h" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapi_mapi_tmp.h" -o \
> + ! -f "$srcdir/src/mapi/glapi/glprocs.h" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapitemp.h" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapitable.h" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapi_gentable.c" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapi_x86.S" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapi_x86-64.S" -o \
> + ! -f "$srcdir/src/mapi/glapi/glapi_sparc.S" -o \
> + ! -f "$srcdir/src/mapi/shared-glapi/glapi_mapi_tmp.h" -o \
> + ! -f "$srcdir/src/mesa/drivers/dri/common/xmlpool/options.h" -o \
> + ! -f "$srcdir/src/mesa/main/enums.c" -o \
> + ! -f "$srcdir/src/mesa/main/api_exec.c" -o \
> + ! -f "$srcdir/src/mesa/main/dispatch.h" -o \
> + ! -f "$srcdir/src/mesa/main/format_info.h" -o \
> + ! -f "$srcdir/src/mesa/main/get_hash.h" -o \
> + ! -f "$srcdir/src/mesa/main/remap_helper.h" -o \
> + ! -f "$srcdir/src/util/format_srgb.c"; then
> + AC_MSG_ERROR([Python not found - unable to generate sources])
> + fi
> +else
> + if test "x$acv_mako_found" = xno; then
> + if test ! -f "$srcdir/src/glsl/nir/nir_builder_opcodes.h" -o \
> + ! -f "$srcdir/src/glsl/nir/nir_constant_expressions.c" -o \
> + ! -f "$srcdir/src/glsl/nir/nir_opcodes.c" -o \
> + ! -f "$srcdir/src/glsl/nir/nir_opcodes.h" -o \
> + ! -f "$srcdir/src/glsl/nir/nir_opt_algebraic.c" -o \
> + ! -f "$srcdir/src/mesa/main/format_pack.c" -o \
> + ! -f "$srcdir/src/mesa/main/format_unpack.c"; then
> + AC_MSG_ERROR([Python mako module v$PYTHON_MAKO_REQUIRED or higher not found])
> + fi
> + fi
I don't think the list of generated files is a good idea. For
starters, it's going to be difficult to remember to update.
Beyond that, I think there are only two real cases: (1) you're using a
released tarball in which case you have all of these files, and (2)
you're using a git checkout and you have none of them. Anything in
between doesn't seem meaningful.
We check for a single generated file from bison (and a single one from
flex), and have to my knowledge never encountered a problem by not
checking for additional files.
I really think that's sufficient.
More information about the mesa-dev
mailing list