Merge pull request #201 from alexey-pelykh/jniBuild

Allow third-party libraries to be prebuilt
This commit is contained in:
vshcherb 2012-03-23 04:35:47 -07:00
commit 7fa8598f2b
39 changed files with 102 additions and 41 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
OsmAnd/jni-prebuilt/x86/libgif.a Executable file

Binary file not shown.

BIN
OsmAnd/jni-prebuilt/x86/libjpeg.a Executable file

Binary file not shown.

BIN
OsmAnd/jni-prebuilt/x86/libpng.a Executable file

Binary file not shown.

Binary file not shown.

BIN
OsmAnd/jni-prebuilt/x86/libskia.a Executable file

Binary file not shown.

View file

@ -8,12 +8,17 @@ include $(CLEAR_VARS)
# Name of the local module # Name of the local module
LOCAL_MODULE := cpufeatures_proxy LOCAL_MODULE := cpufeatures_proxy
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
cpuCheck.cpp cpuCheck.cpp
LOCAL_STATIC_LIBRARIES := cpufeatures LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(PREBUILT_SHARED_LIBRARY)
endif
$(call import-module,android/cpufeatures) $(call import-module,android/cpufeatures)

View file

@ -3,9 +3,9 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := libexpat_static LOCAL_MODULE := expat_static
else else
LOCAL_MODULE := libexpat_static_neon LOCAL_MODULE := expat_static_neon
LOCAL_ARM_NEON := true LOCAL_ARM_NEON := true
endif endif
@ -16,6 +16,8 @@ ifeq ($(OSMAND_EXPAT_ABS),)
OSMAND_EXPAT_ABS := $(LOCAL_PATH)/expat_library OSMAND_EXPAT_ABS := $(LOCAL_PATH)/expat_library
endif endif
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(OSMAND_EXPAT_LOC)/lib/xmlparse.c \ $(OSMAND_EXPAT_LOC)/lib/xmlparse.c \
$(OSMAND_EXPAT_LOC)/lib/xmlrole.c \ $(OSMAND_EXPAT_LOC)/lib/xmlrole.c \
@ -28,3 +30,9 @@ LOCAL_C_INCLUDES += \
$(OSMAND_EXPAT_ABS)/lib $(OSMAND_EXPAT_ABS)/lib
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -13,6 +13,15 @@ ifeq ($(OSMAND_FREETYPE_ABS),)
OSMAND_FREETYPE_ABS := $(LOCAL_PATH)/freetype_library OSMAND_FREETYPE_ABS := $(LOCAL_PATH)/freetype_library
endif endif
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := ft2_static
else
LOCAL_MODULE := ft2_static_neon
LOCAL_ARM_NEON := true
endif
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES:= \ LOCAL_SRC_FILES:= \
$(OSMAND_FREETYPE_LOC)/src/base/ftbbox.c \ $(OSMAND_FREETYPE_LOC)/src/base/ftbbox.c \
$(OSMAND_FREETYPE_LOC)/src/base/ftbitmap.c \ $(OSMAND_FREETYPE_LOC)/src/base/ftbitmap.c \
@ -50,11 +59,10 @@ LOCAL_CFLAGS += "-DFT2_BUILD_LIBRARY"
LOCAL_CFLAGS += -O2 LOCAL_CFLAGS += -O2
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := libft2_static
else
LOCAL_MODULE := libft2_static_neon
LOCAL_ARM_NEON := true
endif
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -8,6 +8,14 @@ ifeq ($(OSMAND_GIF_ABS),)
OSMAND_GIF_ABS := $(LOCAL_PATH)/gif_library OSMAND_GIF_ABS := $(LOCAL_PATH)/gif_library
endif endif
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := gif
else
LOCAL_MODULE := gif_neon
endif
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(OSMAND_GIF_LOC)/dgif_lib.c \ $(OSMAND_GIF_LOC)/dgif_lib.c \
$(OSMAND_GIF_LOC)/gifalloc.c \ $(OSMAND_GIF_LOC)/gifalloc.c \
@ -18,10 +26,10 @@ LOCAL_C_INCLUDES += \
LOCAL_CFLAGS += -Wno-format -DHAVE_CONFIG_H LOCAL_CFLAGS += -Wno-format -DHAVE_CONFIG_H
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := libgif
else
LOCAL_MODULE := libgif_neon
endif
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -10,6 +10,14 @@ ifeq ($(OSMAND_JPEG_ABS),)
OSMAND_JPEG_ABS := $(LOCAL_PATH)/jpeg_library OSMAND_JPEG_ABS := $(LOCAL_PATH)/jpeg_library
endif endif
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := jpeg
else
LOCAL_MODULE := jpeg_neon
endif
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(OSMAND_JPEG_LOC)/jcapimin.c \ $(OSMAND_JPEG_LOC)/jcapimin.c \
$(OSMAND_JPEG_LOC)/jcapistd.c \ $(OSMAND_JPEG_LOC)/jcapistd.c \
@ -74,10 +82,10 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT
endif endif
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true) include $(BUILD_STATIC_LIBRARY)
LOCAL_MODULE := libjpeg
else
LOCAL_MODULE := libjpeg_neon
endif
include $(BUILD_STATIC_LIBRARY) else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -8,6 +8,17 @@ ifeq ($(OSMAND_PNG_ABS),)
OSMAND_PNG_ABS := $(LOCAL_PATH)/png_library OSMAND_PNG_ABS := $(LOCAL_PATH)/png_library
endif endif
LOCAL_SHARED_LIBRARIES := \
libz
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := png
else
LOCAL_MODULE := png_neon
endif
ifneq ($(OSMAND_USE_PREBUILT),true)
common_SRC_FILES := \ common_SRC_FILES := \
$(OSMAND_PNG_LOC)/png.c \ $(OSMAND_PNG_LOC)/png.c \
$(OSMAND_PNG_LOC)/pngerror.c \ $(OSMAND_PNG_LOC)/pngerror.c \
@ -47,15 +58,11 @@ LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_CFLAGS += $(common_CFLAGS) LOCAL_CFLAGS += $(common_CFLAGS)
LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ LOCAL_C_INCLUDES += $(common_C_INCLUDES) \
external/zlib external/zlib
LOCAL_SHARED_LIBRARIES := \
libz
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := libpng
else
LOCAL_MODULE := libpng_neon
endif
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -1,5 +1,16 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := proto
else
LOCAL_MODULE := proto_neon
LOCAL_ARM_NEON := true
endif
ifneq ($(OSMAND_USE_PREBUILT),true)
CC_LITE_SRC_FILES := \ CC_LITE_SRC_FILES := \
google/protobuf/stubs/common.cc \ google/protobuf/stubs/common.cc \
google/protobuf/stubs/once.cc \ google/protobuf/stubs/once.cc \
@ -13,14 +24,6 @@ CC_LITE_SRC_FILES := \
google/protobuf/io/zero_copy_stream.cc \ google/protobuf/io/zero_copy_stream.cc \
google/protobuf/io/zero_copy_stream_impl_lite.cc google/protobuf/io/zero_copy_stream_impl_lite.cc
include $(CLEAR_VARS)
ifneq ($(OSMAND_BUILDING_NEON_LIBRARY),true)
LOCAL_MODULE := proto
else
LOCAL_MODULE := proto_neon
LOCAL_ARM_NEON := true
endif
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc LOCAL_CPP_EXTENSION := .cc
@ -33,4 +36,10 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
LOCAL_LDLIBS := -llog LOCAL_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif

View file

@ -34,6 +34,8 @@ ifeq ($(OSMAND_JPEG_ABS),)
OSMAND_JPEG_ABS := $(LOCAL_PATH)/../jpeg/jpeg_library OSMAND_JPEG_ABS := $(LOCAL_PATH)/../jpeg/jpeg_library
endif endif
ifneq ($(OSMAND_USE_PREBUILT),true)
LOCAL_ARM_MODE := arm LOCAL_ARM_MODE := arm
# need a flag to tell the C side when we're on devices with large memory # need a flag to tell the C side when we're on devices with large memory
@ -321,6 +323,12 @@ LOCAL_LDLIBS += -lz -llog
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
else
LOCAL_SRC_FILES := \
../../jni-prebuilt/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a
include $(PREBUILT_STATIC_LIBRARY)
endif
# Fix some errors # Fix some errors
BUILD_HOST_EXECUTABLE := $(LOCAL_PATH)/FakeHost.mk BUILD_HOST_EXECUTABLE := $(LOCAL_PATH)/FakeHost.mk
BUILD_HOST_STATIC_LIBRARY := $(LOCAL_PATH)/FakeHost.mk BUILD_HOST_STATIC_LIBRARY := $(LOCAL_PATH)/FakeHost.mk