[packages] add ossp-js (Mozilla JavaScript Engine)
[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 define Build/Configure
46 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
47 ./configure \
48 --prefix=/usr \
49 --exec-prefix=/usr \
50 --bindir=/usr/bin \
51 --datadir=/usr/share \
52 --includedir=/usr/include \
53 --infodir=/usr/share/info \
54 --libdir=/usr/lib \
55 --libexecdir=/usr/lib \
56 --localstatedir=/var \
57 --mandir=/usr/share/man \
58 --sbindir=/usr/sbin \
59 --sysconfdir=/etc \
60 $(DISABLE_NLS) \
61 $(DISABLE_LARGEFILE) \
62 --disable-shared \
63 --enable-static \
64 );
65 $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
66 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
67 $(TARGET_CONFIGURE_OPTS) \
68 CFLAGS="$(TARGET_CFLAGS)" \
69 CPPFLAGS="$(TARGET_CPPFLAGS)" \
70 LDFLAGS="$(TARGET_LDFLAGS)" \
71 ./configure \
72 --target=$(GNU_TARGET_NAME) \
73 --host=$(GNU_TARGET_NAME) \
74 --build=$(GNU_HOST_NAME) \
75 --program-prefix="" \
76 --program-suffix="" \
77 --prefix=/usr \
78 --exec-prefix=/usr \
79 --bindir=/usr/bin \
80 --datadir=/usr/share \
81 --includedir=/usr/include \
82 --infodir=/usr/share/info \
83 --libdir=/usr/lib \
84 --libexecdir=/usr/lib \
85 --localstatedir=/var \
86 --mandir=/usr/share/man \
87 --sbindir=/usr/sbin \
88 --sysconfdir=/etc \
89 $(DISABLE_NLS) \
90 $(DISABLE_LARGEFILE) \
91 --enable-shared \
92 --enable-static \
93 --with-dso \
94 --with-editline \
95 --with-file \
96 --without-perl \
97 );
98 endef
99
100 define Build/Compile
101 $(MAKE) -C $(PKG_BUILD_DIR) \
102 DESTDIR="$(PKG_INSTALL_DIR)" \
103 all install
104 endef
105
106 define Build/InstallDev
107 $(INSTALL_DIR) $(1)/usr/bin
108 $(CP) $(PKG_INSTALL_DIR)/usr/bin/js-config $(1)/usr/bin/
109 $(INSTALL_DIR) $(1)/usr/include
110 $(CP) $(PKG_INSTALL_DIR)/usr/include/js $(1)/usr/include/
111 $(INSTALL_DIR) $(1)/usr/lib
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.{a,so*} $(1)/usr/lib/
113 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc $(1)/usr/lib/pkgconfig/
115 endef
116
117 define Package/js/install
118 $(INSTALL_DIR) $(1)/usr/bin
119 $(CP) $(PKG_INSTALL_DIR)/usr/bin/js $(1)/usr/bin/
120 endef
121
122 define Package/libjs/install
123 $(INSTALL_DIR) $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* $(1)/usr/lib/
125 endef
126
127 $(eval $(call BuildPackage,js))
128 $(eval $(call BuildPackage,libjs))