[Mesa-dev] [PATCH v3] build: unify mesa version by using a VERSION file

Chad Versace chad.versace at linux.intel.com
Mon Jul 29 11:55:59 PDT 2013


On 07/25/2013 03:45 PM, Emil Velikov wrote:
> Rather than having to keep track of all the build systems and their respecitve
> definition of the mesa version, use a single top file VERSION. Every build
> system is responsible for reading/parsing the file and using it
>
> v2:
> * remove useless bulletpoint from the documentation, suggested by Matt
> * "Androing is Linux. Use '/' in stead of '\'", spotted by Chad V
> * use cleaner code to get the version in scons, suggested by Chad V
>
> v3:
> * ensure leading and trailing whitespace characters are stripped while parsing
> * android: handle GNU shell commands approapriately
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>
> An interesting point while looking for ways to strip the newline character
> - python considers carrage return as whitespace whereas m4 does not.
> AFAICS no-one has used those nasty symbols in mesa, and I hope no-one will.
>
> Just to be on the safe side I have tested editing the VERSION file with a
> few different editors, adding multiple newlines at the end of the file.
> SCons and Automake worked fine, whereas for Android I'm short of the build
> system.
>
> Cheers
> Emil
> ---
>   Android.common.mk |  3 ++-
>   Makefile.am       |  1 +
>   SConstruct        |  4 +++-
>   VERSION           |  1 +
>   configure.ac      |  3 ++-
>   docs/devinfo.html | 10 +---------
>   6 files changed, 10 insertions(+), 12 deletions(-)
>   create mode 100644 VERSION
>
> diff --git a/Android.common.mk b/Android.common.mk
> index dd37104..3e6d4c3 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -33,9 +33,10 @@ endif
>   LOCAL_C_INCLUDES += \
>   	$(MESA_TOP)/include
>
> +MESA_VERSION=$(shell cat $(MESA_TOP)/VERSION)
>   # define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
>   LOCAL_CFLAGS += \
> -	-DPACKAGE_VERSION=\"9.3.0-devel\" \
> +	-DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
>   	-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
>   	-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)

To mock-test the Android build system, I created a simple Makefile and version.c file
that used the same idiom introduced by this hunk. I verified that that MESA_VERSION
contains no newline, even if the VERSION file contains multiple trailing newlines.

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>



More information about the mesa-dev mailing list