Skip to content

Commit bfec977

Browse files
committed
fix(android/Makefile): missing openssl library
1 parent 5d354c7 commit bfec977

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ else ifeq ($(PLATFORM),android)
9595
ANDROID_ABI := android26
9696
endif
9797
CC = $(BIN)/$(ARCH)-linux-$(ANDROID_ABI)-clang
98+
OPENSSL := $(BIN)/../sysroot/usr/include/openssl
9899
TARGET := $(DIST_DIR)/mcp.so
99100
LDFLAGS += -shared
100101
STRIP = $(BIN)/llvm-strip --strip-unneeded $@
@@ -136,8 +137,22 @@ endif
136137
$(shell mkdir -p $(BUILD_DIR) $(DIST_DIR))
137138
all: extension
138139

140+
$(OPENSSL):
141+
git clone https://github.com/openssl/openssl.git $(BUILD_DIR)/openssl
142+
143+
cd $(BUILD_DIR)/openssl && \
144+
./Configure android-$(if $(filter aarch64,$(ARCH)),arm64,$(if $(filter armv7a,$(ARCH)),arm,$(ARCH))) \
145+
--prefix=$(BIN)/../sysroot/usr \
146+
no-shared no-unit-test \
147+
-D__ANDROID_API__=26 && \
148+
$(MAKE) && $(MAKE) install_sw
149+
139150
# Build the Rust FFI static library
151+
ifeq ($(PLATFORM),android)
152+
staticlib: $(OPENSSL)
153+
else
140154
staticlib:
155+
endif
141156
ifeq ($(PLATFORM),macos)
142157
ifndef ARCH
143158
@echo "Checking Rust targets for macOS universal build..."

0 commit comments

Comments
 (0)