Mesa (master): scons/android: add flag to check for enabled GL APIs

Oliver McFadden omcfadde at kemper.freedesktop.org
Wed Oct 10 09:45:21 UTC 2012


Module: Mesa
Branch: master
Commit: 6678125eaee1bbf231d997971cde30f22ba4e013
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6678125eaee1bbf231d997971cde30f22ba4e013

Author: Imre Deak <imre.deak at intel.com>
Date:   Wed Sep 12 19:46:05 2012 +0300

scons/android: add flag to check for enabled GL APIs

Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>

---

 src/mesa/Android.mk |    9 ++++-----
 src/mesa/SConscript |    9 +++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
index 4b62b81..c32b1c0 100644
--- a/src/mesa/Android.mk
+++ b/src/mesa/Android.mk
@@ -33,9 +33,7 @@ LOCAL_PATH := $(call my-dir)
 #     X86_FILES
 include $(LOCAL_PATH)/sources.mak
 
-common_CFLAGS := \
-	-DFEATURE_ES1=1 \
-	-DFEATURE_ES2=1
+MESA_ENABLED_APIS := ES1 ES2
 
 common_C_INCLUDES := \
 	$(MESA_TOP)/src/mapi \
@@ -100,9 +98,10 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := libmesa_dricore
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
+MESA_ENABLED_APIS += GL
 LOCAL_CFLAGS := \
-	$(common_CFLAGS) \
-	-DFEATURE_GL=1
+   $(common_CFLAGS) \
+   $(patsubst %,-DFEATURE_%=1,$(MESA_ENABLED_APIS))
 
 LOCAL_C_INCLUDES := \
 	$(common_C_INCLUDES)
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 9819082..7d7d519 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -16,9 +16,8 @@ env.Append(CPPPATH = [
     '#/src/mesa',
 ])
 
-env.Append(CPPDEFINES = [
-    'FEATURE_GL=1',
-])
+enabled_apis = []
+enabled_apis += ['GL']
 
 if env['platform'] == 'windows':
     env.Append(CPPDEFINES = [
@@ -335,7 +334,7 @@ GLAPI = '#src/mapi/glapi/'
 
 if env['gles']:
 
-    env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
+    enabled_apis += ['ES1', 'ES2']
 
     # generate GLES sources
     gles_sources = ['main/es1_conversion.c',]
@@ -368,6 +367,8 @@ if env['gles']:
 
     mesa_sources += gles_sources
 
+env.Append(CPPDEFINES = ["FEATURE_%s=1" % api for api in enabled_apis])
+
 #
 # Assembly sources
 #




More information about the mesa-commit mailing list