[Mesa-dev] [PATCH 1/2] android: Define Make variables for Android version

Chad Versace chad.versace at linux.intel.com
Thu Dec 20 13:42:28 PST 2012


Define the following Make variables:
    MESA_ANDROID_MAJOR_VERSION
    MESA_ANDROID_MINOR_VERSION
    MESA_ANDROID_VERSION

These variable will allow us to make version-dependent decisions on
library dependencies. In particular, building Mesa against JellyBean will
require libsync.

CC: Tapani Pälli <tapani.palli at intel.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 Android.common.mk | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index 18e5726..1cc3344 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -33,11 +33,13 @@ endif
 LOCAL_C_INCLUDES += \
 	$(MESA_TOP)/include
 
+MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
+MESA_ANDROID_MINOR_VERSION := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
+MESA_ANDROID_VERSION := $(shell printf "%d.%d" $(MESA_ANDROID_MAJOR_VERSION) $(MESA_ANDROID_MINOR_VERSION))
+
 # define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
-major := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
-minor := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
 LOCAL_CFLAGS += \
-	-DANDROID_VERSION=0x0$(major)0$(minor)
+	-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANROID_MINOR_VERSION)
 
 LOCAL_CFLAGS += \
 	-DHAVE_PTHREAD=1 \
-- 
1.7.11.7



More information about the mesa-dev mailing list