Skip to content

Commit f4b6f2e

Browse files
committed
unibreak support android
1 parent f158652 commit f4b6f2e

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

.github/workflows/unibreak.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ on:
55
pull_request:
66
branches: [master]
77

8-
name: Create unibreak Release
8+
name: Unibreak
99

1010
jobs:
1111
build:
12-
name: compile unibreak then deploy
12+
name: compile apple and android unibreak then deploy
1313
runs-on: macos-14
1414
env:
1515
GH_TOKEN: ${{ github.token }}
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
19+
- uses: nttld/setup-ndk@v1
20+
id: setup-ndk
21+
with:
22+
ndk-version: r21e
23+
add-to-path: false
24+
local-cache: true
1925
- name: One Step
2026
run: .github/workflows/onestep.sh unibreak all

do-compile/android/unibreak.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<[email protected]>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -e
19+
20+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
21+
cd "$THIS_DIR"
22+
23+
echo "=== [$0] check env begin==="
24+
env_assert "MR_ARCH"
25+
env_assert "MR_BUILD_NAME"
26+
env_assert "MR_CC"
27+
env_assert "MR_BUILD_SOURCE"
28+
env_assert "MR_BUILD_PREFIX"
29+
env_assert "MR_SYS_ROOT"
30+
env_assert "MR_HOST_NPROC"
31+
echo "MR_DEBUG:$MR_DEBUG"
32+
echo "===check env end==="
33+
34+
CFG_FLAGS="--prefix=$MR_BUILD_PREFIX --enable-static --disable-shared --silent"
35+
CFLAGS="$MR_OTHER_CFLAGS"
36+
37+
# for cross compile
38+
if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]];then
39+
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH."
40+
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
41+
CFLAGS="$CFLAGS -isysroot $MR_SYS_ROOT"
42+
CFG_FLAGS="$CFG_FLAGS --host=$MR_ARCH-apple-darwin --with-sysroot=$MR_SYS_ROOT"
43+
fi
44+
45+
cd $MR_BUILD_SOURCE
46+
47+
echo
48+
echo "CC: $MR_CC"
49+
echo "CFG_FLAGS: $CFG_FLAGS"
50+
echo "CFLAGS: $CFLAGS"
51+
echo
52+
53+
echo "----------------------"
54+
echo "[*] configurate $LIB_NAME"
55+
echo "----------------------"
56+
57+
echo "generate configure"
58+
59+
./autogen.sh 1>/dev/null
60+
61+
./configure $CFG_FLAGS \
62+
CC="$MR_TRIPLE_CC" \
63+
CFLAGS="$CFLAGS" \
64+
LDFLAGS="$CFLAGS" 1>/dev/null
65+
66+
#----------------------
67+
echo "----------------------"
68+
echo "[*] compile $LIB_NAME"
69+
echo "----------------------"
70+
71+
make -j$MR_HOST_NPROC install 1>/dev/null

0 commit comments

Comments
 (0)