diff --git a/libc/Android.mk b/libc/Android.mk index 78a8c7381..e371cad21 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -610,6 +610,14 @@ libc_crt_target_cflags += \ -I$(LOCAL_PATH)/include \ -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) +# Define some common conlyflags +libc_common_conlyflags := \ + -std=gnu99 + +# Define some common cppflags +libc_common_cppflags := \ + -std=gnu++11 + # Define some common includes # ======================================================== libc_common_c_includes := \ @@ -757,6 +765,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libbionic_ssp LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -774,11 +784,12 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_tzcode_src_files) LOCAL_CFLAGS := \ $(libc_common_cflags) \ - -std=gnu99 \ -DSTD_INSPIRED=1 \ -DTZDIR=\"/system/usr/share/zoneinfo\" \ -DTM_GMTOFF=tm_gmtoff \ -DUSG_COMPAT=1 +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_tzcode LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -802,6 +813,8 @@ LOCAL_CFLAGS := \ -I$(LOCAL_PATH)/upstream-freebsd \ -I$(LOCAL_PATH)/upstream-freebsd/libc/include \ -include upstream-freebsd/freebsd-compat.h +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_freebsd LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -825,6 +838,8 @@ LOCAL_CFLAGS := \ -I$(LOCAL_PATH)/upstream-netbsd \ -I$(LOCAL_PATH)/upstream-netbsd/libc/include \ -include upstream-netbsd/netbsd-compat.h +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_netbsd LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -841,6 +856,8 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_bionic_src_files) LOCAL_CFLAGS := $(libc_common_cflags) -Werror +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_bionic LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -857,8 +874,9 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_common_src_files) LOCAL_CFLAGS := $(libc_common_cflags) \ - -std=gnu99 \ -I$(LOCAL_PATH)/upstream-netbsd/libc/include # for netbsd private headers +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_common LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -895,8 +913,9 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_CFLAGS := $(libc_common_cflags) \ - -DLIBC_STATIC \ - -std=gnu99 + -DLIBC_STATIC +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_MODULE := libc_nomalloc LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -919,8 +938,9 @@ LOCAL_SRC_FILES := \ bionic/libc_init_static.cpp LOCAL_CFLAGS := $(libc_common_cflags) \ - -DLIBC_STATIC \ - -std=gnu99 + -DLIBC_STATIC +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -941,7 +961,9 @@ include $(CLEAR_VARS) # Since this code is experimental it is disabled by default. # see libc/bionic/pthread_debug.c for details -LOCAL_CFLAGS := $(libc_common_cflags) -std=gnu99 -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0 +LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0 +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_SRC_FILES := \ @@ -998,6 +1020,8 @@ include $(CLEAR_VARS) LOCAL_CFLAGS := \ $(libc_common_cflags) \ -DMALLOC_LEAK_CHECK +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) @@ -1029,6 +1053,8 @@ include $(CLEAR_VARS) LOCAL_CFLAGS := \ $(libc_common_cflags) \ -DMALLOC_QEMU_INSTRUMENT +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes)