[packages] zile: update to 2.3.21
[openwrt/svn-archive/archive.git] / lang / sablevm-sdk / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=sablevm-sdk
11 PKG_VERSION:=1.13
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/sablevm
16 PKG_MD5SUM:=18a7c1a92b0748a206f9767a76a6b3bb
17
18 PKG_BUILD_PARALLEL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/sablevm/Default
23 SUBMENU:=Java
24 SECTION:=lang
25 CATEGORY:=Languages
26 TITLE:=A Java Virtual Machine (JVM) implementation
27 URL:=http://sablevm.org/
28 DEPENDS:=+libltdl +libpopt +libpthread +zlib @!TARGET_avr32
29 endef
30
31 define Package/sablevm/Default/description
32 SableVM is a robust, extremely portable, efficient, and specifications-
33 -compliant Java virtual machine that aims to be easy to maintain and to
34 extend. It features a state-of-the-art and efficient interpreter engine.
35 Its source code is very accessible and easy to understand. It also has
36 many robustness features that have been the object of careful design.
37 endef
38
39 define Package/sablevm
40 $(call Package/sablevm/Default)
41 TITLE+= (full)
42 endef
43
44 define Package/sablevm/description
45 $(call Package/sablevm/Default/description)
46 .
47 This package contains the full set of Java classes.
48 endef
49
50 define Package/sablevm-mini
51 $(call Package/sablevm/Default)
52 TITLE+= (minimal)
53 endef
54
55 define Package/sablevm-mini/description
56 $(call Package/sablevm/Default/description)
57 .
58 This package contains only the minimal set of Java classes needed to
59 run a simple "HelloWorld" program (included in this package).
60 endef
61
62 define Build/Configure
63 $(call Build/Configure/Default, \
64 --disable-cp-tools \
65 --disable-gjdoc \
66 )
67 $(call Build/Configure/Default, \
68 --srcdir="./../sablevm" \
69 --with-fastjar=$$$$(which fastjar) \
70 --with-jikes=$$$$(which jikes) \
71 --with-internal-libffi=yes \
72 --with-internal-libpopt=no \
73 ,\
74 LIBS=" -lltdl -lpopt -lz " \
75 ,sablevm,\
76 )
77 $(call Build/Configure/Default, \
78 --srcdir=./../sablevm-classpath \
79 --with-fastjar=$$$$(which fastjar) \
80 --with-jikes=$$$$(which jikes) \
81 --disable-gtk-peer \
82 --disable-gtk-cairo \
83 --without-x \
84 ,\
85 ,sablevm-classpath,\
86 )
87 endef
88
89 define Build/Compile
90 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
91 EARLY_CONFIGURE= \
92 EXTRA_CONFIGURE= \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 all
95 $(MAKE) -C $(PKG_BUILD_DIR) \
96 EARLY_CONFIGURE= \
97 EXTRA_CONFIGURE= \
98 DESTDIR="$(PKG_INSTALL_DIR)" \
99 install
100 $(CP) ./files/mini.classlist $(PKG_BUILD_DIR)/sablevm-classpath/lib/
101 ( cd $(PKG_BUILD_DIR)/sablevm-classpath/lib; \
102 fastjar -Mcf mini.jar -@ < mini.classlist; \
103 )
104 mkdir -p $(PKG_INSTALL_DIR)/usr/share/sablevm/examples
105 $(CP) ./files/*.java $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/
106 ( cd $(PKG_INSTALL_DIR)/usr/share/sablevm/examples; \
107 jikes -bootclasspath "../../sablevm-classpath:../../sablevm-classpath/libclasspath.jar:../../sablevm-classpath/resources.jar" *.java; \
108 )
109 endef
110
111 define Package/sablevm/install
112 $(INSTALL_DIR) $(1)/usr/bin
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{java-,}sablevm $(1)/usr/bin/
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsablevm-*.so $(1)/usr/lib/
116 $(INSTALL_DIR) $(1)/usr/lib/sablevm-classpath
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sablevm-classpath/libjava*.so $(1)/usr/lib/sablevm-classpath/
118 $(INSTALL_DIR) $(1)/usr/lib/security
119 $(CP) $(PKG_INSTALL_DIR)/usr/lib/security/classpath.security $(1)/usr/lib/security/
120 $(INSTALL_DIR) $(1)/usr/share/sablevm-classpath
121 $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm-classpath/{libclasspath,resources}.jar \
122 $(1)/usr/share/sablevm-classpath/
123 endef
124
125 define Package/sablevm-mini/install
126 $(call Package/sablevm/install,$(1))
127 rm -f $(1)/usr/lib/security/classpath.security
128 rm -f $(1)/usr/share/sablevm-classpath/resources.jar
129 $(CP) $(PKG_BUILD_DIR)/sablevm-classpath/lib/mini.jar \
130 $(1)/usr/share/sablevm-classpath/libclasspath.jar
131 $(INSTALL_DIR) $(1)/usr/share/sablevm/examples
132 $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/* \
133 $(1)/usr/share/sablevm/examples/
134 endef
135
136 $(foreach command, jikes fastjar, \
137 $(eval $(call RequireCommand,$(command), \
138 $(PKG_NAME) requires $(command). \
139 )) \
140 )
141
142 $(eval $(call BuildPackage,sablevm))
143 $(eval $(call BuildPackage,sablevm-mini))
144