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