2 # Copyright (C) 2006,2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/sablevm
17 PKG_MD5SUM
:=18a7c1a92b0748a206f9767a76a6b3bb
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/sablevm
28 DEPENDS
:=+libltdl
+libpopt
+libpthread
+zlib
29 TITLE
:=A Java Virtual Machine
(JVM
) implementation
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
/
39 define Package
/sablevm-mini
40 $(call Package
/sablevm
)
43 This package contains only the minimal set of Java classes needed to
\\\
44 run a simple
"HelloWorld" program
(included in this package
).
48 define Build
/Configure
49 $(call Build
/Configure
/Default
, \
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 \
60 LIBS
=" -lltdl -lpopt -lz " \
63 $(call Build
/Configure
/Default
, \
64 --srcdir=.
/..
/sablevm-classpath \
65 --with-fastjar
=/usr
/bin
/fastjar \
66 --with-jikes
=/usr
/bin
/jikes \
76 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
79 DESTDIR
="$(PKG_INSTALL_DIR)" \
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
; \
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
; \
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
/
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
/
117 $(eval
$(call BuildPackage
,sablevm
))
118 $(eval
$(call BuildPackage
,sablevm-mini
))
120 $(foreach command
, jikes fastjar
, \
121 $(eval
$(call RequireCommand
,$(command
), \
122 $(PKG_NAME
) requires
$(command
). \