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