2 # Copyright (C) 2006-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=@SF
/sablevm
16 PKG_MD5SUM
:=18a7c1a92b0748a206f9767a76a6b3bb
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/sablevm
/Default
26 TITLE
:=A Java Virtual Machine
(JVM
) implementation
27 URL
:=http
://sablevm.org
/
28 DEPENDS
:=+libltdl
+libpopt
+libpthread
+zlib @
!TARGET_avr32
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.
39 define Package
/sablevm
40 $(call Package
/sablevm
/Default
)
44 define Package
/sablevm
/description
45 $(call Package
/sablevm
/Default
/description
)
47 This package contains the full set of Java classes.
50 define Package
/sablevm-mini
51 $(call Package
/sablevm
/Default
)
55 define Package
/sablevm-mini
/description
56 $(call Package
/sablevm
/Default
/description
)
58 This package contains only the minimal set of Java classes needed to
59 run a simple
"HelloWorld" program
(included in this package
).
62 define Build
/Configure
63 $(call Build
/Configure
/Default
, \
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 \
74 LIBS
=" -lltdl -lpopt -lz " \
77 $(call Build
/Configure
/Default
, \
78 --srcdir=.
/..
/sablevm-classpath \
79 --with-fastjar
=$$$$(which fastjar
) \
80 --with-jikes
=$$$$(which jikes
) \
90 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
93 DESTDIR
="$(PKG_INSTALL_DIR)" \
95 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
98 DESTDIR
="$(PKG_INSTALL_DIR)" \
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
; \
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
; \
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
/
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
/
136 $(foreach command
, jikes fastjar
, \
137 $(eval
$(call RequireCommand
,$(command
), \
138 $(PKG_NAME
) requires
$(command
). \
142 $(eval
$(call BuildPackage
,sablevm
))
143 $(eval
$(call BuildPackage
,sablevm-mini
))