[packages] ossp-js: remove private libtool copy, supply missing macros, allow full...
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=js
11 PKG_VERSION:=1.6.20070208
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=ftp://ftp.ossp.org/pkg/lib/js/
16 PKG_MD5SUM:=07f6cad7e03fd74a949588c3d4b333de
17
18 PKG_FIXUP:=libtool
19 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
20
21 include $(INCLUDE_DIR)/package.mk
22
23 PKG_INSTALL=1
24
25 define Package/js/Default
26  TITLE:=Mozilla JavaScript Engine
27  URL:=http://www.ossp.org/pkg/lib/js/
28 endef
29
30 define Package/js
31 $(call Package/js/Default)
32  SECTION:=lang
33  CATEGORY:=Languages
34  SUBMENU:=JavaScript
35  TITLE+= (interpreter)
36  DEPENDS+= +libjs +libreadline +libncurses
37 endef
38
39 define Package/libjs
40 $(call Package/js/Default)
41  SECTION:=libs
42  CATEGORY:=Libraries
43  TITLE+= (library)
44 endef
45
46 TARGET_CFLAGS += $(FPIC)
47
48 CONFIGURE_ARGS += \
49         --enable-shared \
50         --enable-static \
51         --with-dso \
52         --with-editline \
53         --with-file \
54         --without-perl
55
56 define Build/Configure
57         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
58                 ./configure \
59                         --prefix=/usr \
60                         --exec-prefix=/usr \
61                         --bindir=/usr/bin \
62                         --datadir=/usr/share \
63                         --includedir=/usr/include \
64                         --infodir=/usr/share/info \
65                         --libdir=/usr/lib \
66                         --libexecdir=/usr/lib \
67                         --localstatedir=/var \
68                         --mandir=/usr/share/man \
69                         --sbindir=/usr/sbin \
70                         --sysconfdir=/etc \
71                         $(DISABLE_NLS) \
72                         $(DISABLE_LARGEFILE) \
73                         --disable-shared \
74                         --enable-static \
75         );
76         $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
77         $(call Build/Configure/Default)
78 endef
79
80 define Build/InstallDev
81         $(INSTALL_DIR) $(2)/bin
82         $(INSTALL_BIN) \
83                 $(PKG_INSTALL_DIR)/usr/bin/js-config \
84                 $(2)/bin/
85         $(SED) \
86                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
87                 $(2)/bin/js-config
88
89         $(INSTALL_DIR) $(1)/usr/include
90         $(CP) \
91                 $(PKG_INSTALL_DIR)/usr/include/js \
92                 $(1)/usr/include/
93
94         $(INSTALL_DIR) $(1)/usr/lib
95         $(CP) \
96                 $(PKG_INSTALL_DIR)/usr/lib/libjs.{la,so*} \
97                 $(1)/usr/lib/
98
99         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
100         $(INSTALL_DATA) \
101                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc \
102                 $(1)/usr/lib/pkgconfig/
103 endef
104
105 define Package/js/install
106         $(INSTALL_DIR) $(1)/usr/bin
107         $(INSTALL_BIN) \
108                 $(PKG_INSTALL_DIR)/usr/bin/js \
109                 $(1)/usr/bin/
110 endef
111
112 define Package/libjs/install
113         $(INSTALL_DIR) $(1)/usr/lib
114         $(CP) \
115                 $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* \
116                 $(1)/usr/lib/
117 endef
118
119 $(eval $(call BuildPackage,js))
120 $(eval $(call BuildPackage,libjs))