From d2efd107a82ca9301c6d9c2ab00f565880b3e4ea Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 10 Jun 2014 19:16:13 -0700 Subject: i965/build: Add configure option to build i965_dri.so for a single Gen. Allows the compiler to cut dead code and simplify when we know the driver will run on a single platform. Perhaps useful for distributions wanting to ship new hardware support without the risk involved in updating Mesa for existing hardware. --- configure.ac | 11 +++++++++++ src/mesa/drivers/dri/i965/Makefile.am | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index d897ac66665..4b274559467 100644 --- a/configure.ac +++ b/configure.ac @@ -1196,6 +1196,17 @@ AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \ "x$enable_osmesa" = xyes -o \ -n "$DRI_DIRS") +dnl +dnl i965 Generation configuration +dnl +AC_ARG_ENABLE([only-i965-gen], + [AS_HELP_STRING([--enable-only-i965-gen={4,5,6,7,8,...}], + [Builds i965_dri.so with support for only one generation @<:@default=all supported@:>@])], + [enable_only_i965_gen="$enableval"], + [enable_only_i965_gen=""]) +AC_SUBST([I965_GEN], "$enable_only_i965_gen") +AM_CONDITIONAL(I965_SINGLE_GEN, test -n "$enable_only_i965_gen") + dnl dnl OSMesa configuration dnl diff --git a/src/mesa/drivers/dri/i965/Makefile.am b/src/mesa/drivers/dri/i965/Makefile.am index 53ca47d1838..721c9ef5592 100644 --- a/src/mesa/drivers/dri/i965/Makefile.am +++ b/src/mesa/drivers/dri/i965/Makefile.am @@ -23,8 +23,14 @@ include Makefile.sources +if I965_SINGLE_GEN +AM_CPPFLAGS = \ + -DSTATIC_GEN=$(I965_GEN) \ + -DGEN='((void) brw, STATIC_GEN)' +else AM_CPPFLAGS = \ -DGEN='brw->gen' +endif AM_CFLAGS = \ -I$(top_srcdir)/include \ -- cgit v1.2.3