From 99c58703139a8c478caa8c6cd25d1800d9f97d3a Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Wed, 18 Apr 2007 00:53:22 +0000 Subject: [PATCH] replace sablevm and sablevm-classpath with sablevm-sdk, add a sablevm-mini package containing a minimal set of classes and a working example SVN-Revision: 6995 --- lang/sablevm-classpath/Makefile | 98 -------------- lang/sablevm-sdk/Makefile | 126 ++++++++++++++++++ lang/sablevm-sdk/files/HelloWorld.java | 8 ++ .../files/mini.classlist | 0 .../patches/001-heap_size.patch | 6 +- lang/sablevm/Makefile | 60 --------- 6 files changed, 137 insertions(+), 161 deletions(-) delete mode 100644 lang/sablevm-classpath/Makefile create mode 100644 lang/sablevm-sdk/Makefile create mode 100644 lang/sablevm-sdk/files/HelloWorld.java rename lang/{sablevm-classpath => sablevm-sdk}/files/mini.classlist (100%) rename lang/{sablevm => sablevm-sdk}/patches/001-heap_size.patch (53%) delete mode 100644 lang/sablevm/Makefile diff --git a/lang/sablevm-classpath/Makefile b/lang/sablevm-classpath/Makefile deleted file mode 100644 index 2b1f291c64..0000000000 --- a/lang/sablevm-classpath/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# -# Copyright (C) 2006 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -# $Id$ - -include $(TOPDIR)/rules.mk - -PKG_NAME:=sablevm-classpath -PKG_VERSION:=1.13 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://sablevm.org/download/release/$(PKG_VERSION)/ -PKG_MD5SUM:=9476bb7a0ad67c6cfa353d06f094cdce -PKG_CAT:=zcat - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install - -include $(INCLUDE_DIR)/package.mk - -define Package/sablevm-classpath/Default - SECTION:=lang - CATEGORY:=Languages - URL:=http://www.gnu.org/software/classpath/ -endef - -define Package/libsablevm-classpath - $(call Package/sablevm-classpath/Default) - TITLE:=Essential native libraries for Java - DESCRIPTION:=\ - GNU Classpath, Essential Libraries for Java, is a GNU project to create \\\ - free core class libraries for use with virtual machines and compilers for \\\ - the java programming language.\\\ - This is a modified version for use with SableVM. -endef - -define Package/sablevm-classpath-full - $(call Package/sablevm-classpath/Default) - DEPENDS:=+libsablevm-classpath - TITLE+= (full) -endef - -define Package/sablevm-classpath-mini - $(call Package/sablevm-classpath/Default) - DEPENDS:=+libsablevm-classpath - TITLE+= (minimal) -endef - -define Build/Configure - $(call Build/Configure/Default, \ - --disable-gtk-peer \ - --disable-gtk-cairo \ - --with-jikes \ - --without-x \ - ) -endef - - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install - $(CP) ./files/mini.classlist $(PKG_BUILD_DIR)/lib/ - cd $(PKG_BUILD_DIR)/lib ; fastjar -Mcf mini.jar -@ < mini.classlist -endef - -define Package/libsablevm-classpath/install - $(INSTALL_DIR) $(1)/usr/lib/sablevm-classpath - $(CP) $(PKG_INSTALL_DIR)/usr/lib/sablevm-classpath/libjava*.so $(1)/usr/lib/sablevm-classpath/ - $(INSTALL_DIR) $(1)/usr/lib/security - $(CP) $(PKG_INSTALL_DIR)/usr/lib/security/classpath.security $(1)/usr/lib/security/ -endef - -define Package/sablevm-classpath-full/install - $(INSTALL_DIR) $(1)/usr/share/sablevm-classpath - $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm-classpath/{libclasspath,resources}.jar \ - $(1)/usr/share/sablevm-classpath/ -endef - -define Package/sablevm-classpath-mini/install - $(INSTALL_DIR) $(1)/usr/share/sablevm-classpath - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/mini.jar \ - $(1)/usr/share/sablevm-classpath/libclasspath.jar -endef - -$(eval $(call BuildPackage,libsablevm-classpath)) -$(eval $(call BuildPackage,sablevm-classpath-full)) -$(eval $(call BuildPackage,sablevm-classpath-mini)) - -$(foreach command, jikes fastjar, \ - $(eval $(call RequireCommand,$(command), \ - $(PKG_NAME) requires $(command). \ - )) \ -) diff --git a/lang/sablevm-sdk/Makefile b/lang/sablevm-sdk/Makefile new file mode 100644 index 0000000000..88c602be9c --- /dev/null +++ b/lang/sablevm-sdk/Makefile @@ -0,0 +1,126 @@ +# +# Copyright (C) 2006,2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sablevm-sdk +PKG_VERSION:=1.13 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/sablevm +PKG_MD5SUM:=18a7c1a92b0748a206f9767a76a6b3bb +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/sablevm + SECTION:=lang + CATEGORY:=Languages + DEPENDS:=+libltdl +libpopt +libpthread +zlib + TITLE:=A Java Virtual Machine (JVM) implementation + DESCRIPTION:=\ + SableVM is a robust, extremely portable, efficient, and specifications-\\\ + -compliant Java virtual machine that aims to be easy to maintain and to \\\ + extend. It features a state-of-the-art and efficient interpreter engine.\\\ + Its source code is very accessible and easy to understand. It also has \\\ + many robustness features that have been the object of careful design. + URL:=http://sablevm.org/ +endef + +define Package/sablevm-mini + $(call Package/sablevm) + TITLE+= (minimal) + DESCRIPTION+=\\\ + This package contains only the minimal set of Java classes needed to \\\ + run a simple "HelloWorld" program (included in this package). +endef + + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-cp-tools \ + --disable-gjdoc \ + ) + $(call Build/Configure/Default, \ + --srcdir=./../sablevm \ + --with-fastjar=/usr/bin/fastjar \ + --with-jikes=/usr/bin/jikes \ + --with-internal-libffi=yes \ + --with-internal-libpopt=no \ + , \ + LIBS=" -lltdl -lpopt -lz " \ + , + sablevm \ + ) + $(call Build/Configure/Default, \ + --srcdir=./../sablevm-classpath \ + --with-fastjar=/usr/bin/fastjar \ + --with-jikes=/usr/bin/jikes \ + --disable-gtk-peer \ + --disable-gtk-cairo \ + --without-x \ + , \ + , \ + sablevm-classpath \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + EARLY_CONFIGURE= \ + EXTRA_CONFIGURE= \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install + $(CP) ./files/mini.classlist $(PKG_BUILD_DIR)/sablevm-classpath/lib/ + ( cd $(PKG_BUILD_DIR)/sablevm-classpath/lib; \ + fastjar -Mcf mini.jar -@ < mini.classlist; \ + ) + mkdir -p $(PKG_INSTALL_DIR)/usr/share/sablevm/examples + $(CP) ./files/*.java $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/ + ( cd $(PKG_INSTALL_DIR)/usr/share/sablevm/examples; \ + jikes -bootclasspath "../../sablevm-classpath:../../sablevm-classpath/libclasspath.jar:../../sablevm-classpath/resources.jar" *.java; \ + ) +endef + +define Package/sablevm/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/{java-,}sablevm $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsablevm-*.so $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/sablevm-classpath + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sablevm-classpath/libjava*.so $(1)/usr/lib/sablevm-classpath/ + $(INSTALL_DIR) $(1)/usr/lib/security + $(CP) $(PKG_INSTALL_DIR)/usr/lib/security/classpath.security $(1)/usr/lib/security/ + $(INSTALL_DIR) $(1)/usr/share/sablevm-classpath + $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm-classpath/{libclasspath,resources}.jar \ + $(1)/usr/share/sablevm-classpath/ +endef + +define Package/sablevm-mini/install + $(call Package/sablevm/install,$(1)) + rm -f $(1)/usr/lib/security/classpath.security + rm -f $(1)/usr/share/sablevm-classpath/resources.jar + $(CP) $(PKG_BUILD_DIR)/sablevm-classpath/lib/mini.jar \ + $(1)/usr/share/sablevm-classpath/libclasspath.jar + $(INSTALL_DIR) $(1)/usr/share/sablevm/examples + $(CP) $(PKG_INSTALL_DIR)/usr/share/sablevm/examples/* \ + $(1)/usr/share/sablevm/examples/ +endef + +$(eval $(call BuildPackage,sablevm)) +$(eval $(call BuildPackage,sablevm-mini)) + +$(foreach command, jikes fastjar, \ + $(eval $(call RequireCommand,$(command), \ + $(PKG_NAME) requires $(command). \ + )) \ +) diff --git a/lang/sablevm-sdk/files/HelloWorld.java b/lang/sablevm-sdk/files/HelloWorld.java new file mode 100644 index 0000000000..4dbe46e49d --- /dev/null +++ b/lang/sablevm-sdk/files/HelloWorld.java @@ -0,0 +1,8 @@ +class HelloWorld +{ + public static void main(String args[]) + { + System.out.println("Hello World!"); + } +} + diff --git a/lang/sablevm-classpath/files/mini.classlist b/lang/sablevm-sdk/files/mini.classlist similarity index 100% rename from lang/sablevm-classpath/files/mini.classlist rename to lang/sablevm-sdk/files/mini.classlist diff --git a/lang/sablevm/patches/001-heap_size.patch b/lang/sablevm-sdk/patches/001-heap_size.patch similarity index 53% rename from lang/sablevm/patches/001-heap_size.patch rename to lang/sablevm-sdk/patches/001-heap_size.patch index d28237296a..73d3e2bfc8 100644 --- a/lang/sablevm/patches/001-heap_size.patch +++ b/lang/sablevm-sdk/patches/001-heap_size.patch @@ -1,6 +1,6 @@ -diff -ruN sablevm-1.11.1-orig/src/libsablevm/system.h sablevm-1.11.1-1/src/libsablevm/system.h ---- sablevm-1.11.1-orig/src/libsablevm/system.h 2005-03-18 01:25:09.000000000 +0100 -+++ sablevm-1.11.1-1/src/libsablevm/system.h 2005-03-22 01:05:19.000000000 +0100 +diff -ruN sablevm-sdk-1.13-old/sablevm/src/libsablevm/system.h sablevm-sdk-1.13-new/sablevm/src/libsablevm/system.h +--- sablevm-sdk-1.13-old/sablevm/src/libsablevm/system.h 2007-03-30 03:57:54.000000000 +0200 ++++ sablevm-sdk-1.13-new/sablevm/src/libsablevm/system.h 2007-04-11 02:25:06.000000000 +0200 @@ -279,9 +279,9 @@ #elif defined (_SABLEVM_COPY_GC) || (_SABLEVM_GENCOPY_GC) diff --git a/lang/sablevm/Makefile b/lang/sablevm/Makefile deleted file mode 100644 index 3b80eaf943..0000000000 --- a/lang/sablevm/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright (C) 2006 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -# $Id$ - -include $(TOPDIR)/rules.mk - -PKG_NAME:=sablevm -PKG_VERSION:=1.13 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://sablevm.org/download/release/$(PKG_VERSION)/ -PKG_MD5SUM:=d5828200032bfe921dd43e450931e38c -PKG_CAT:=zcat - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install - -include $(INCLUDE_DIR)/package.mk - -define Package/sablevm - SECTION:=lang - CATEGORY:=Languages - DEPENDS:=+libffi-sable +libltdl +libpopt +libpthread +zlib - TITLE:=A Java Virtual Machine (JVM) implementation - DESCRIPTION:=\ - SableVM is a robust, extremely portable, efficient, and specifications-\\\ - -compliant Java virtual machine that aims to be easy to maintain and to \\\ - extend. It features a state-of-the-art and efficient interpreter engine.\\\ - Its source code is very accessible and easy to understand. It also has \\\ - many robustness features that have been the object of careful design. - URL:=http://sablevm.org/ -endef - - -define Build/Configure - $(call Build/Configure/Default, \ - , \ - LIBS="-lffi -lltdl -lpopt -lz" \ - ) -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install -endef - -define Package/sablevm/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/{java-,}sablevm $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsablevm-*.so $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,sablevm)) -- 2.30.2