我目前想在 OpenWrt 环境中安装 OpenHAB(目前它在具有 x86 架构的虚拟机上),并且它需要具有至少 1.6 版的 Java 运行时。
所以我使用了 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 配置。这是设置了 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 \
对此
--with-java-runtime-library=openjdk7 \
但是通过这个单一的更改,我的包在我这样做时无法编译
make /packages/lang/jamvm
有没有人知道该怎么做?
谢谢你们