Skip to content

Commit

Permalink
build: add support for Android Termux build
Browse files Browse the repository at this point in the history
PR-URL: #243
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
jimgambale authored and mmarchini committed Jan 18, 2019
1 parent e30beba commit 59b65c4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@ build/
out/
npm-debug.log
node_modules/
package-lock.json

# Generated by scripts/configure.js
config.gypi
Expand Down
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -92,6 +92,18 @@ version is LLDB 3.9 and above.
Visual Studio is required for MSBuild and headers when building llnode. Git
is required to download the lldb headers.

- Android / Termux (Experimental)
- Install Termux (https://termux.com)

- Install Termux Packages
- pkg install clang lldb lldb-dev make
- pkg install nodejs-lts nodejs-lts-dev
- To debug:
```
llnode -- /data/data/com.termux/files/usr/bin/node --abort_on_uncaught_exception script.js
(llnode) run
```

### Install the Plugin

#### Install llnode globally via npm
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Expand Up @@ -117,7 +117,7 @@
}],
]
}],
[ "OS=='linux' or OS=='freebsd'", {
[ "OS=='linux' or OS=='freebsd' or OS=='android'", {
"conditions": [
# If we could not locate the lib dir, then we will have to search
# from the global search paths during linking and at runtime
Expand Down
9 changes: 9 additions & 0 deletions llnode.gypi
Expand Up @@ -79,6 +79,15 @@
}],
],
}],
[ "OS in 'android'", {
"target_conditions": [
["_type=='static_library'", {
"standalone_static_library": 1, # disable thin archive which needs binutils >= 2.19
}],
],
'libraries': ['-llldb'],
'cflags_cc': ['-std=c++11',' -Wall','-O3',' -fPIC']
}],
]
},
}
2 changes: 1 addition & 1 deletion scripts/configure.js
Expand Up @@ -52,7 +52,7 @@ function configureInstallation(osName, buildDir) {
if (installation.libDir) {
config.variables['lldb_lib_dir%'] = installation.libDir;
}
} else if (osName === 'Linux') {
} else if (osName === 'Linux' || osName === 'Android') {
installation = require('./linux').getLldbInstallation();
if (installation.libDir) {
config.variables['lldb_lib_dir%'] = installation.libDir;
Expand Down

0 comments on commit 59b65c4

Please sign in to comment.