android: pass -std=c99 by default
authorChia-I Wu <olv@lunarg.com>
Sat, 26 Nov 2011 03:20:05 +0000 (11:20 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 26 Nov 2011 03:42:08 +0000 (11:42 +0800)
Several modules expect a C99 compiler already.  It is also the default for
Makefile build.

Android.common.mk
src/gallium/drivers/i915/Android.mk
src/gallium/drivers/nvfx/Android.mk
src/gallium/drivers/r300/Android.mk
src/gallium/drivers/r600/Android.mk
src/mesa/Android.mk
src/mesa/drivers/dri/i915/Android.mk
src/mesa/drivers/dri/i965/Android.mk

index f28ddc2..e8b9006 100644 (file)
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# use c99 compiler by default
+ifeq ($(LOCAL_CC),)
+ifeq ($(LOCAL_IS_HOST_MODULE),true)
+LOCAL_CC := $(HOST_CC) -std=c99
+else
+LOCAL_CC := $(TARGET_CC) -std=c99
+endif
+endif
+
 LOCAL_C_INCLUDES += \
        $(MESA_TOP)/include
 
index 780ace5..fece305 100644 (file)
@@ -30,8 +30,6 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_CFLAGS := -std=c99
-
 LOCAL_MODULE := libmesa_pipe_i915
 
 include $(GALLIUM_COMMON_MK)
index 6dee111..219b044 100644 (file)
@@ -29,7 +29,6 @@ include $(LOCAL_PATH)/Makefile.sources
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
-LOCAL_CFLAGS := -std=c99
 LOCAL_C_INCLUDES := $(DRM_TOP)
 
 LOCAL_MODULE := libmesa_pipe_nvfx
index fe3c2bd..ff27ef6 100644 (file)
@@ -30,8 +30,6 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_CFLAGS := -std=c99
-
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/mapi \
        $(MESA_TOP)/src/glsl \
index f060920..e5188bb 100644 (file)
@@ -30,8 +30,6 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(C_SOURCES)
 
-LOCAL_CFLAGS := -std=c99
-
 LOCAL_C_INCLUDES :=
 
 LOCAL_MODULE := libmesa_pipe_r600
index f21ba3a..f6c0f4e 100644 (file)
@@ -56,6 +56,7 @@ LOCAL_SRC_FILES := x86/gen_matypes.c
 LOCAL_CFLAGS := $(common_CFLAGS)
 LOCAL_C_INCLUDES := $(common_C_INCLUDES)
 LOCAL_MODULE := mesa_gen_matypes
+LOCAL_IS_HOST_MODULE := true
 include $(MESA_COMMON_MK)
 include $(BUILD_HOST_EXECUTABLE)
 
@@ -145,6 +146,7 @@ LOCAL_SRC_FILES := \
        program/symbol_table.c
 
 LOCAL_MODULE := libmesa_glsl_utils
+LOCAL_IS_HOST_MODULE := true
 
 include $(MESA_COMMON_MK)
 include $(BUILD_HOST_STATIC_LIBRARY)
index 21b3450..b615e9b 100644 (file)
@@ -32,10 +32,6 @@ LOCAL_UNSTRIPPED_PATH := $(MESA_DRI_MODULE_UNSTRIPPED_PATH)
 # Import variables i915_*.
 include $(LOCAL_PATH)/Makefile.sources
 
-# Overriding LOCAL_CC below is an ugly workaround.  We cannot place -std=c99
-# in LOCAL_C_FLAGS because Android appends LOCAL_C_FLAGS to LOCAL_CPP_FLAGS.
-LOCAL_CC := $(TARGET_CC) -std=c99
-
 LOCAL_CFLAGS := \
        $(MESA_DRI_CFLAGS) \
        -DI915
index 3f49c8b..ec4a761 100644 (file)
@@ -32,10 +32,6 @@ LOCAL_UNSTRIPPED_PATH := $(MESA_DRI_MODULE_UNSTRIPPED_PATH)
 # Import variables i965_*.
 include $(LOCAL_PATH)/Makefile.sources
 
-# Overriding LOCAL_CC below is an ugly workaround.  We cannot place -std=c99
-# in LOCAL_C_FLAGS because Android appends LOCAL_C_FLAGS to LOCAL_CPP_FLAGS.
-LOCAL_CC := $(TARGET_CC) -std=c99
-
 LOCAL_CFLAGS := \
        $(MESA_DRI_CFLAGS)