initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
config BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_HOSTARCH = "x86_64"
|
||||
|
||||
# Taken from make/autoconf/platform.m4
|
||||
config BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_aarch64
|
||||
default y if BR2_arm
|
||||
default y if BR2_i386 || BR2_x86_64
|
||||
default y if BR2_m68k
|
||||
default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
|
||||
default y if BR2_sh
|
||||
|
||||
config BR2_PACKAGE_OPENJDK
|
||||
bool "openjdk"
|
||||
depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
|
||||
depends on !BR2_SOFT_FLOAT
|
||||
depends on !BR2_STATIC_LIBS # glibc
|
||||
depends on BR2_INSTALL_LIBSTDCPP # cups
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib, cups, libusb
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libusb, C++14 for OpenJDK17
|
||||
depends on BR2_TOOLCHAIN_USES_GLIBC
|
||||
depends on BR2_USE_MMU # cups
|
||||
depends on BR2_PACKAGE_XORG7
|
||||
select BR2_PACKAGE_ALSA_LIB
|
||||
select BR2_PACKAGE_ALSA_LIB_MIXER
|
||||
select BR2_PACKAGE_ALSA_LIB_PCM
|
||||
select BR2_PACKAGE_ALSA_LIB_RAWMIDI
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
select BR2_PACKAGE_CUPS
|
||||
select BR2_PACKAGE_FONTCONFIG
|
||||
select BR2_PACKAGE_GIFLIB
|
||||
select BR2_PACKAGE_JPEG
|
||||
select BR2_PACKAGE_LCMS2
|
||||
select BR2_PACKAGE_LIBPNG
|
||||
select BR2_PACKAGE_LIBUSB
|
||||
select BR2_PACKAGE_XLIB_LIBXRANDR
|
||||
select BR2_PACKAGE_XLIB_LIBXRENDER
|
||||
select BR2_PACKAGE_XLIB_LIBXT
|
||||
select BR2_PACKAGE_XLIB_LIBXTST
|
||||
select BR2_PACKAGE_ZLIB
|
||||
help
|
||||
OpenJDK is a free and open-source implementation of the
|
||||
Java Platform.
|
||||
|
||||
http://openjdk.java.net/
|
||||
|
||||
if BR2_PACKAGE_OPENJDK
|
||||
|
||||
choice
|
||||
prompt "openjdk version"
|
||||
default BR2_PACKAGE_OPENJDK_VERSION_17
|
||||
help
|
||||
Select the version of OpenJDK you wish to use.
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_VERSION_11
|
||||
bool "OpenJDK 11"
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_VERSION_17
|
||||
bool "OpenJDK 17"
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_9 # C++14
|
||||
|
||||
comment "OpenJDK 17 needs a host gcc >= 4.9"
|
||||
depends on !BR2_HOST_GCC_AT_LEAST_4_9 # C++14
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_FULL_JDK
|
||||
bool "Build the full JDK"
|
||||
help
|
||||
Install the full JDK instead of just the run time.
|
||||
The full JDK includes several packages used for debugging and
|
||||
development. Some useful tools included with the JDK are:
|
||||
- javaws
|
||||
Command line tool for launching Java Web Start and setting
|
||||
various options.
|
||||
|
||||
- jcmd:
|
||||
JVM Diagnostic Commands tool: Sends diagnostic command
|
||||
requests to a running Java Virtual Machine.
|
||||
|
||||
- jinfo
|
||||
Configuration Info for Java: Prints configuration
|
||||
information for a given process or core file or a remote
|
||||
debug server.
|
||||
|
||||
- jmap
|
||||
Memory Map for Java: Prints shared object memory maps or
|
||||
heap memory details of a given process or core file or a
|
||||
remote debug server.
|
||||
|
||||
- jsadebugd
|
||||
Serviceability Agent Debug Daemon for Java: Attaches to a
|
||||
process or core file and acts as a debug server.
|
||||
|
||||
- jstack
|
||||
Stack Trace for Java - Prints a stack trace of threads for
|
||||
a given process or core file or remote debug server.
|
||||
|
||||
- jstat
|
||||
JVM Statistics Monitoring Tool: Attaches to an
|
||||
instrumented HotSpot Java virtual machine and collects and
|
||||
logs performance statistics as specified by the command
|
||||
line options.
|
||||
|
||||
- jstatd
|
||||
JVM jstat Daemon - Launches an RMI server application that
|
||||
monitors for the creation and termination of instrumented
|
||||
HotSpot Java virtual machines and provides an interface to
|
||||
allow remote monitoring tools to attach to Java virtual
|
||||
machines running on the local system.
|
||||
|
||||
Note:
|
||||
While the JDK also comes with several tools which can be used
|
||||
for developing java applications on a target, Buildroot does
|
||||
not support development on a target. Building the full JDK is
|
||||
supported for debugging purposes only.
|
||||
|
||||
Selecting this option increases the file system by
|
||||
approximately 110M.
|
||||
|
||||
choice
|
||||
prompt "openjdk variant"
|
||||
default BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER if !BR2_powerpc
|
||||
default BR2_PACKAGE_OPENJDK_JVM_VARIANT_ZERO if BR2_powerpc
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT
|
||||
bool "client"
|
||||
depends on !BR2_powerpc
|
||||
help
|
||||
Quick loading, but slower run-time performance.
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER
|
||||
bool "server"
|
||||
depends on !BR2_powerpc
|
||||
help
|
||||
Slower loading, but faster run-time performance.
|
||||
|
||||
config BR2_PACKAGE_OPENJDK_JVM_VARIANT_ZERO
|
||||
bool "zero"
|
||||
select BR2_PACKAGE_LIBFFI
|
||||
help
|
||||
A non-assembler variant with wide arch support, however
|
||||
performance is less then client/server.
|
||||
|
||||
http://openjdk.java.net/projects/zero
|
||||
|
||||
endchoice
|
||||
endif
|
||||
|
||||
comment "openjdk needs X.Org"
|
||||
depends on BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_PACKAGE_XORG7
|
||||
|
||||
comment "openjdk needs glibc, and a toolchain w/ wchar, dynamic library, threads, C++, gcc >= 4.9"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS
|
||||
depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
!BR2_TOOLCHAIN_USES_GLIBC || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
|
||||
|
||||
comment "openjdk does not support soft float configurations"
|
||||
depends on BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_SOFT_FLOAT
|
||||
@@ -0,0 +1,4 @@
|
||||
# Locally computed
|
||||
sha256 8c076203a6f85ab916b3e54de1992bcbcc5ffe580c52b1ac8d52ca7afb9f02d1 openjdk-17.0.1+12.tar.gz
|
||||
sha256 119c6233fe7ff5670c590e2f9d6686ac4d80c97b17065506998b75c547b54f2c openjdk-11.0.13+8.tar.gz
|
||||
sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE
|
||||
@@ -0,0 +1,160 @@
|
||||
################################################################################
|
||||
#
|
||||
# openjdk
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_VERSION_17),y)
|
||||
OPENJDK_VERSION_MAJOR = 17
|
||||
OPENJDK_VERSION_MINOR = 0.1+12
|
||||
else
|
||||
OPENJDK_VERSION_MAJOR = 11
|
||||
OPENJDK_VERSION_MINOR = 0.13+8
|
||||
endif
|
||||
OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR).$(OPENJDK_VERSION_MINOR)
|
||||
OPENJDK_SITE = $(call github,openjdk,jdk$(OPENJDK_VERSION_MAJOR)u,jdk-$(OPENJDK_VERSION))
|
||||
|
||||
OPENJDK_LICENSE = GPL-2.0+ with exception
|
||||
OPENJDK_LICENSE_FILES = LICENSE
|
||||
OPENJDK_INSTALL_STAGING = YES
|
||||
|
||||
# OpenJDK requires Alsa, cups, and X11 even for a headless build.
|
||||
# host-zip is needed for the zip executable.
|
||||
OPENJDK_DEPENDENCIES = \
|
||||
host-gawk \
|
||||
host-openjdk-bin \
|
||||
host-pkgconf \
|
||||
host-zip \
|
||||
host-zlib \
|
||||
alsa-lib \
|
||||
cups \
|
||||
fontconfig \
|
||||
giflib \
|
||||
jpeg \
|
||||
lcms2 \
|
||||
libpng \
|
||||
libusb \
|
||||
xlib_libXrandr \
|
||||
xlib_libXrender \
|
||||
xlib_libXt \
|
||||
xlib_libXtst \
|
||||
zlib
|
||||
|
||||
# JVM variants
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT),y)
|
||||
OPENJDK_JVM_VARIANT = client
|
||||
endif
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER),y)
|
||||
OPENJDK_JVM_VARIANT = server
|
||||
endif
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_ZERO),y)
|
||||
OPENJDK_JVM_VARIANT = zero
|
||||
OPENJDK_DEPENDENCIES += libffi
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_FULL_JDK),y)
|
||||
OPENJDK_VARIANT = jdk
|
||||
OPENJDK_MAKE_TARGET = jdk-image
|
||||
else
|
||||
OPENJDK_VARIANT = jre
|
||||
OPENJDK_MAKE_TARGET = legacy-jre-image
|
||||
endif
|
||||
|
||||
# OpenJDK installs a file named 'modules' in jre/lib, which gets installed as
|
||||
# /usr/lib/modules. However, with a merged /usr, this conflicts with the
|
||||
# directory named 'modules' installed by the kernel. If OpenJDK gets built
|
||||
# after the kernel, this manifests itself with: "cp: cannot overwrite
|
||||
# directory '/usr/lib/modules with non-directory."
|
||||
OPENJDK_INSTALL_BASE = /usr/lib/jvm
|
||||
|
||||
# OpenJDK ignores some variables unless passed via the environment.
|
||||
# These variables are PATH, LD, CC, CXX, and CPP.
|
||||
# OpenJDK defaults ld to the ld binary but passes -Xlinker and -z as
|
||||
# arguments during the linking process, which causes compilation failures.
|
||||
# To fix this issue, LD is set to point to gcc.
|
||||
OPENJDK_CONF_ENV = \
|
||||
PATH=$(BR_PATH) \
|
||||
CC=$(TARGET_CC) \
|
||||
CPP=$(TARGET_CPP) \
|
||||
CXX=$(TARGET_CXX) \
|
||||
LD=$(TARGET_CC) \
|
||||
BUILD_SYSROOT_CFLAGS="$(HOST_CFLAGS)" \
|
||||
BUILD_SYSROOT_LDFLAGS="$(HOST_LDFLAGS)"
|
||||
|
||||
OPENJDK_CONF_OPTS = \
|
||||
--disable-full-docs \
|
||||
--disable-hotspot-gtest \
|
||||
--disable-manpages \
|
||||
--disable-warnings-as-errors \
|
||||
--enable-headless-only \
|
||||
--enable-openjdk-only \
|
||||
--enable-unlimited-crypto \
|
||||
--openjdk-target=$(GNU_TARGET_NAME) \
|
||||
--with-boot-jdk=$(HOST_OPENJDK_BIN_ROOT_DIR) \
|
||||
--with-stdc++lib=dynamic \
|
||||
--with-debug-level=release \
|
||||
--with-devkit=$(HOST_DIR) \
|
||||
--with-extra-cflags="$(TARGET_CFLAGS)" \
|
||||
--with-extra-cxxflags="$(TARGET_CXXFLAGS)" \
|
||||
--with-extra-ldflags="-Wl,-rpath,$(OPENJDK_INSTALL_BASE)/lib,-rpath,$(OPENJDK_INSTALL_BASE)/lib/$(OPENJDK_JVM_VARIANT)" \
|
||||
--with-giflib=system \
|
||||
--with-jobs=$(PARALLEL_JOBS) \
|
||||
--with-jvm-variants=$(OPENJDK_JVM_VARIANT) \
|
||||
--with-lcms=system \
|
||||
--with-libjpeg=system \
|
||||
--with-libpng=system \
|
||||
--with-zlib=system \
|
||||
--with-native-debug-symbols=none \
|
||||
--without-version-pre \
|
||||
--with-sysroot=$(STAGING_DIR) \
|
||||
--with-version-build="$(OPENJDK_VERSION_MAJOR)" \
|
||||
--with-version-string="$(OPENJDK_VERSION_MAJOR)"
|
||||
|
||||
# If building for AArch64, use the provided CPU port.
|
||||
ifeq ($(BR2_aarch64),y)
|
||||
OPENJDK_CONF_OPTS += --with-abi-profile=aarch64
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_CCACHE),y)
|
||||
OPENJDK_CONF_OPTS += \
|
||||
--enable-ccache \
|
||||
--with-ccache-dir=$(BR2_CCACHE_DIR)
|
||||
endif
|
||||
|
||||
# Autogen and configure are performed in a single step.
|
||||
define OPENJDK_CONFIGURE_CMDS
|
||||
chmod +x $(@D)/configure
|
||||
cd $(@D); $(OPENJDK_CONF_ENV) ./configure autogen $(OPENJDK_CONF_OPTS)
|
||||
endef
|
||||
|
||||
# Make -jn is unsupported. Instead, set the "--with-jobs=" configure option,
|
||||
# and use $(MAKE1).
|
||||
define OPENJDK_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(OPENJDK_CONF_ENV) $(MAKE1) -C $(@D) $(OPENJDK_MAKE_TARGET)
|
||||
endef
|
||||
|
||||
# Calling make install always builds and installs the JDK instead of the JRE,
|
||||
# which makes manual installation necessary.
|
||||
define OPENJDK_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)
|
||||
cp -dpfr $(@D)/build/linux-*-release/images/$(OPENJDK_VARIANT)/* \
|
||||
$(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/
|
||||
cd $(TARGET_DIR)/usr/bin && ln -snf ../..$(OPENJDK_INSTALL_BASE)/bin/* .
|
||||
endef
|
||||
|
||||
define OPENJDK_INSTALL_STAGING_CMDS
|
||||
mkdir -p $(STAGING_DIR)/usr/include/jvm
|
||||
cp -dpfr $(@D)/build/linux-*-release/jdk/include/* \
|
||||
$(STAGING_DIR)/usr/include/jvm
|
||||
endef
|
||||
|
||||
# Demos and includes are not needed on the target
|
||||
ifeq ($(BR2_PACKAGE_OPENJDK_FULL_JDK),y)
|
||||
define OPENJDK_REMOVE_UNEEDED_JDK_DIRECTORIES
|
||||
$(RM) -r $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/include/
|
||||
$(RM) -r $(TARGET_DIR)$(OPENJDK_INSTALL_BASE)/demo/
|
||||
endef
|
||||
OPENJDK_TARGET_FINALIZE_HOOKS += OPENJDK_REMOVE_UNEEDED_JDK_DIRECTORIES
|
||||
endif
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user