2015-07-21 183 views
0

我當前想要在OpenWrt環境中安裝OpenHAB(現在它在具有x86架構的虛擬機上),並且它至少需要具有版本1.6的Java運行時。在OpenWrt上安裝JamVM 2.0:如何更改Makefile以便使用OpenJDK庫?

所以我使用了OpenWrt 14.07(Breaking Barrier)SDK交叉編譯器,它包含一個名爲JamVM的緊湊型Java機器。對於版本1.x,JamVM使用提供Java 1.5的GNU類路徑,但自從JamVM 2.0以來,該程序允許使用提供Java 1.6到1.9的OpenJDK。我只需要生成包含此OpenJDK庫的JamVM包,但我不熟悉Makefile配置。這是當前的Makefile與GNU類路徑庫設置好的:


# 
# 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 <[email protected]> 

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
PKG_SOURCE_URL:[email protected]/$(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 \ 

改變這種

--with-java-runtime-library=openjdk7 \ 

但隨着這一改變,我的包沒有能夠編譯時我

make /packages/lang/jamvm 

有沒有人知道該怎麼辦?

謝謝大家

回答

0

這並不容易。 OpenJDK 7的OpenWRT郵件列表中有許多來自Waldemar Brodkorb的補丁程序,以及OpenJDK 6的一些較早的補丁程序。但就我的理解而言,它們只能讓您構建x86版本。

我認爲從OpenHAB軟件包中刪除java版本限制比使用JamVM交叉構建OpenJDK更簡單 - 不要開玩笑!

相關問題