95113524677bbec8b76ccf37870e3a5e47785c16
[openwrt/svn-archive/archive.git] / libs / ossp-js / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=js
12 PKG_VERSION:=1.6.20070208
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.ossp.org/pkg/lib/js/
17 PKG_MD5SUM:=07f6cad7e03fd74a949588c3d4b333de
18
19 PKG_BUILD_DEPENDS:= libreadline
20 PKG_FIXUP = libtool
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/js/Default
25 TITLE:=Mozilla JavaScript Engine
26 URL:=http://www.ossp.org/pkg/lib/js/
27 endef
28
29 define Package/js
30 $(call Package/js/Default)
31 SECTION:=lang
32 CATEGORY:=Languages
33 SUBMENU:=JavaScript
34 TITLE+= (interpreter)
35 DEPENDS+= +libjs +libreadline +libncurses
36 endef
37
38 define Package/libjs
39 $(call Package/js/Default)
40 SECTION:=libs
41 CATEGORY:=Libraries
42 TITLE+= (library)
43 endef
44
45 TARGET_CFLAGS += $(FPIC)
46
47 CONFIGURE_ARGS += \
48 --enable-shared \
49 --enable-static \
50 --with-dso \
51 --with-editline \
52 --with-file \
53 --without-perl
54
55 define Build/Configure
56 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
57 ./configure \
58 --prefix=/usr \
59 --exec-prefix=/usr \
60 --bindir=/usr/bin \
61 --datadir=/usr/share \
62 --includedir=/usr/include \
63 --infodir=/usr/share/info \
64 --libdir=/usr/lib \
65 --libexecdir=/usr/lib \
66 --localstatedir=/var \
67 --mandir=/usr/share/man \
68 --sbindir=/usr/sbin \
69 --sysconfdir=/etc \
70 $(DISABLE_NLS) \
71 $(DISABLE_LARGEFILE) \
72 --disable-shared \
73 --enable-static \
74 );
75 $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
76 $(call Build/Configure/Default)
77 endef
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 DESTDIR="$(PKG_INSTALL_DIR)" \
82 all install
83 endef
84
85 define Build/InstallDev
86 $(INSTALL_DIR) $(1)/usr/bin
87 $(CP) $(PKG_INSTALL_DIR)/usr/bin/js-config $(1)/usr/bin/
88 $(INSTALL_DIR) $(1)/usr/include
89 $(CP) $(PKG_INSTALL_DIR)/usr/include/js $(1)/usr/include/
90 $(INSTALL_DIR) $(1)/usr/lib
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.{a,so*} $(1)/usr/lib/
92 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc $(1)/usr/lib/pkgconfig/
94 endef
95
96 define Package/js/install
97 $(INSTALL_DIR) $(1)/usr/bin
98 $(CP) $(PKG_INSTALL_DIR)/usr/bin/js $(1)/usr/bin/
99 endef
100
101 define Package/libjs/install
102 $(INSTALL_DIR) $(1)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* $(1)/usr/lib/
104 endef
105
106 $(eval $(call BuildPackage,js))
107 $(eval $(call BuildPackage,libjs))