[Mesa-dev] [PATCH] mesa: Allow custom text to be inserted in version string at buildtime
Ian Romanick
idr at freedesktop.org
Mon Apr 22 21:19:46 PDT 2013
On 04/23/2013 03:28 AM, Chad Versace wrote:
> This allows maintainers/packagers/testers to tag the build with
> information that will be reported by GL_VERSION.
>
> If the environemt variable or make variable MESA_VERSION_STRING_EXTRA is
environment
> set, then its values will appear in the GL_VERSION string immediately
> after "Mesa X.Y" and before "(git-xxxxxxx)".
>
> This patch implements supports MESA_VERSION_STRING_EXTRA only for Android.
> Other build systems are left as an excercise.
Why is this useful?
> CC: Matt Turner <mattst88 at gmail.com>
> CC: Tapani Pälli <tapani.palli at intel.com>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
> src/mesa/Android.libmesa_dricore.mk | 4 ++++
> src/mesa/main/version.c | 3 +++
> 2 files changed, 7 insertions(+)
>
> diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk
> index 00c0694..20706a1 100644
> --- a/src/mesa/Android.libmesa_dricore.mk
> +++ b/src/mesa/Android.libmesa_dricore.mk
> @@ -52,6 +52,10 @@ endif # MESA_ENABLE_ASM
> LOCAL_CFLAGS := \
> $(patsubst %,-DFEATURE_%=1,$(MESA_ENABLED_APIS))
>
> +ifneq ($(strip $(MESA_VERSION_STRING_EXTRA)),)
> + LOCAL_CFLAGS += -DMESA_VERSION_STRING_EXTRA=\"$(MESA_VERSION_STRING_EXTRA)\"
> +endif
> +
> LOCAL_C_INCLUDES := \
> $(call intermediates-dir-for STATIC_LIBRARIES,libmesa_program,,) \
> $(MESA_TOP)/src/mapi \
> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
> index ecca446..3092323 100644
> --- a/src/mesa/main/version.c
> +++ b/src/mesa/main/version.c
> @@ -100,6 +100,9 @@ create_version_string(struct gl_context *ctx, const char *prefix)
> if (ctx->VersionString) {
> _mesa_snprintf(ctx->VersionString, max,
> "%s%u.%u%s Mesa " PACKAGE_VERSION
> +#ifdef MESA_VERSION_STRING_EXTRA
> + " " MESA_VERSION_STRING_EXTRA
> +#endif
> #ifdef MESA_GIT_SHA1
> " (" MESA_GIT_SHA1 ")"
> #endif
>
More information about the mesa-dev
mailing list