Retain symlinks. $(INSTALL_*) copys the contens of a file, so if we want to keep
[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:=2
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 PKG_FIXUP:=libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 PKG_INSTALL=1
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/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))