argp-standalone: moved to github
[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:=autoreconf
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-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/InstallDev
80         $(INSTALL_DIR) $(2)/bin
81         $(INSTALL_BIN) \
82                 $(PKG_INSTALL_DIR)/usr/bin/js-config \
83                 $(2)/bin/
84         $(SED) \
85                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
86                 $(2)/bin/js-config
87
88         $(INSTALL_DIR) $(1)/usr/include
89         $(CP) \
90                 $(PKG_INSTALL_DIR)/usr/include/js \
91                 $(1)/usr/include/
92
93         $(INSTALL_DIR) $(1)/usr/lib
94         $(CP) \
95                 $(PKG_INSTALL_DIR)/usr/lib/libjs.{la,so*} \
96                 $(1)/usr/lib/
97
98         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
99         $(INSTALL_DATA) \
100                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc \
101                 $(1)/usr/lib/pkgconfig/
102 endef
103
104 define Package/js/install
105         $(INSTALL_DIR) $(1)/usr/bin
106         $(INSTALL_BIN) \
107                 $(PKG_INSTALL_DIR)/usr/bin/js \
108                 $(1)/usr/bin/
109 endef
110
111 define Package/libjs/install
112         $(INSTALL_DIR) $(1)/usr/lib
113         $(CP) \
114                 $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* \
115                 $(1)/usr/lib/
116 endef
117
118 $(eval $(call BuildPackage,js))
119 $(eval $(call BuildPackage,libjs))