在OpenWrt上安装JamVM 2.0:如何修改Makefile,使其使用OpenJDK库



我目前想在OpenWrt环境中安装OpenHAB(目前它在x86架构的虚拟机上),并且它需要至少有1.6版本的Java运行时。

所以我使用了OpenWrt 14.07 (Breaking Barrier) SDK交叉编译器,它包含一个名为JamVM的紧凑Java机器。对于版本1。x, JamVM使用GNU类路径,提供Java 1.5,但从JamVM 2.0开始,这个程序允许使用OpenJDK,提供Java 1.6到1.9。我想要的只是生成包含这个OpenJDK库的JamVM包,但是我不熟悉Makefile配置。下面是设置了GNU类路径库的当前Makefile:


#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=jamvm
PKG_VERSION:=2.0.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_MD5SUM:=a6e3321ef4b3cfb4afc20bd75452e11e
PKG_USE_MIPS16:=0
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/jamvm
  SUBMENU:=Java
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=A compact Java Virtual Machine
  URL:=http://sourceforge.net/projects/jamvm
  DEPENDS:=+zlib +libpthread +librt +classpath @!avr32
endef
define Package/jamvm/description
 JamVM is a new Java Virtual Machine which conforms to the JVM
 specification version (blue book). In comparison to most other VM's (free
 and commercial) it is extremely small.However, unlike other small VMs
 (e.g. KVM) it is designed to support the full specification, and includes
 support for object finalisation, Soft/Weak/Phantom References, the Java
 Native Interface (JNI) and the Reflection API.
endef
CONFIGURE_ARGS += 
    --with-java-runtime-library=gnuclasspath 
    --with-classpath-install-dir=/usr 
    --disable-int-inlining 
    --disable-shared 
    --without-pic
MAKE_FLAGS += 
    GLIBJ_ZIP=$(STAGING_DIR)/usr/share/classpath/glibj.zip
define Package/jamvm/install
    $(INSTALL_DIR) $(1)/usr
    $(CP) 
        $(PKG_INSTALL_DIR)/usr/bin 
        $(PKG_INSTALL_DIR)/usr/share 
        $(1)/usr/
endef
define Build/InstallDev
    $(CP) $(PKG_INSTALL_DIR)/* $(1)/
endef
$(eval $(call BuildPackage,jamvm))

我知道在CONFIGURE_ARGS中,我可以更改

--with-java-runtime-library=gnuclasspath 

到this

--with-java-runtime-library=openjdk7 

但是通过这个简单的更改,当我执行

时,我的包无法编译
make /packages/lang/jamvm

有人知道该怎么做吗?

谢谢大家

可没那么容易。在OpenWRT邮件列表中有一堆来自Waldemar Brodkorb的OpenJDK 7补丁和一些OpenJDK 6的旧补丁。但据我所知,它们只能让你构建一个x86版本。

我认为从OpenHAB包中删除java版本约束比用JamVM交叉构建OpenJDK更容易——不是开玩笑!

相关内容

  • 没有找到相关文章