Skip to content

Commit 0005a96

Browse files
committed
build: install both addon and plugin during npm install
1 parent a283c85 commit 0005a96

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

Makefile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@ _travis:
2525
TEST_LLDB_BINARY=`which lldb-3.6` npm test
2626

2727
clean:
28-
rm -rf out
29-
rm -rf build
30-
rm -rf options.gypi
31-
rm -rf lldb
32-
rm -rf addon.node llnode.so
28+
$(RM) -r out
29+
$(RM) -r build
30+
$(RM) options.gypi
31+
$(RM) lldb
32+
$(RM) llnode.so llnode.dylib
3333

34-
addon:
34+
configure: scripts/configure.js
3535
node scripts/configure.js
36+
37+
addon: configure
3638
node-gyp rebuild
3739

38-
plugin:
39-
node ./scripts/configure.js
40+
plugin: configure
4041
./gyp_llnode
4142
$(MAKE) -C out/
4243

43-
.PHONY: all addon clean plugin format
44+
# configure is run during preinstall
45+
npm-build:
46+
./gyp_llnode
47+
$(MAKE) -C out/
48+
node-gyp rebuild
49+
50+
.PHONY: all addon clean plugin format npm-build

binding.gyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"xcode_settings": {
3737
"OTHER_LDFLAGS": [
3838
"-F<(mac_shared_frameworks)",
39-
"-Wl,-rpath,<(mac_shared_frameworks)",
40-
"-framework LLDB",
39+
"-Wl,-rpath,<(mac_shared_frameworks)",
40+
"-framework LLDB",
4141
],
4242
},
4343
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"//": "(Blame C++)",
1313
"scripts": {
1414
"preinstall": "node scripts/configure.js",
15-
"install": "./gyp_llnode && ( gmake -C out/ || make -C out/ )",
15+
"install": "( gmake npm-build || make npm-build )",
1616
"postinstall": "node scripts/cleanup.js",
1717
"test": "tape test/*-test.js"
1818
},

scripts/configure.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ function getLinuxLib(version) {
342342
const libDir = child_process.execFileSync('llvm-config-' + version,
343343
['--libdir']).toString().trim();
344344
const soPath = path.join(libDir, `liblldb-${version}.so`);
345-
const stat = fs.lstatSync(soPath);
346-
if (stat.isFile() || stat.isSymbolicLink()) {
345+
const stat = fs.statSync(soPath);
346+
if (stat.isFile()) {
347347
return {
348348
buildDir: path.dirname(libDir),
349349
lib: `lldb-${version}`
@@ -353,7 +353,7 @@ function getLinuxLib(version) {
353353
console.log(err);
354354
// Return undefined, we will download the headers.
355355
}
356-
// On Redhat lib are just installed in /usr/lib
356+
// On Redhat libs are just installed in /usr/lib
357357
if (fs.existsSync('/usr/lib/lldblldb.so')) {
358358
return {
359359
buildDir: '/usr',

0 commit comments

Comments
 (0)