Merge pull request #3997 from masatake/pascal--line-comment #1178
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cross compile with android-ndk on mac | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
cross-compile: | |
strategy: | |
fail-fast: false | |
matrix: | |
build-machine-os: [macos-14, macos-13, macos-12, macos-11] | |
runs-on: ${{ matrix.build-machine-os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: brew install gcc make automake autoconf file | |
- run: ./autogen.sh | |
- name: Run ./configure ... | |
run: | | |
TOOLCHAIN_BASE_DIR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64 | |
TOOLCHAIN_BIN_DIR=$TOOLCHAIN_BASE_DIR/bin | |
SYSROOT=$TOOLCHAIN_BASE_DIR/sysroot | |
export CC=$TOOLCHAIN_BIN_DIR/armv7a-linux-androideabi24-clang | |
export AR=$TOOLCHAIN_BIN_DIR/llvm-ar | |
export RANLIB=$TOOLCHAIN_BIN_DIR/llvm-ranlib | |
export CFLAGS="--sysroot $SYSROOT -Qunused-arguments -Os -fpic" | |
export CPPFLAGS="--sysroot $SYSROOT -Qunused-arguments" | |
export LDFLAGS="--sysroot $SYSROOT" | |
TARGET=armv7a-linux-androideabi | |
COLOR_PURPLE='\033[0;35m' # Purple | |
COLOR_GREEN='\033[0;32m' # Green | |
COLOR_OFF='\033[0m' # Reset | |
echo() { | |
printf "%b\n" "$*" | |
} | |
run() { | |
echo "$COLOR_PURPLE==>$COLOR_OFF $COLOR_GREEN$@$COLOR_OFF" | |
eval "$*" | |
} | |
run ./configure \ | |
--host=$TARGET \ | |
--disable-iconv \ | |
--disable-xml \ | |
--disable-json \ | |
--disable-yaml \ | |
--disable-pcre2 \ | |
CC="$CC" \ | |
CFLAGS="\"$CFLAGS\"" \ | |
CPPFLAGS="\"$CPPFLAGS\"" \ | |
LDFLAGS="\"$LDFLAGS\"" \ | |
AR=$AR \ | |
RANLIB=$RANLIB | |
- run: make V=1 | |
- run: file ctags | grep 'ELF 32-bit LSB pie executable, ARM, EABI5' |