Skip to content

Commit 47724ee

Browse files
committed
android build openssl in the makefile
1 parent ff0eb5b commit 47724ee

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,6 @@ jobs:
6161
mingw-w64-x86_64-cc
6262
mingw-w64-x86_64-autotools make
6363
64-
- name: build openssl
65-
if: matrix.name == 'android'
66-
run: |
67-
git clone https://github.com/openssl/openssl.git
68-
cd openssl
69-
export TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
70-
export ARCH=${{ matrix.arch }}
71-
export PATH=$TOOLCHAIN/bin:$PATH
72-
73-
./Configure android-${{ matrix.arch == 'arm64-v8a' && 'arm64' || matrix.arch }} \
74-
--prefix=$PWD/build \
75-
--openssldir=$PWD/build/ssl \
76-
no-shared \
77-
no-unit-test \
78-
-D__ANDROID_API__=26
79-
make
80-
make install_sw
81-
82-
cp build/lib/libssl.a $TOOLCHAIN/sysroot/usr/lib/
83-
cp build/lib/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/
84-
cp -r build/include/openssl $TOOLCHAIN/sysroot/usr/include/
85-
8664
- name: build sqlite-sync
8765
run: make ${{ matrix.make && matrix.make || ''}}
8866
shell: bash

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ else ifeq ($(PLATFORM),android)
8282
endif
8383

8484
BIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/$(HOST)-x86_64/bin
85+
PATH := $(BIN):$(PATH)
8586

8687
ifneq (,$(filter $(ARCH),arm64 arm64-v8a))
8788
override ARCH := aarch64
@@ -172,7 +173,21 @@ ifneq ($(COVERAGE),false)
172173
genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR)
173174
endif
174175

176+
openssl:
177+
git clone https://github.com/openssl/openssl.git $(CURL_DIR)/src/openssl
178+
179+
cd $(CURL_DIR)/src/openssl && \
180+
./Configure android-$(if $(filter aarch64,$(ARCH)),arm64,$(ARCH)) \
181+
--prefix=$(ANDROID_NDK)/toolchains/sysroot/usr \
182+
no-shared no-unit-test \
183+
-D__ANDROID_API__=26 && \
184+
make && make install_sw
185+
186+
ifeq ($(PLATFORM),android)
187+
$(CURL_LIB): openssl
188+
else
175189
$(CURL_LIB):
190+
endif
176191
mkdir -p $(CURL_DIR)/src
177192
curl -L -o $(CURL_DIR)/src/curl.zip "https://github.com/curl/curl/releases/download/curl-$(subst .,_,${CURL_VERSION})/curl-$(CURL_VERSION).zip"
178193
unzip $(CURL_DIR)/src/curl.zip -d $(CURL_DIR)/src/.

0 commit comments

Comments
 (0)