Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node-arch sniffing for node 0.6 and to use the correct node. #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion libusdt-build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -o errexit

# GYP's MAKEFLAGS confuses libusdt's Makefile
#
unset MAKEFLAGS
Expand All @@ -10,7 +12,15 @@ unset MAKEFLAGS
# node extensions universal on the Mac - for now we'll go with x86_64
# on a 64 bit Mac)
#
ARCH=`node -e "console.log(process.config.variables.target_arch == 'x64' ? 'x86_64' : 'i386')"`
# libusdt/Makefile wants ARCH to be either 'x86_64' or 'i386'.
NODE_ARCH=$(file $npm_config_prefix/bin/node | awk '{print $3}')
if [[ "$NODE_ARCH" == "32-bit" ]]; then
ARCH=i386
elif [[ "$NODE_ARCH" == "64-bit" ]]; then
ARCH=x86_64
else
echo "ERROR: unknown arch for $npm_config_prefix/bin/node: '$NODE_ARCH'"
fi
echo "Building libusdt for ${ARCH}"
export ARCH

Expand Down