You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# In order to cross-compile node for Android using NDK, run:
4
-
# source android-configure <path_to_ndk> [arch]
5
-
#
6
-
# By running android-configure with source, will allow environment variables to
7
-
# be persistent in current session. This is useful for installing native node
8
-
# modules with npm. Also, don't forget to set the arch in npm config using
9
-
# 'npm config set arch=<arch>'
10
-
11
-
if [ $#-ne 3 ];then
12
-
echo"android-configure: should have 3 parameters: ndk_path, target_arch and sdk_version"
13
-
return 1
14
-
fi
15
-
16
-
NDK_PATH=$1
17
-
ARCH="$2"
18
-
ANDROID_SDK_VERSION=$3
19
-
20
-
if [ $ANDROID_SDK_VERSION-lt 24 ];then
21
-
echo"$ANDROID_SDK_VERSION should equal or later than 24 (Android 7.0)"
22
-
fi
23
-
24
-
case$ARCHin
25
-
arm)
26
-
DEST_CPU="arm"
27
-
TOOLCHAIN_NAME="armv7a-linux-androideabi"
28
-
;;
29
-
x86)
30
-
DEST_CPU="ia32"
31
-
TOOLCHAIN_NAME="i686-linux-android"
32
-
;;
33
-
x86_64)
34
-
DEST_CPU="x64"
35
-
TOOLCHAIN_NAME="x86_64-linux-android"
36
-
ARCH="x64"
37
-
;;
38
-
arm64|aarch64)
39
-
DEST_CPU="arm64"
40
-
TOOLCHAIN_NAME="aarch64-linux-android"
41
-
ARCH="arm64"
42
-
;;
43
-
*)
44
-
echo"Unsupported architecture provided: $ARCH"
45
-
return 1
46
-
;;
47
-
esac
48
-
49
-
echo"###########################"
50
-
echo"- Patch List"
51
-
echo"[1] [deps/v8/src/trap-handler/trap-handler.h] related to https://github.com/nodejs/node/issues/36287"
52
-
echo"###########################"
53
-
54
-
read -r -p "For building node for the Android platform, the above patch will be applied automatically to fix some of the potential issues during compilation, would you like to do that? [Y/n] " INPUTS
0 commit comments