Fix log2f conflict.

This commit is contained in:
Tae Hanazono
2019-07-01 23:05:08 +08:00
parent 288f005d86
commit 07149c0ba8
3 changed files with 31 additions and 5 deletions
+1
View File
@@ -1 +1,2 @@
NDK_R17 := $(shell python $(call my-dir)/detect_ndkrel.py $(NDK_ROOT)/source.properties 17)
include $(call all-subdir-makefiles)
+20
View File
@@ -0,0 +1,20 @@
import sys
import re
def main(argv):
if len(argv) > 1:
# argv[0] = source.properties
# argv[1] = desired NDK version
f = open(argv[0], "r")
contents = f.read()
f.close()
matches = re.findall("Pkg.Revision = (\d+)", contents)
if len(matches) >= 1 and int(matches[0]) >= int(argv[1]):
print("yes")
else:
print("no")
else:
print("unknown")
if __name__ == "__main__":
main(sys.argv[1:])
+10 -5
View File
@@ -8,11 +8,6 @@ LOCAL_CFLAGS := -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -D_GNU_SOURCE=1 -D_P
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS}
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
# ARM64 have log2f function
LOCAL_CFLAGS += -DHAVE_LOG2F
endif
LOCAL_C_INCLUDES := \
${LOCAL_PATH}/include \
${LOCAL_PATH}/common \
@@ -42,4 +37,14 @@ LOCAL_SRC_FILES := \
LOCAL_LDLIBS := -lOpenSLES
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
# ARM64 have log2f function
LOCAL_CFLAGS += -DHAVE_LOG2F
else ifeq ($(NDK_R17),yes)
# NDK r17 and later always add log2f
LOCAL_CFLAGS += -DHAVE_LOG2F
# Also make sure to link with android_support
LOCAL_LDLIBS += -landroid_support
endif
include $(BUILD_SHARED_LIBRARY)