8a2602e42e5d8c504f2368e1263216b23fccbcbf
[packages.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 CONFIGURE_ARGS += \
46         --enable-shared \
47         --enable-static \
48         --with-dso \
49         --with-editline \
50         --with-file \
51         --without-perl
52
53 define Build/Configure
54         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
55                 ./configure \
56                         --prefix=/usr \
57                         --exec-prefix=/usr \
58                         --bindir=/usr/bin \
59                         --datadir=/usr/share \
60                         --includedir=/usr/include \
61                         --infodir=/usr/share/info \
62                         --libdir=/usr/lib \
63                         --libexecdir=/usr/lib \
64                         --localstatedir=/var \
65                         --mandir=/usr/share/man \
66                         --sbindir=/usr/sbin \
67                         --sysconfdir=/etc \
68                         $(DISABLE_NLS) \
69                         $(DISABLE_LARGEFILE) \
70                         --disable-shared \
71                         --enable-static \
72         );
73         $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
74         $(call Build/Configure/Default)
75 endef
76
77 define Build/Compile
78         $(MAKE) -C $(PKG_BUILD_DIR) \
79                 DESTDIR="$(PKG_INSTALL_DIR)" \
80                 all install
81 endef
82
83 define Build/InstallDev
84         $(INSTALL_DIR) $(1)/usr/bin
85         $(CP) $(PKG_INSTALL_DIR)/usr/bin/js-config $(1)/usr/bin/
86         $(INSTALL_DIR) $(1)/usr/include
87         $(CP) $(PKG_INSTALL_DIR)/usr/include/js $(1)/usr/include/       
88         $(INSTALL_DIR) $(1)/usr/lib
89         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.{a,so*} $(1)/usr/lib/
90         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
91         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc $(1)/usr/lib/pkgconfig/
92 endef
93
94 define Package/js/install
95         $(INSTALL_DIR) $(1)/usr/bin
96         $(CP) $(PKG_INSTALL_DIR)/usr/bin/js $(1)/usr/bin/
97 endef
98
99 define Package/libjs/install
100         $(INSTALL_DIR) $(1)/usr/lib
101         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* $(1)/usr/lib/
102 endef
103
104 $(eval $(call BuildPackage,js))
105 $(eval $(call BuildPackage,libjs))