Skip to content

Commit fdcd10e

Browse files
committed
fix(android/Makefile): downgrade openssl version to a compatible one
1 parent ab2911c commit fdcd10e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ else ifeq ($(PLATFORM),android)
102102
OPENSSL := $(BIN)/../sysroot/usr/include/openssl
103103
TARGET := $(DIST_DIR)/mcp.so
104104
LDFLAGS += -shared
105+
CFLAGS += -fPIC
105106
STRIP = $(BIN)/llvm-strip --strip-unneeded $@
106-
LIBS = -lmcp_ffi -lpthread -ldl -lm -lssl -lcrypto
107-
TEST_LIBS = -lpthread -ldl -lm
107+
LIBS = -lmcp_ffi -ldl -lm -lssl -lcrypto
108+
TEST_LIBS = -ldl -lm
108109
else ifeq ($(PLATFORM),ios)
109110
TARGET := $(DIST_DIR)/mcp.dylib
110111
SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0
@@ -142,8 +143,14 @@ $(shell mkdir -p $(BUILD_DIR) $(DIST_DIR))
142143
all: extension
143144

144145
OPENSSL_SRC = $(BUILD_DIR)/openssl
145-
$(OPENSSL_SRC):
146-
git clone https://github.com/openssl/openssl.git $(BUILD_DIR)/openssl
146+
OPENSSL_TARBALL = $(BUILD_DIR)/openssl-3.6.0.tar.gz
147+
$(OPENSSL_TARBALL):
148+
@mkdir -p $(BUILD_DIR)
149+
curl -L -o $(OPENSSL_TARBALL) https://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz
150+
151+
$(OPENSSL_SRC): $(OPENSSL_TARBALL)
152+
tar -xzf $(OPENSSL_TARBALL) -C $(BUILD_DIR)
153+
mv $(BUILD_DIR)/openssl-3.6.0 $(OPENSSL_SRC)
147154

148155
$(OPENSSL): $(OPENSSL_SRC)
149156
cd $(BUILD_DIR)/openssl && \
@@ -315,7 +322,7 @@ AAR_ARM64 = packages/android/src/main/jniLibs/arm64-v8a/
315322
AAR_ARM = packages/android/src/main/jniLibs/armeabi-v7a/
316323
AAR_X86 = packages/android/src/main/jniLibs/x86_64/
317324
AAR_USR = $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(HOST)-x86_64/sysroot/usr/
318-
AAR_CLEAN = rm -rf $(CURL_DIR)/android $(AAR_USR)bin/openssl $(AAR_USR)include/openssl $(AAR_USR)lib/libssl.a $(AAR_USR)lib/libcrypto.a $(AAR_USR)lib/ossl-modules
325+
AAR_CLEAN = rm -rf $(AAR_USR)bin/openssl $(AAR_USR)include/openssl $(AAR_USR)lib/libssl.a $(AAR_USR)lib/libcrypto.a $(AAR_USR)lib/ossl-modules
319326
aar:
320327
mkdir -p $(AAR_ARM64) $(AAR_ARM) $(AAR_X86)
321328
$(AAR_CLEAN)

0 commit comments

Comments
 (0)