Permalink
Browse files

Really unbundle libcrypto and libssl.

1. If built with the NDK, they should link against the NDK libdl and libz.
2. Upgrade to NDK version 5, because NDKr4 lacks some functions in
libdl.

Change-Id: I080d102d224496c63060c58a08b1dfd1de05978c
  • Loading branch information...
1 parent 841b213 commit 9e0e631be35ff165f6c4aba8fcbeb5df7e448d09 @wangying1015 wangying1015 committed Jul 21, 2011
Showing with 40 additions and 36 deletions.
  1. +4 −0 CleanSpec.mk
  2. +10 −10 crypto/Android.mk
  3. +10 −10 patches/crypto_Android.mk
  4. +8 −8 patches/ssl_Android.mk
  5. +8 −8 ssl/Android.mk
View
@@ -50,6 +50,10 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libcrypto_inte
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libcrypto_intermediates $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/openssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/ssltest_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libcrypto_intermediates $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/openssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/ssltest_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libcrypto_intermediates $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/openssl_intermediates $(PRODUCT_OUT)/obj/EXECUTABLES/ssltest_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libssl_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libcrypto_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libssl_static_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libcrypto_static_intermediates)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
View
@@ -484,49 +484,49 @@ local_c_flags := -DNO_WINDOWS_BRAINDEATH
#######################################
# target static library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
-LOCAL_SHARED_LIBRARIES += libz
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += $(arm_src_files)
LOCAL_CFLAGS += $(arm_cflags)
else
LOCAL_SRC_FILES += $(non_arm_src_files)
endif
-LOCAL_SHARED_LIBRARIES += libdl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto_static
include $(BUILD_STATIC_LIBRARY)
#######################################
# target shared library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
+# Use the NDK prebuilt libz and libdl.
+LOCAL_LDFLAGS += -lz -ldl
+else
+LOCAL_SHARED_LIBRARIES += libz libdl
endif
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
-LOCAL_SHARED_LIBRARIES += libz
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += $(arm_src_files)
LOCAL_CFLAGS += $(arm_cflags)
else
LOCAL_SRC_FILES += $(non_arm_src_files)
endif
-LOCAL_SHARED_LIBRARIES += libdl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto
include $(BUILD_SHARED_LIBRARY)
@@ -484,49 +484,49 @@ local_c_flags := -DNO_WINDOWS_BRAINDEATH
#######################################
# target static library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
-LOCAL_SHARED_LIBRARIES += libz
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += $(arm_src_files)
LOCAL_CFLAGS += $(arm_cflags)
else
LOCAL_SRC_FILES += $(non_arm_src_files)
endif
-LOCAL_SHARED_LIBRARIES += libdl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto_static
include $(BUILD_STATIC_LIBRARY)
#######################################
# target shared library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
+# Use the NDK prebuilt libz and libdl.
+LOCAL_LDFLAGS += -lz -ldl
+else
+LOCAL_SHARED_LIBRARIES += libz libdl
endif
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_CFLAGS += $(local_c_flags)
LOCAL_C_INCLUDES += $(local_c_includes)
-LOCAL_SHARED_LIBRARIES += libz
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += $(arm_src_files)
LOCAL_CFLAGS += $(arm_cflags)
else
LOCAL_SRC_FILES += $(non_arm_src_files)
endif
-LOCAL_SHARED_LIBRARIES += libdl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libcrypto
include $(BUILD_SHARED_LIBRARY)
@@ -47,12 +47,12 @@ local_src_files:= \
#######################################
# target static library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
+
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_MODULE_TAGS := optional
@@ -62,12 +62,12 @@ include $(BUILD_STATIC_LIBRARY)
#######################################
# target shared library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
+
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SHARED_LIBRARIES += libcrypto
View
@@ -47,12 +47,12 @@ local_src_files:= \
#######################################
# target static library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
+
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_MODULE_TAGS := optional
@@ -62,12 +62,12 @@ include $(BUILD_STATIC_LIBRARY)
#######################################
# target shared library
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/../android-config.mk
+
ifneq ($(TARGET_ARCH),x86)
-LOCAL_NDK_VERSION := 4
-LOCAL_SDK_VERSION := 8
+LOCAL_NDK_VERSION := 5
+LOCAL_SDK_VERSION := 9
endif
-
-include $(LOCAL_PATH)/../android-config.mk
LOCAL_SRC_FILES += $(local_src_files)
LOCAL_C_INCLUDES += $(local_c_includes)
LOCAL_SHARED_LIBRARIES += libcrypto

0 comments on commit 9e0e631

Please sign in to comment.