-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
65 lines (52 loc) · 2.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=node
PKG_VERSION:=v0.10.18
PKG_RELEASE:=2
PKG_SOURCE:=node-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
PKG_MD5SUM:=8b905b6013b82fb7076b02a6c881f9a6
GYP_DEFINES:=v8_can_use_fpu_instructions=false
LIBS:=-I$(TOOLCHAIN_DIR)/i486-openwrt-linux-uclibc/include/c++/4.6.4/ -I$(TOOLCHAIN_DIR)/i486-openwrt-linux-uclibc/include/c++/4.6.4/i486-openwrt-linux-uclibc/
include $(INCLUDE_DIR)/package.mk
define Package/node
DEPENDS:=+libpthread +librt +libstdcpp +libc
SECTION:=lang
CATEGORY:=Languages
TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
URL:=http://nodejs.org/
endef
define Package/node/description
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(CP) node.patch $(PKG_BUILD_DIR)/
(cd $(PKG_BUILD_DIR); \
patch -p1 < node.patch; \
);
endef
define Build/Configure
(cd $(PKG_BUILD_DIR); \
export LIBS="$(LIBS)"; \
export CFLAGS="$(TARGET_CFLAGS) $(LIBS)"; \
export CXXFLAGS="$(TARGET_CXXFLAGS) $(LIBS)"; \
export GYPFLAGS="$(GYPFLAGS)"; \
./configure --dest-cpu=ia32 --dest-os=linux --without-ssl --without-snapshot --with-arm-float-abi=soft; \
);
endef
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) GYP_DEFINES="$(GYP_DEFINES)" CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" CFLAGS="$(TARGET_CFLAGS) $(LIBS)" CXXFLAGS="$(TARGET_CXXFLAGS) $(LIBS) -nostdinc++" LDFLAGS="$(TARGET_LDFLAGS) -nodefaultlibs -lc -lgcc -lstdc++ -lgcc_s -lpthread" || touch $(PKG_BUILD_DIR)/deps/v8/build/common.gypi
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) GYP_DEFINES="$(GYP_DEFINES)" CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" CFLAGS="$(TARGET_CFLAGS) $(LIBS)" CXXFLAGS="$(TARGET_CXXFLAGS) $(LIBS) -nostdinc++" LDFLAGS="$(TARGET_LDFLAGS) -nodefaultlibs -lc -lgcc -lstdc++ -lgcc_s -lpthread"
endef
define Package/node/install
mkdir -p $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/out/Release/node $(1)/usr/bin/
ln -s /usr/bin/node $(1)/usr/bin/nodejs
endef
$(eval $(call BuildPackage,node))