3211cf822e7391fb20cb55b96fcd109ebaf83f67
[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 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/sablevm
26 SECTION:=lang
27 CATEGORY:=Languages
28 DEPENDS:=+libltdl +libpopt +libpthread +zlib
29 TITLE:=A Java Virtual Machine (JVM) implementation
30 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 URL:=http://sablevm.org/
37 endef
38
39 define Package/sablevm-mini
40 $(call Package/sablevm)
41 TITLE+= (minimal)
42 DESCRIPTION+=\\\
43 This package contains only the minimal set of Java classes needed to \\\
44 run a simple "HelloWorld" program (included in this package).
45 endef
46
47
48 define Build/Configure
49 $(call Build/Configure/Default, \
50 --disable-cp-tools \
51 --disable-gjdoc \
52 )
53 $(call Build/Configure/Default, \
54 --srcdir="./../sablevm" \
55 --with-fastjar=/usr/bin/fastjar \
56 --with-jikes=/usr/bin/jikes \
57 --with-internal-libffi=yes \
58 --with-internal-libpopt=no \
59 ,\
60 LIBS=" -lltdl -lpopt -lz " \
61 ,sablevm,\
62 )
63 $(call Build/Configure/Default, \
64 --srcdir=./../sablevm-classpath \
65 --with-fastjar=/usr/bin/fastjar \
66 --with-jikes=/usr/bin/jikes \
67 --disable-gtk-peer \
68 --disable-gtk-cairo \
69 --without-x \
70 ,\
71 ,sablevm-classpath,\
72 )
73 endef
74
75 define Build/Compile
76 $(MAKE) -C $(PKG_BUILD_DIR) \
77 EARLY_CONFIGURE= \
78 EXTRA_CONFIGURE= \
79 DESTDIR="$(PKG_INSTALL_DIR)" \
80 all install
81 $(CP) ./files/mini.classlist $(PKG_BUILD_DIR)/sablevm-classpath/lib/
82 ( cd $(PKG_BUILD_DIR)/sablevm-classpath/lib; \
83 fastjar -Mcf mini.jar -@ < mini.classlist; \
84 )
85 mkdir -p $(PKG_INSTALL_DIR)/usr/share/sablevm/examples
86 $(CP) ./files/*.java $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/
87 ( cd $(PKG_INSTALL_DIR)/usr/share/sablevm/examples; \
88 jikes -bootclasspath "../../sablevm-classpath:../../sablevm-classpath/libclasspath.jar:../../sablevm-classpath/resources.jar" *.java; \
89 )
90 endef
91
92 define Package/sablevm/install
93 $(INSTALL_DIR) $(1)/usr/bin
94 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{java-,}sablevm $(1)/usr/bin/
95 $(INSTALL_DIR) $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsablevm-*.so $(1)/usr/lib/
97 $(INSTALL_DIR) $(1)/usr/lib/sablevm-classpath
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/sablevm-classpath/libjava*.so $(1)/usr/lib/sablevm-classpath/
99 $(INSTALL_DIR) $(1)/usr/lib/security
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/security/classpath.security $(1)/usr/lib/security/
101 $(INSTALL_DIR) $(1)/usr/share/sablevm-classpath
102 $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm-classpath/{libclasspath,resources}.jar \
103 $(1)/usr/share/sablevm-classpath/
104 endef
105
106 define Package/sablevm-mini/install
107 $(call Package/sablevm/install,$(1))
108 rm -f $(1)/usr/lib/security/classpath.security
109 rm -f $(1)/usr/share/sablevm-classpath/resources.jar
110 $(CP) $(PKG_BUILD_DIR)/sablevm-classpath/lib/mini.jar \
111 $(1)/usr/share/sablevm-classpath/libclasspath.jar
112 $(INSTALL_DIR) $(1)/usr/share/sablevm/examples
113 $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/* \
114 $(1)/usr/share/sablevm/examples/
115 endef
116
117 $(eval $(call BuildPackage,sablevm))
118 $(eval $(call BuildPackage,sablevm-mini))
119
120 $(foreach command, jikes fastjar, \
121 $(eval $(call RequireCommand,$(command), \
122 $(PKG_NAME) requires $(command). \
123 )) \
124 )