#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk)) include /usr/share/dpkg/buildflags.mk endif unexport LANG export LC_ALL=C unexport LANGUAGE NULL := dh_version := $(shell dpkg-query -f '$${Version}\n' -W debhelper | sed -n 's/^\(.\).*/\1/p') # using brace expansion and substring replacements (${var:0:2}). SHELL = /bin/bash # use gnu time in verbose mode if available, otherwise default to the shell builtin ifneq (,$(wildcard /usr/bin/time)) TIME = /usr/bin/time -v else TIME = time endif vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) DPKG_VARS := $(shell dpkg-architecture) DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH) DEB_HOST_ARCH_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_CPU) DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) PATH := $(CURDIR)/bin:$(PATH) export PATH CHANGELOG_VARS := $(shell dpkg-parsechangelog | sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p') PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source) PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version) distribution := $(shell lsb_release --id --short) distrel := $(shell lsb_release --codename --short) derivative := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \ elif dpkg-vendor --derives-from Debian; then echo Debian; \ else echo Unknown; fi) ifeq ($(distrel),n/a) distrel := sid endif multiarch_dir = /$(DEB_HOST_MULTIARCH) hotspot_aarch32_archs = armhf hotspot_archs = amd64 arm64 i386 ppc64 ppc64el \ ${hotspot_aarch32_archs} jtreg_archs = ${hotspot_archs} alpha armel \ ia64 loong64 mips mipsel mips64 mips64el \ powerpc powerpcspe ppc64 ppc64el s390x sh4 sparc64 x32 # FIXME: use bootcycle builds for zero archs? bootcycle_build = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),yes) ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) bootcycle_build = endif # we know about: # wheezy jessie stretch buster bullseye bookworm trixie sid # precise trusty xenial bionic focal jammy (mantic) noble oracular ifneq (,$(filter $(distrel),wheezy precise trusty)) is_default = no else is_default = yes endif is_upstream_release = yes srcdir = src builddir = build zbuilddir = build-zero VENDOR = openjdk Vendor = OpenJDK TOP = usr/lib/jvm origin = openjdk basename = openjdk-$(shortver) ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) priority = $(if $(filter yes, $(is_default)),1081,1069) vm_name = Hotspot JIT else priority = $(if $(filter yes, $(is_default)),1074,1063) vm_name = Hotspot Zero endif jvmver = 1.8.0 shortver = 8 is_release = is_release = yes gh_project = jdk8u #gh_tag = jdk8u412-ga gh_tag = jdk8u432-b06 version_dash_buildnr = $(subst ${gh_project},,${gh_tag}) #version_dash_buildnr = 412-b08 # patched to get up to b05 (${UPSTREAM_PATCHES}) gh_tag_aarch32 = jdk8u432-b06-aarch32-20241016 package_version = $(subst jdk,,${gh_tag}) ifneq ($(is_release),yes) package_version := $(subst -,~,$(package_version)) endif # make sure to set version_dash_buildnr above manually if gh_tag is -ga updatever := $(firstword $(subst -, ,${version_dash_buildnr})) buildver := $(lastword $(subst -, ,${version_dash_buildnr})) ifneq (,$(DEB_HOST_MULTIARCH)) jdirname = java-$(shortver)-$(origin)-$(DEB_HOST_ARCH) jdiralias = java-$(jvmver)-$(origin)-$(DEB_HOST_ARCH) basedir = $(TOP)/$(jdirname) commonbasedir = $(TOP)/java-$(shortver)-$(origin)-common commonbasedir = $(basedir) etcdir = etc/java-$(shortver)-$(origin) else jdirname = java-$(shortver)-$(origin) jdiralias = java-$(jvmver)-$(origin) basedir = $(TOP)/$(jdirname) commonbasedir = $(TOP)/java-$(shortver)-$(origin) etcdir = etc/$(jdirname) endif security = $(etcdir)/security ifneq ($(bootcycle_build),yes) jreimg = images/j2re-image sdkimg = images/j2sdk-image build_target = images else jreimg = bootcycle-build/images/j2re-image sdkimg = bootcycle-build/images/j2sdk-image build_target = bootcycle-images endif # Support parallel= in DEB_BUILD_OPTIONS (see #209008) COMMA=, SPACE = $(EMPTY) $(EMPTY) ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif nocheck_profile = ${NULL} with_check = $(if $(findstring nocheck, $(DEB_BUILD_OPTIONS)),,yes) ifeq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) with_check = disabled running check for Zero arch $(DEB_HOST_ARCH) endif ifneq (,$(filter $(distrel),precise wheezy)) nocheck_profile = with_check = disabled running check on $(distrel) endif ifeq (,$(filter ${distrel},wheezy jessie stretch buster bullseye bookworm precise trusty xenial bionic focal jammy mantic noble oracular)) # Debian testing/sid ifneq (,$(filter ${DEB_HOST_ARCH},m68k sh4)) # xfwm4 B-D for testing not available with_check = disabled running check on ${distrel}/${DEB_HOST_ARCH} endif nocheck_profile = ${NULL} [!m68k !sh4] endif #with_check = disabled for this build with_docs = $(if $(findstring nodoc, $(DEB_BUILD_OPTIONS)),,yes) arch_map := alpha=alpha amd64=amd64 arm64=aarch64 arm=arm armel=arm armhf=arm hppa=parisc i386=i586 ia64=ia64 loong64=loongarch64 m68k=m68k mips=mips mipsel=mipsel mips64=mips64 mips64el=mips64el powerpc=ppc powerpcspe=ppc ppc64=ppc64 ppc64el=ppc64le s390x=s390x sh4=sh sparc64=sparcv9 sparc=sparc x32=x32 archdir_map := alpha=alpha amd64=amd64 arm64=aarch64 arm=arm armel=arm armhf=arm hppa=parisc i386=i386 ia64=ia64 loong64=loongarch64 m68k=m68k mips=mips mipsel=mipsel mips64=mips64 mips64el=mips64el powerpc=ppc powerpcspe=ppc ppc64=ppc64 ppc64el=ppc64le s390x=s390x sh4=sh sparc64=sparcv9 sparc=sparc x32=x32 jvmarch := $(strip $(patsubst $(DEB_HOST_ARCH_CPU)=%, %, \ $(filter $(DEB_HOST_ARCH_CPU)=%, $(arch_map)))) archdir := $(strip $(patsubst $(DEB_HOST_ARCH_CPU)=%, %, \ $(filter $(DEB_HOST_ARCH_CPU)=%, $(archdir_map)))) ifeq ($(DEB_HOST_ARCH),x32) jvmarch := x32 archdir := x32 endif default_vm = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),hotspot,zero) hotspot_version = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),default,zero) hotspot_version = default ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_aarch32_archs))) hotspot_version = aarch32 endif any_archs = alpha amd64 arm64 armel ${hotspot_aarch32_archs} i386 ia64 loong64 m68k mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sh4 sparc sparc64 x32 ifneq (,$(filter $(distrel),xenial)) transitional_jamvm_pkg = yes endif # Don't build zero alternate vm on Trusty ifeq (,$(filter $(distrel),trusty)) altzero_archs = $(filter-out sparc, $(hotspot_archs)) endif ifeq (,$(filter noaltzero, $(DEB_BUILD_OPTIONS))) ifneq (,$(filter $(DEB_HOST_ARCH), $(altzero_archs))) alternate_vms += zero zero_dir = zero endif endif BOOTJDK_HOME := $(strip $(subst /bin/javac,, $(firstword $(wildcard \ /usr/lib/jvm/java-8-openjdk-$(DEB_BUILD_ARCH)/bin/javac \ /usr/lib/jvm/java-7-openjdk-$(DEB_BUILD_ARCH)/bin/javac \ /usr/lib/jvm/java-7-openjdk/bin/javac \ )))) ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) BUILDJDK_HOME = $(CURDIR)/$(builddir)/$(sdkimg) else BUILDJDK_HOME = $(BOOTJDK_HOME) endif OPENJDK_VERSION = jdk$(shortver)u$(updatever)-$(buildver) # for Hotspot: hotspot/make/linux/makefiles/vm.make # Don't overwrite Hotspot opt level : # -O3 is already default option for hotspot # FIXME: ftbfs with -Werror=format-security dpkg_buildflags_hs = \ DEB_CFLAGS_MAINT_STRIP="-O2 -O3 -Werror=format-security" \ DEB_CXXFLAGS_MAINT_STRIP="-O2 -O3 -Werror=format-security" # jdk/make/CompileDemos.gmk (SetupJVMTIDemo) doesn't like commas in flags dpkg_buildflags_hs += \ DEB_LDFLAGS_MAINT_STRIP="-Wl,-z,relro -Wl,-Bsymbolic-functions" \ DEB_LDFLAGS_MAINT_APPEND="-Xlinker -z -Xlinker relro -Xlinker -Bsymbolic-functions -Xlinker --no-as-needed" dpkg_buildflags_hs += dpkg-buildflags export EXTRA_CPPFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CPPFLAGS) export EXTRA_CFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CFLAGS) $(shell $(dpkg_buildflags_hs) --get CPPFLAGS) export EXTRA_CXXFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get CXXFLAGS) export EXTRA_LDFLAGS_HS := $(shell $(dpkg_buildflags_hs) --get LDFLAGS) # for JDK: jdk/make/common/Defs.gmk # Don't overwrite JDK opt level : # 1) with forced -O3, it causes wrong Math.* computations, see #679292 and #678228 # 2) JDK already uses its own OPTIMIZATION_LEVEL variable for each module dpkg_buildflags_jdk = DEB_CFLAGS_MAINT_STRIP="-O2 -O3" DEB_CXXFLAGS_MAINT_STRIP="-O2 -O3" dpkg_buildflags_jdk += dpkg-buildflags export EXTRA_CPPFLAGS_JDK := $(shell $(dpkg_buildflags_jdk) --get CPPFLAGS) export EXTRA_CFLAGS_JDK := $(shell $(dpkg_buildflags_jdk) --get CFLAGS) $(shell $(dpkg_buildflags_jdk) --get CPPFLAGS) export EXTRA_CXXFLAGS_JDK := $(shell $(dpkg_buildflags_jdk) --get CXXFLAGS) export EXTRA_LDFLAGS_JDK := $(shell $(dpkg_buildflags_jdk) --get LDFLAGS) #for IcedTea ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) dpkg_buildflags_it += DEB_CFLAGS_MAINT_STRIP="-O2" DEB_CXXFLAGS_MAINT_STRIP="-O2" dpkg_buildflags_it += DEB_CFLAGS_MAINT_APPEND="-O3" DEB_CXXFLAGS_MAINT_APPEND="-O3" endif dpkg_buildflags_it += dpkg-buildflags export EXTRA_CPPFLAGS_IT := $(shell $(dpkg_buildflags_it) --get CPPFLAGS) export EXTRA_CFLAGS_IT := $(shell $(dpkg_buildflags_it) --get CFLAGS) export EXTRA_CXXFLAGS_IT := $(shell $(dpkg_buildflags_it) --get CXXFLAGS) export EXTRA_LDFLAGS_IT := $(shell $(dpkg_buildflags_it) --get LDFLAGS) ifneq (,$(filter $(distrel),precise)) gccver=4.6 else ifneq (,$(filter $(distrel),wheezy)) gccver=4.7 else ifneq (,$(filter $(distrel),trusty)) gccver=4.8 else ifneq (,$(filter $(distrel),jessie)) gccver=4.9 else ifneq (,$(filter $(distrel),xenial)) gccver=5 else ifneq (,$(filter $(distrel),stretch)) gccver=6 else ifneq (,$(filter $(distrel),bionic)) gccver=7 else ifneq (,$(filter $(distrel),buster)) gccver=8 else ifneq (,$(filter $(distrel),focal)) gccver=9 else ifneq (,$(filter $(distrel),bullseye)) gccver=10 else ifneq (,$(filter $(distrel),jammy)) gccver=11 else ifneq (,$(filter $(distrel),bookworm)) gccver=12 else gccver=13 endif bd_gcc = gcc-${gccver}, g++-${gccver}, ifneq (,$(shell command -v ${DEB_HOST_GNU_TYPE}-gcc-${gccver})) export CC=${DEB_HOST_GNU_TYPE}-gcc-${gccver} export CXX=${DEB_HOST_GNU_TYPE}-g++-${gccver} else export CC=gcc-${gccver} export CXX=g++-${gccver} endif ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf)) ifeq ($(derivative),Ubuntu) OPT_CFLAGS/cppInterpreter_arm.o = -march=armv6 -mtune=cortex-a8 -O2 -falign-functions=64 -falign-loops=8 -g0 else OPT_CFLAGS/cppInterpreter_arm.o = -O2 -falign-functions=32 -falign-loops=8 -g0 endif export OPT_CFLAGS/cppInterpreter_arm.o endif # mipsel has “Error: branch out of range” Assembler messages # mips64el does not yet, but may be affected, add here then ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) OPT_CFLAGS_DEFAULT=SIZE export OPT_CFLAGS_DEFAULT endif with_pulse = yes ifneq (,$(filter $(distrel),xenial)) # TCK tests still failing with_bridge = else with_bridge = atk endif ifeq (${derivative},Ubuntu) ifeq (${DEB_HOST_ARCH},i386) ifneq (,$(filter ${distrel},focal jammy mantic)) # libatk-wrapper-java-jni:i386 is missing in these releases with_bridge = m-a-fake endif endif endif with_nss = yes on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes) ifeq (,$(filter $(distrel),wheezy precise trusty)) ifeq (,$(filter $(DEB_HOST_ARCH),none)) with_systemtap = yes endif endif ifneq (,$(filter $(DEB_HOST_ARCH), sparc64)) USE_PRECOMPILED_HEADER = 0 export USE_PRECOMPILED_HEADER endif UPSTREAM_PATCHES = # nothing (filled below if needed) COMMON_PATCHES = \ autoconf-select.diff \ bootstrap-with-8.diff \ fix-encoding.diff \ catch-configure-errors.diff \ disable-werror.diff \ hotspot-set-compiler.diff \ ppc64el.diff \ system-libjpeg.diff \ system-libpng.diff \ system-lcms.diff \ system-pcsclite.diff \ link-with-as-needed.diff \ ld-symbolic-functions-default.diff \ hotspot-mips-align.diff \ hotspot-no-march-i586.diff \ icc_loading_with_symlink.diff \ icedtea-override-redirect-compiz.patch \ libpcsclite-dlopen.diff \ nonreparenting-wm.diff \ zero-fpu-control-is-noop.diff \ jexec.diff \ default-jvm-cfg-default.diff \ disable-doclint-by-default.diff \ pass-extra-flags.diff \ workaround_expand_exec_shield_cs_limit.diff \ zero-architectures.diff \ adlc-parser.patch \ multiple-pkcs11-library-init.patch \ applet-hole.patch \ libjpeg-fix.diff \ sparc-fixes.diff \ jdk-target-arch-define.diff \ m68k-support.diff \ javadoc-sort-enum-and-annotation-types.diff \ s390x-thread-stack-size.diff \ jdk-getAccessibleValue.diff \ compiler-flags.diff \ jdk-841269-filechooser.patch \ jdk-i18n-pt_BR.diff \ hotspot-ia64.diff \ dnd-files.patch \ zero-x32.diff \ sparc-inline-conflict.diff \ zero-sh.diff \ t64-dlsyms.diff \ jdk-8334502-time_t.diff \ ifeq ($(derivative),Debian) COMMON_PATCHES += \ hotspot-disable-exec-shield-workaround.patch endif ifneq (,$(filter ${with_bridge},atk m-a-fake)) COMMON_PATCHES += atk-wrapper-security.patch ifeq (${with_bridge},m-a-fake) COMMON_PATCHES += do-not-throw-when-assistive-technology-not-found.patch endif else ifneq (,$(with_bridge)) COMMON_PATCHES += java-access-bridge-security.patch endif ifeq ($(with_pulse),yes) COMMON_PATCHES += \ jdk-pulseaudio.diff endif # set LIBARCH/aarch32 to arm ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_aarch32_archs))) COMMON_PATCHES += \ aarch32.diff endif DEFAULT_PATCHES = \ ${UPSTREAM_PATCHES} \ $(COMMON_PATCHES) \ hotspot-libpath-$(hotspot_version).diff CONFIGURE_ARGS = # there are problems --with-alt-jar=/usr/bin/fastjar, # see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=217 # only use it for zero ports except powerpc (which we assume as # fast enough to build. ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) ia64 powerpc powerpcspe ppc64 ppc64el)) CONFIGURE_ARGS += --with-alt-jar=/usr/bin/fastjar endif ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf)) CONFIGURE_ARGS += \ --disable-arm32-jit endif ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) CONFIGURE_ARGS += --enable-zero endif EXTRA_BUILD_ENV += MAKE_VERBOSE=y QUIETLY= LOG=debug # timestamp skew on kFreeBSD EXTRA_BUILD_ENV += IGNORE_OLD_CONFIG=true EXTRA_BUILD_ENV += LIBFFI_LIBS=-lffi_pic # http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-March/026450.html # plus needs explicit --disable-debug-symbols EXTRA_BUILD_ENV += \ DEBUG_BINARIES=true \ FULL_DEBUG_SYMBOLS=0 \ ZIP_DEBUGINFO_FILES=0 \ STRIP_POLICY=none \ POST_STRIP_CMD=true ifeq ($(with_pulse),yes) CONFIGURE_ARGS += --enable-pulse-java endif CONFIGURE_ARGS += --enable-system-kerberos ifeq ($(with_nss),yes) CONFIGURE_ARGS += --enable-nss else ifeq ($(with_nss),no) CONFIGURE_ARGS += --disable-nss endif ifeq ($(with_systemtap),yes) CONFIGURE_ARGS += --enable-systemtap --with-abs-install-dir=/$(basedir) endif COMMON_CONFIGURE_ARGS = DEFAULT_CONFIGURE_ARGS = ZERO_CONFIGURE_ARGS = # FIXME: --with-jvm-variants=server,zero not supported upstream ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_aarch32_archs))) DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=client else DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=server endif else DEFAULT_CONFIGURE_ARGS += --with-jvm-variants=zero endif ZERO_CONFIGURE_ARGS += --with-jvm-variants=zero DEFAULT_CONFIGURE_ARGS += --with-boot-jdk=$(BOOTJDK_HOME) ZERO_CONFIGURE_ARGS += --with-boot-jdk=$(BUILDJDK_HOME) COMMON_CONFIGURE_ARGS += --disable-ccache # FIXME: zero not ready for --disable-precompiled-headers #COMMON_CONFIGURE_ARGS += --disable-precompiled-headers ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) ifneq (,$(filter $(distrel),trusty)) DEFAULT_CONFIGURE_ARGS += --disable-precompiled-headers endif endif ifeq ($(with_check),yes) COMMON_CONFIGURE_ARGS += --with-jtreg endif COMMON_CONFIGURE_ARGS += \ --with-milestone='$(if $(filter yes, $(is_upstream_release)),fcs,ea)' \ --with-user-release-suffix='$(PKGVERSION)' \ --with-update-version=$(updatever) \ --with-build-number=$(buildver) # --with-debug-level=fastdebug \ ifeq ($(distribution),Debian) ifeq (,$(filter $(distrel),wheezy jessie stretch buster)) COMMON_CONFIGURE_ARGS += \ --with-vendor-name='$(distribution)' endif else ifeq ($(distribution),Ubuntu) v_pkgrel := $(shell echo $(PKGVERSION) | sed 's/^.*-//') ppa_build := $(shell if echo 'v_pkgrel' | egrep '^[0-9]+(ubuntu[0-9]+)?(~[0-9.]+)?$$'; then echo no; else echo yes; fi) ifeq ($(ppa_build),yes) COMMON_CONFIGURE_ARGS += \ --with-vendor-name='Private Build' else ifeq (,$(filter $(distrel),precise trusty xenial bionic)) COMMON_CONFIGURE_ARGS += \ --with-vendor-name='$(distribution)' endif endif else COMMON_CONFIGURE_ARGS += \ --with-vendor-name='$(distribution)' endif COMMON_CONFIGURE_ARGS += \ --with-debug-level=release \ --disable-debug-symbols \ --disable-zip-debug-info \ --enable-unlimited-crypto \ --with-zlib=system \ --with-giflib=system \ --with-libpng=system \ --with-libjpeg=system \ --with-lcms=system \ --with-libpcsclite=system \ #ifneq (,$(filter $(distrel),precise trusty)) # when building with a not-shipped gcc-8 only # COMMON_CONFIGURE_ARGS += \ # --with-stdc++lib=static #else COMMON_CONFIGURE_ARGS += \ --with-stdc++lib=dynamic #endif ifneq (,$(NJOBS)) COMMON_CONFIGURE_ARGS += --with-num-cores=$(NJOBS) endif # FIXME: upstream says the extra flags are not designed for general purpose ... # http://mail.openjdk.java.net/pipermail/jdk8u-dev/2014-July/001389.html # FIXME: demos fail to build with these ... # FIXME: zero ftbfs without -fpermissive #src/cpu/zero/vm/cppInterpreter_zero.cpp:732:30: error: invalid conversion from 'intptr_t {aka long int}' to 'const void*' [-fpermissive] # object = (oop) locals[0]; # ^ #COMMON_CONFIGURE_ARGS += \ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ --with-extra-cxxflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CXXFLAGS_HS)' \ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) DEFAULT_CONFIGURE_ARGS += \ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' else DEFAULT_CONFIGURE_ARGS += \ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ --with-extra-cxxflags='-fpermissive' \ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' endif ZERO_CONFIGURE_ARGS += \ --with-extra-cflags='$(EXTRA_CPPFLAGS_HS) $(EXTRA_CFLAGS_HS)' \ --with-extra-cxxflags='-fpermissive' \ --with-extra-ldflags='$(EXTRA_LDFLAGS_HS)' ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) COMMON_CONFIGURE_ARGS += \ --build=$(DEB_BUILD_GNU_TYPE) \ --host=$(DEB_HOST_GNU_TYPE) \ --target=$(DEB_HOST_GNU_TYPE) \ BUILD_CC=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CC)) \ BUILD_LD=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CC)) \ BUILD_CXX=$(subst $(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(CXX)) \ endif # (most) jre and jdk tools handled by the alternatives system. # dups in heimdal-clients, krb5-user: kinit, klist, ktab, no alternatives # use javaws from icedtea-netx all_jre_tools = $(filter-out javaws, $(notdir $(wildcard $(builddir)/$(jreimg)/bin/*))) jre_tools = $(filter policytool, $(all_jre_tools)) jre_hl_tools := $(filter-out $(jre_tools), $(all_jre_tools)) corba_tools = orbd servertool tnameserv jre_hl_tools_alt= $(filter-out $(corba_tools), $(jre_hl_tools)) $(corba_tools) jre_tools_alt = $(filter-out kinit klist ktab, $(jre_tools)) all_jdk_tools = $(filter-out javaws, $(notdir $(wildcard build/$(sdkimg)/bin/*))) jdk_tools = appletviewer jconsole jdk_tools_alt = $(jdk_tools) jdk_hl_tools = $(filter-out $(all_jre_tools) $(jdk_tools), $(all_jdk_tools)) jdk_hl_tools_alt= $(filter-out apt java-rmi.cgi, $(jdk_hl_tools)) # build dependencies ifneq (,$(filter $(distrel),precise)) bd_autotools = autoconf2.69, automake, export AUTOCONF=autoconf2.69 else bd_autotools = autoconf (>= 2.69), automake, endif ifneq (,$(filter ${distrel},wheezy jessie stretch buster bullseye precise trusty xenial bionic focal jammy)) bd_autotools += pkg-config, else bd_autotools += pkgconf, endif # for the testsuite bd_check = \ xvfb@nocheck@, xauth@nocheck@, xfonts-base@nocheck@, \ libgl1-mesa-dri@nocheck@, xfwm4@nocheck@, \ x11-xkb-utils@nocheck@, dbus-x11@nocheck@, dtc_check = # at least 4.2 b13 is now required bd_check += jtreg (>> 4.2-b13-1~)@nocheck@, dtc_check += jtreg (>> 4.2-b13-1~), ifeq (,$(filter $(distrel),wheezy jessie stretch precise trusty xenial)) bd_check += libasmtools-java@nocheck@, dtc_check += libasmtools-java, endif bd_check += testng@nocheck@, dtc_check += testng, ifeq (1,1) # avoid default-jre being pulled in bd_bootstrap += openjdk-8-jdk, else ifeq (1,1) bd_bootstrap += openjdk-8-jdk-headless, else bd_bootstrap += openjdk-8-jdk-headless | openjdk-8-jdk | openjdk-7-jdk, ifeq (,$(filter ${distrel},wheezy jessie precise trusty)) bd_cross += openjdk-8-jdk-headless , endif bd_check += openjdk-8-jre-headless@nocheck@ | default-jre-headless (>= 2:1.8)@nocheck@, endif ifeq (,$(filter ${distrel},wheezy jessie precise trusty)) bd_cross += dpkg-dev (>= 1.17.14), endif # elide B-D if known to not test ifneq ($(with_check),yes) bd_check = endif ifneq (,$(filter $(distrel),wheezy jessie stretch precise trusty xenial)) old_debhelper = veryold bd_debhelper = debhelper (>= 9), dh_compat = 9 # implicit in 10+ bd_autotools += autotools-dev, else old_debhelper = no bd_debhelper = debhelper (>= 11), dh_compat = 10 endif bd_syslibs = zlib1g-dev, libattr1-dev, ifneq (,$(filter $(distrel),wheezy jessie precise trusty xenial)) bd_syslibs += libpng12-dev, else bd_syslibs += libpng-dev, endif ifeq ($(derivative),Ubuntu) # precise+ libjpeg-dev → libjpeg8-dev → libjpeg-turbo8-dev # libjpeg8 → libjpeg-turbo8 bd_syslibs += libjpeg-dev, else ifneq (,$(filter $(distrel),wheezy)) bd_syslibs += libjpeg8-dev, else # jessie+ libjpeg-dev → libjpeg62-turbo-dev bd_syslibs += libjpeg-dev, endif bd_syslibs += \ libgif-dev, bd_openjdk = \ libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, \ libasound2-dev, liblcms2-dev, \ libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, ifneq (,$(filter $(distrel),wheezy jessie stretch buster precise trusty xenial bionic)) bd_openjdk += libfreetype6-dev (>= 2.2.1), else bd_openjdk += libfreetype-dev, endif #ifneq (,$(filter $(distrel),wheezy xenial artful)) bd_openjdk += libgtk2.0-dev, #else # bd_openjdk += libgtk-3-dev, #endif pkg_ffidev = libffi-dev bd_zero = \ $(pkg_ffidev) [$(foreach a,$(hotspot_archs),!$(a))], bd_zero = \ $(pkg_ffidev), bd_ant = ant, ant-optional, bd_fastjar = fastjar (>= 2:0.96-0ubuntu2), ifeq ($(with_pulse),yes) bd_pulsejava = libpulse-dev (>= 0.9.12), endif ifeq ($(with_nss),yes) bd_nss = libnss3-dev (>= 2:3.26), endif ifeq (,$(filter $(distrel),wheezy precise trusty)) bd_systemtap = systemtap-sdt-dev, endif dlopen_hl_depends = ifeq (,$(filter ${distrel},wheezy jessie stretch buster bullseye bookworm precise trusty xenial bionic focal jammy mantic)) dlopen_hl_depends += libcups2t64, bd_syslibs += libcups2t64, else dlopen_hl_depends += libcups2, bd_syslibs += libcups2, endif dlopen_hl_depends += liblcms2-2, # see above (libjpeg-dev) ifeq ($(derivative),Ubuntu) dlopen_hl_depends += libjpeg-turbo8, else ifneq (,$(filter $(distrel),wheezy)) dlopen_hl_depends += libjpeg8, else dlopen_hl_depends += libjpeg62-turbo, endif # FIXME: #793210, directly link with libfontconfig. dlopen_hl_depends += libfontconfig1, ifneq ($(with_nss),no) dlopen_hl_depends += libnss3 (>= 2:3.26), endif dlopen_hl_recommends = dlopen_jre_depends = ifeq (,$(filter ${distrel},wheezy jessie stretch buster bullseye bookworm precise trusty xenial bionic focal jammy mantic)) dlopen_jre_depends += libglib2.0-0t64, bd_syslibs += libglib2.0-0t64, else dlopen_jre_depends += libglib2.0-0 (>= 2.24), bd_syslibs += libglib2.0-0 (>= 2.24), endif dlopen_jre_depends += libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1, ifeq (,$(filter ${distrel},wheezy jessie stretch buster bullseye bookworm precise trusty xenial bionic focal jammy mantic)) dlopen_jre_depends += libgtk2.0-0t64, bd_syslibs += libgtk2.0-0t64, else dlopen_jre_depends += libgtk2.0-0 (>= 2.14), bd_syslibs += libgtk2.0-0 (>= 2.14), #dlopen_jre_depends += libgtk-3-0, endif dlopen_jre_recommends = # .desktop files need to be multiarch installable java_launcher = /$(basedir)/bin/java java_launcher = /usr/bin/java ifeq ($(derivative),Ubuntu) java_launcher = cautious-launcher %f /$(basedir)/bin/java java_launcher = cautious-launcher %f /usr/bin/java endif ifneq (,$(filter $(distrel),wheezy precise)) core_fonts = ttf-dejavu-extra else core_fonts = fonts-dejavu-extra endif cjk_fonts = fonts-nanum, cjk_fonts += fonts-ipafont-gothic, fonts-ipafont-mincho, cjk_fonts += fonts-wqy-microhei, fonts-wqy-zenhei, ifneq (,$(filter $(distrel),precise trusty)) cjk_fonts += ttf-indic-fonts, else cjk_fonts += fonts-indic, endif p_jre = $(basename)-jre p_jrehl = $(basename)-jre-headless p_jrej = $(basename)-jre-jamvm p_jrez = $(basename)-jre-zero p_jdkhl = $(basename)-jdk-headless p_jdk = $(basename)-jdk p_demo = $(basename)-demo p_src = $(basename)-source p_doc = $(basename)-doc p_dbg = $(basename)-dbg d = debian/tmp d_jre = debian/$(p_jre) d_jrehl = debian/$(p_jrehl) d_jrej = debian/$(p_jrej) d_jrez = debian/$(p_jrez) d_jdkhl = debian/$(p_jdkhl) d_jdk = debian/$(p_jdk) d_demo = debian/$(p_demo) d_src = debian/$(p_src) d_doc = debian/$(p_doc) d_dbg = debian/$(p_dbg) control_vars = \ '-Vvm:Name=$(vm_name)' \ '-Vdlopenhl:Depends=$(dlopen_hl_depends)' \ '-Vdlopenhl:Recommends=$(dlopen_hl_recommends)' \ '-Vdlopenjre:Depends=$(dlopen_jre_depends)' \ '-Vdlopenjre:Recommends=$(dlopen_jre_recommends)' \ '-Vxulrunner:Depends=$(xulrunner_depends)' \ ifeq ($(with_bridge),atk) ifneq (,$(filter $(distrel),wheezy jessie precise trusty xenial)) control_vars += '-Vdep:bridge=libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2)' else control_vars += '-Vdep:bridge=libatk-wrapper-java-jni (>= 0.33.3-9~)' endif else ifeq (${with_bridge},m-a-fake) control_vars += '-Vdep:bridge=' else ifneq (,$(with_bridge)) control_vars += '-Vdep:bridge=libaccess-bridge-java-jni (>= 1.26.2-6)' endif ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs))) control_vars += '-Vdefaultvm:Provides=$(p_jre)-zero' endif pkg_certs = ca-certificates-java control_vars += '-Vcacert:Depends=$(pkg_certs)' bd_tzdata = tzdata, ifneq (,$(filter $(distrel),wheezy jessie precise trusty)) control_vars += '-Vmountpoint:Depends=initscripts' else control_vars += '-Vmountpoint:Depends=util-linux (>= 2.26.2-4)' endif # JRE Headless "Breaks:" control_vars += '-Vjrehl:Breaks=$(jrehl_breaks)' jrehl_breaks = # break on ca-certificates-java except for trusty (LP: #1706567) ifeq (,$(filter $(distrel),precise trusty)) jrehl_breaks += ca-certificates-java (<< 20160321~), endif # break on tzdata-java for stretch, see #857992 # required when upgrading from jessie to stretch ifneq (,$(filter $(distrel),stretch xenial)) jrehl_breaks += tzdata-java endif pkg_jcommon = java-common (>= 0.28) control_vars += '-Vjcommon:Depends=$(pkg_jcommon)' debian/control: debian/control.in debian/rules @cp -p debian/tests/control debian/tests/control.old @cp -p debian/control debian/control.old echo $(dh_compat) >debian/compat sed \ -e 's/@dtc_check@/$(strip $(dtc_check))/g' \ debian/tests/control.in >debian/tests/control sed \ -e 's/@basename@/$(basename)/g' \ -e 's/@bd_autotools@/$(bd_autotools)/g' \ -e 's/@bd_bootstrap@/$(strip $(bd_bootstrap))/g' \ -e 's/@bd_check@/$(strip $(bd_check))/g' \ -e 's/@bd_cross@/$(strip $(bd_cross))/g' \ -e 's/@bd_debhelper@/$(strip $(bd_debhelper))/g' \ -e 's/@bd_openjdk@/$(bd_openjdk)/g' \ -e 's/@bd_zero@/$(bd_zero)/g' \ -e 's/@bd_gcc@/$(bd_gcc)/g' \ -e 's/@bd_syslibs@/$(bd_syslibs)/g' \ -e 's/@bd_fastjar@/$(bd_fastjar)/g' \ -e 's/@bd_pulsejava@/$(bd_pulsejava)/g' \ -e 's/@bd_nss@/$(bd_nss)/g' \ -e 's/@bd_systemtap@/$(bd_systemtap)/g' \ -e 's/@bd_ant@/$(bd_ant)/g' \ -e 's/@bd_tzdata@/$(bd_tzdata)/g' \ -e 's/@core_fonts@/$(core_fonts)/g' \ -e 's/@cjk_fonts@/$(cjk_fonts)/g' \ -e 's/@any_archs@/$(any_archs)/g' \ -e 's/@hotspot_archs@/$(hotspot_archs)/g' \ -e 's/@altzero_archs@/$(strip $(altzero_archs))/g' \ -e 's/@nocheck@/$(nocheck_profile)/g' \ debian/control.in \ $(if $(transitional_jamvm_pkg), debian/control.jamvm-trans) \ $(if $(altzero_archs), debian/control.zero-jre) \ $(if $(DEB_HOST_MULTIARCH),,| grep -v '^Multi-Arch') \ > debian/control @if cmp -s debian/control debian/control.old && \ cmp -s debian/tests/control debian/tests/control.old; then \ rm -f debian/tests/control.old debian/control.old; \ else \ echo; echo === BEGIN DIFF ===; echo; \ diff -u debian/tests/control.old debian/tests/control | wdiff -d -; \ diff -u debian/control.old debian/control | wdiff -d -; \ echo "debian/control did change, please restart the build"; \ rm -f debian/tests/control.old debian/control.old; \ exit 1; \ fi debian/tests/%.sh: debian/tests/%.in debian/rules sed \ -e 's,@JDK_DIR@,/$(basedir),g' \ -e 's/@jtreg_archs@/$(jtreg_archs)/g' \ -e 's:@doc_dir@:/usr/share/doc/$(p_jrehl)/:g' \ $< > $@; chmod +x $@ gen-autopkgtests: debian/tests/jtdiff-autopkgtest.sh debian/tests/jtreg-autopkgtest.sh echo $(hotspot_archs) > debian/tests/hotspot-archs packaging-files: for f in debian/*.in debian/patches/*.in; do \ case "$$f" in debian/control.in) continue; esac; \ f2=$$(echo $$f | sed 's/JB/$(basename)/;s/\.in$$//'); \ sed -e 's/@JRE@/$(p_jre)/g' \ -e 's/@JDK@/$(p_jdk)/g' \ -e 's/@vendor@/$(Vendor)/g' \ -e 's/@RELEASE@/$(shortver)/g' \ -e 's/@basename@/$(basename)/g' \ -e 's,@TOP@,$(TOP),g' \ -e 's,@basedir@,$(basedir),g' \ -e 's,@etcdir@,$(etcdir),g' \ -e 's,@jdiralias@,$(jdiralias),g' \ -e 's,@jdirname@,$(jdirname),g' \ -e 's/@srcname@/$(srcname)/g' \ -e 's/@jvmarch@/$(jvmarch)/g' \ -e 's/@archdir@/$(archdir)/g' \ -e 's/@tag@/$(tag)/g' \ -e 's/@priority@/$(priority)/g' \ -e 's/@is_default@/$(is_default)/g' \ -e 's/@mantag@/$(mantag)/g' \ -e 's/@multiarch@/$(DEB_HOST_MULTIARCH)/g' \ -e 's/@jre_hl_tools@/$(jre_hl_tools_alt)/g' \ -e 's/@jre_tools@/$(jre_tools_alt)/g' \ -e 's/@jdk_hl_tools@/$(jdk_hl_tools_alt)/g' \ -e 's/@jdk_tools@/$(jdk_tools_alt)/g' \ -e 's/@corba_tools@/$(corba_tools)/g' \ -e 's,@j2se_lib@,$(j2se_lib),g' \ -e 's,@j2se_share@,$(j2se_share),g' \ -e 's,@java_launcher@,$(java_launcher),g' \ -e 's/@cjk_fonts@/$(cjk_fonts)/g' \ $$f > $$f2; \ done ifneq (,$(filter $(DEB_HOST_ARCH), i386)) # not yet in OpenJDK # cat debian/$(p_jre)-i586.menu >> $(d_jre).menu rm -f debian/$(p_jre)-i586.menu endif configure: stamps/configure stamps/configure: stamps/patch -cat /etc/hosts -cat /proc/cpuinfo mkdir -p bin ifeq (,$(filter $(DEB_HOST_ARCH), alpha amd64 arm64 ia64 loong64 mips64 mips64el ppc64 ppc64el s390x sparc64 x32)) ( \ echo '#! /bin/sh'; \ echo 'if [ -x /usr/bin/linux32 ]; then'; \ echo ' exec /usr/bin/linux32 /bin/uname "$$@"'; \ echo 'else'; \ echo ' exec /bin/uname "$$@"'; \ echo 'fi'; \ ) > bin/uname chmod +x bin/uname endif echo "UNAME checks" uname -a /bin/uname -a lsb_release -a -cat /proc/sys/kernel/random/entropy_avail mkdir -p stamps mkdir -p $(builddir) cd ${srcdir}/common/autoconf/build-aux && \ rm -f autoconf-config.* config.guess config.sub && \ cp /usr/share/misc/config.guess /usr/share/misc/config.sub . cd $(srcdir) && sh common/autoconf/autogen.sh cd $(builddir) && $(EXTRA_BUILD_ENV) sh ../$(srcdir)/configure \ ${DEFAULT_CONFIGURE_ARGS} ${COMMON_CONFIGURE_ARGS} || { \ tail -v -n +0 config.log || :; \ echo >&2 'E: configure for $@ failed'; \ exit 1; \ } touch $@ stamps/zero-configure: stamps/build stamps/patch mkdir -p stamps mkdir -p $(zbuilddir) cd $(zbuilddir) && $(EXTRA_BUILD_ENV) sh ../$(srcdir)/configure \ ${ZERO_CONFIGURE_ARGS} ${COMMON_CONFIGURE_ARGS} || { \ tail -v -n +0 config.log || :; \ echo >&2 'E: configure for $@ failed'; \ exit 1; \ } touch $@ stamps/sound-configure: stamps/build rm -rf icedtea-sound tar xf icedtea-sound.tar.xz mv $$(tar tf icedtea-sound.tar.xz | head -1 | sed 's,/.*,,') \ icedtea-sound patch -p1 < debian/patches/icedtea-sound.diff cd icedtea-sound && \ rm -f config.guess config.sub configure && \ cp /usr/share/misc/config.guess /usr/share/misc/config.sub . cd icedtea-sound && autoreconf -f -i -v cd icedtea-sound && sh configure \ --build=$(DEB_BUILD_GNU_TYPE) \ --host=$(DEB_HOST_GNU_TYPE) \ --disable-maintainer-mode \ --with-jdk-home=$(BUILDJDK_HOME) \ CPPFLAGS="$(EXTRA_CPPFLAGS_IT)" \ CFLAGS="$(EXTRA_CFLAGS_IT)" \ CXXFLAGS="$(EXTRA_CXXFLAGS_IT)" \ LDFLAGS="$(EXTRA_LDFLAGS_IT)" || { \ tail -v -n +0 config.log || :; \ echo >&2 'E: configure for $@ failed'; \ exit 1; \ } touch $@ stamps/sound-build: stamps/sound-configure $(MAKE) -C icedtea-sound touch $@ unpack: stamps/unpack stamps/unpack: rm -rf $(srcdir) mkdir -p $(srcdir) tar -xf root.tar.xz --strip-components=1 -C $(srcdir) for tb in corba jaxp jaxws langtools hotspot jdk nashorn; do \ tar -C $(srcdir) -x -f $$tb.tar.xz; \ done # FIXME: do the zero build from the hotspot.tar.gz ifneq (,$(filter $(DEB_HOST_ARCH),$(hotspot_aarch32_archs))) rm -rf $(srcdir)/hotspot tar -C $(srcdir) -x -f hotspot-aarch32.tar.xz mv $(srcdir)/$$(tar tf hotspot-aarch32.tar.xz | head -1 | sed 's,/.*,,') \ $(srcdir)/hotspot endif $(MAKE) -f debian/rules packaging-files cp /usr/share/misc/config.* $(srcdir)/common/autoconf/build-aux/. mkdir -p stamps touch $@ patch: stamps/patch stamps/series: stamps/unpack printf '%s\n' ${DEFAULT_PATCHES} >${srcdir}/series @:>$@ stamps/patch: stamps/series cd $(srcdir) && \ QUILT_PATCHES=../debian/patches quilt --quiltrc - push -a ( \ echo ""; echo "Patches applied in this version:"; \ for i in $$(egrep -v '^#|^ *$$' $(srcdir)/series); do \ echo ""; echo "$$i:"; \ sed -n -E 's/^(# *DP|Description): */ /p' debian/patches/$$i; \ done \ ) > stamps/pxx mv stamps/pxx $@ ifeq ($(with_check),yes) ifneq (,$(filter $(DEB_HOST_ARCH), $(jtreg_archs))) with_jtreg_check = $(default_vm) endif ifneq (,$(filter zero, $(alternate_vms))) ifneq (,$(filter $(DEB_HOST_ARCH), arm64 amd64 i386)) # only activate after testing; hangs several tests. with_jtreg_check += zero endif endif endif build_stamps = \ stamps/build \ $(if $(filter $(DEB_HOST_ARCH),$(altzero_archs)),stamps/zero-build) ifeq ($(with_pulse),yes) build_stamps += stamps/sound-build endif build_stamps += stamps/jtreg-check-default ifeq (0,1) build_stamps += stamps/jtreg-check-default build_stamps += $(if $(filter zero, $(alternate_vms)),stamps/jtreg-check-zero) endif pre-build: ifneq (,$(filter $(DEB_HOST_ARCH),s390)) @echo explicitely fail the build for $(DEB_HOST_ARCH), patches not updated false endif build-arch: build build-indep: build stamps/build-docs build: pre-build $(build_stamps) if [ -f buildwatch.pid ]; then \ pid=$$(cat buildwatch.pid); \ kill -1 $$pid || :; sleep 10; kill -9 $$pid || :; \ fi rm -f buildwatch.pid stamps/build: stamps/configure ifneq (,$(filter $(DEB_HOST_ARCH), alpha armel armhf ia64 loong64 m68k mips mipsel mips64 mips64el powerpc powerpcspe s390x sh4 sparc sparc64)) sh -c 'sh debian/buildwatch.sh $(CURDIR)/$(builddir) &' endif if $(EXTRA_BUILD_ENV) $(MAKE) -C $(builddir) $(build_target); then \ : ; \ else \ if [ -f buildwatch.pid ]; then \ pid=$$(cat buildwatch.pid); \ kill -1 $$pid || :; sleep 10; kill -9 $$pid || :; \ find $(builddir) -type f -name 'hs_err_pid*.log' -print -exec cat -tn {} \;; \ fi; \ false; \ fi touch $@ stamps/zero-build: stamps/zero-configure : # FIXME: build using the just built jdk, and build the vm only $(EXTRA_BUILD_ENV) $(MAKE) -C $(zbuilddir) images rm -rf $(builddir)/$(sdkimg)/jre/lib/$(archdir)/zero cp -a $(zbuilddir)/$(subst bootcycle-build/,,$(sdkimg))/jre/lib/$(archdir)/server \ $(builddir)/$(sdkimg)/jre/lib/$(archdir)/zero touch $@ stamps/build-docs: stamps/build $(MAKE) -C $(builddir) docs touch $@ stamps/jtreg-check-default: stamps/build $(MAKE) -f debian/rules jtreg-run-check VMNAME=$(default_vm) VMARGS= \ $(if $(filter $(default_vm),hotspot),TEST_SUITES='hotspot langtools jdk',TEST_SUITES='hotspot langtools') touch $@ stamps/jtreg-check-zero: stamps/build $(MAKE) -f debian/rules jtreg-run-check VMNAME=zero VMARGS='-vmoption:-zero' \ TEST_SUITES='hotspot langtools' touch $@ jtreg-run-check: mkdir -p jtreg-test-output ifneq (,$(filter $(VMNAME), $(with_jtreg_check))) if [ ! -f $(builddir)/$(sdkimg)/jre/lib/security/java.security.install ]; then \ fgrep -v 'sun.security.pkcs11' $(builddir)/$(sdkimg)/jre/lib/security/java.security \ > $(builddir)/$(sdkimg)/jre/lib/security/java.security.test; \ mv $(builddir)/$(sdkimg)/jre/lib/security/java.security \ $(builddir)/$(sdkimg)/jre/lib/security/java.security.install; \ mv $(builddir)/$(sdkimg)/jre/lib/security/java.security.test \ $(builddir)/$(sdkimg)/jre/lib/security/java.security; \ fi @echo "BEGIN jtreg" ( \ if jtreg -version; then \ echo >&2 "I: jtreg works with default settings"; \ elif JT_JAVA=${BOOTJDK_HOME} jtreg -version; then \ echo >&2 "I: using bootstrap JRE for jtreg"; \ JT_JAVA=${BOOTJDK_HOME}; \ export JT_JAVA; \ elif JT_JAVA=/usr jtreg -version; then \ echo >&2 "I: using system JRE for jtreg"; \ JT_JAVA=/usr; \ export JT_JAVA; \ else \ echo >&2 "E: jtreg does not work?!"; \ fi; \ $(TIME) $(MAKE) -f debian/rules -k jtregcheck \ $(if $(TEST_SUITES),TEST_SUITES="$(TEST_SUITES)") \ JTREG_OPTIONS='$(VMARGS)' \ ) 2>&1 | tee jtreg-test-output/jtreg_output-$(VMNAME) @echo "END jtreg" if [ -f $(builddir)/$(sdkimg)/jre/lib/security/java.security.install ]; then \ mv $(builddir)/$(sdkimg)/jre/lib/security/java.security.install \ $(builddir)/$(sdkimg)/jre/lib/security/java.security; \ fi for i in check-hotspot.log check-jdk.log check-langtools.log jtreg-summary.log; do \ if [ -f jtreg-test-output/$$i ]; then \ mv jtreg-test-output/$$i jtreg-test-output/$${i%*.log}-$(VMNAME).log; \ else \ mkdir -p jtreg-test-output; \ fi; \ done @echo "BEGIN jtreg-summary-$(VMNAME)" -cat jtreg-test-output/jtreg-summary-$(VMNAME).log @echo "END jtreg-summary-$(VMNAME)" -for i in hotspot langtools jdk; do \ find jtreg-test-output/$$i/JTwork/ -name '*.jtr'; \ done > jtreg-test-output/failed_tests-$(VMNAME).list tar --ignore-failed-read -C . -cf - \ -T jtreg-test-output/failed_tests-$(VMNAME).list | \ gzip -n9 >jtreg-test-output/failed_tests-$(VMNAME).tar.gz tar -C . -cf - $$(find jtreg-test-output -name JTreport) | \ gzip -n9 >jtreg-test-output/jtreport-$(VMNAME).tar.gz else echo "jtreg harness not run for this build" > jtreg-test-output/jtreg_output-$(VMNAME) endif # ---------------------------------------------------------------------------- # jtreg targets taken from IcedTea TESTS_TO_RUN = $(addprefix check-,$(TEST_SUITES)) check-hotspot: stamps/build mkdir -p jtreg-test-output/hotspot JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ $(TIME) debian/tests/hotspot | tee jtreg-test-output/$@.log check-langtools: stamps/build mkdir -p jtreg-test-output/langtools JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ $(TIME) debian/tests/langtools | tee jtreg-test-output/$@.log check-jdk: stamps/build mkdir -p jtreg-test-output/jdk JTREG_OPTIONS=$(JTREG_OPTIONS) VMNAME=$(VMNAME) JDK_TO_TEST=$(builddir)/$(sdkimg) \ AUTOPKGTEST_TMP=/tmp/ AUTOPKGTEST_ARTIFACTS=jtreg-test-output/ \ $(TIME) debian/tests/jdk | tee jtreg-test-output/$@.log jtregcheck: $(TESTS_TO_RUN) for i in $(TEST_SUITES); do \ echo "--------------- jtreg console summary for $$i ---------------"; \ egrep -v '^(Passed:|Directory|Re[a-z]+\ written\ to)' jtreg-test-output/check-$$i.log; \ done | tee jtreg-test-output/jtreg-summary.log # ---------------------------------------------------------------------------- clean: debian-clean dh_testdir dh_testroot rm -rf $(srcdir) rm -rf stamps build build-* test jtreg-test-output rm -rf icedtea-sound rm -rf autom4te.cache rm -rf bin rm -f buildwatch.pid dh_clean debian-clean: dh_testdir dh_testroot dh_prep || dh_clean -k for f in debian/*.in debian/patches/*.in; do \ f2=$$(echo $$f | sed 's/JB/$(basename)/;s/\.in$$//'); \ case "$$f2" in debian/control) continue; esac; \ rm -f $$f2; \ done rm -f debian/*.install debian/*.links debian/*.debhelper.log lib_ext_dirs = common $(sort $(foreach arch,$(arch_map),$(firstword $(subst =,$(SPACE),$(arch))))) ifeq ($(derivative),Ubuntu) lib_ext_dirs := $(filter-out arm hppa m68k mips% powerpcspe s390% sh%, $(lib_ext_dirs)) else lib_ext_dirs := $(filter-out arm hppa, $(lib_ext_dirs)) endif install: packaging-files dh_testdir dh_testroot dh_prep || dh_clean -k rm -f debian/*.install debian/*.links dh_installdirs : # install into temporary location mkdir -p $(d)/$(basedir) cp -a $(builddir)/$(sdkimg)/* $(d)/$(basedir)/ # FIXME: still needed? # cp -a build/$(jreimg)/man $(d)/$(basedir)/jre/ ifeq ($(with_pulse),yes) cp icedtea-sound/icedtea-sound.jar $(d)/$(basedir)/jre/lib/ext/. cp icedtea-sound/build/native/libicedtea-sound.so \ $(d)/$(basedir)/jre/lib/$(archdir)/. endif chmod -R u+w $(d) : # use javaws from icedtea-netx find $(d) -name 'javaws*' | xargs -r rm -f : # install default jvm config file ifeq (,$(filter $(DEB_HOST_ARCH),$(hotspot_aarch32_archs))) cp debian/jvm.cfg-default $(d)/$(basedir)/jre/lib/$(archdir)/ else cp debian/jvm.cfg-client_default $(d)/$(basedir)/jre/lib/$(archdir)/jvm.cfg-default endif : # compress manpages find $(d)/$(basedir)/man $(d)/$(basedir)/jre/man -type f ! -type l \ | xargs gzip -9v -n : # copy man pages into the jre/man directory mkdir -p $(d)/$(basedir)/jre/man/man1 mkdir -p $(d)/$(basedir)/jre/man/ja_JP.UTF-8/man1 for i in $(d)/$(basedir)/jre/bin/*; do \ b=$$(basename $$i); \ cp -p $(d)/$(basedir)/man/man1/$$b.1.gz $(d)/$(basedir)/jre/man/man1/.; \ cp -p $(d)/$(basedir)/man/ja_JP.UTF-8/man1/$$b.1.gz $(d)/$(basedir)/jre/man/ja_JP.UTF-8/man1/.; \ done cp -a $(d)/$(basedir)/man/ja $(d)/$(basedir)/jre/man/. : # replace common files in jdk and jre by symlinks @cd $(d)/$(basedir); \ for i in `find jre -type f`; do \ i2=$${i#jre/*}; \ if [ -f $$i2 ]; then \ if cmp -s $$i $$i2; then \ : ; \ else \ echo "XXX: differing files"; \ md5sum $$i $$i2; \ fi; \ else \ continue; \ fi; \ d=$$(echo ./$$i2 | sed -r 's,[^/]+/,../,g;s,/[^/]+$$,,;s,\.\.$$,,'); \ echo " symlink $$i2 -> $$d$$i"; \ ln -sf $$d$$i $$i2; \ done mkdir -p $(d)/$(etcdir)/security mkdir -p $(d)/$(etcdir)/management mkdir -p $(d)/$(etcdir)/images/cursors : # rename templates (comments only) to config files, : # and move to /$(etcdir) for i in \ management/jmxremote.password \ management/snmp.acl; \ do \ mv $(d)/$(basedir)/jre/lib/$$i.template $(d)/$(etcdir)/$$i; \ done ifneq (,$(filter ${with_bridge},atk m-a-fake)) ifneq (,$(filter $(distrel),wheezy jessie precise trusty xenial bionic focal jammy)) cp -p debian/accessibility-atk.properties.disabled \ $(d)/$(basedir)/jre/lib/accessibility.properties else cp -p debian/accessibility-atk.properties.enabled \ $(d)/$(basedir)/jre/lib/accessibility.properties endif else ifneq (,$(with_bridge)) cp -p debian/accessibility.properties $(d)/$(basedir)/jre/lib/ endif cp -p debian/swing.properties $(d)/$(basedir)/jre/lib/ ifneq (,$(pkg_certs)) rm -f $(d)/$(basedir)/jre/lib/security/cacerts endif : # FIXME: merge nss changes from IcedTea cp debian/nss.cfg $(d)/$(basedir)/jre/lib/security/nss.cfg : # move config files to $(etcdir) and symlink them. for i in \ $(if $(with_bridge),accessibility.properties) \ calendars.properties \ content-types.properties \ images/cursors/cursors.properties \ logging.properties \ sound.properties \ flavormap.properties \ net.properties \ psfontj2d.properties \ psfont.properties.ja \ swing.properties \ tz.properties \ management/jmxremote.access \ management/management.properties \ security/java.policy \ security/java.security \ $$([ -f $(d)/$(basedir)/jre/lib/security/nss.cfg ] && echo security/nss.cfg) \ $(if $(findstring ca-cert,$(pkg_certs)),,security/cacerts) \ security/blacklisted.certs; \ do \ mv $(d)/$(basedir)/jre/lib/$$i $(d)/$(etcdir)/$$i; \ done mv $(d)/$(basedir)/jre/lib/$(archdir)/jvm.cfg \ $(d)/$(etcdir)/ ifneq (,$(filter zero,$(alternate_vms))) # a zero alternate vm was build printf -- '-zero KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg else ifeq (,$(filter $(DEB_HOST_ARCH),$(hotspot_archs))) # not a hotspot arch, so alias zero to server printf -- '-zero ALIASED_TO -server\n' >> $(d)/$(etcdir)/jvm.cfg endif : # FIXME: avian working with 8? : # printf -- '-avian KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg printf -- '-dcevm KNOWN\n' >> $(d)/$(etcdir)/jvm.cfg ifeq (0,1) # FIXME: XXX mv $(d)/$(basedir)/jre/lib/fontconfig.Ubuntu.properties.src \ $(d)/$(etcdir)/fontconfig.properties endif : # remove files which we do not want to distribute rm -f $(d)/$(basedir)/jre/lib/fontconfig*.properties.src rm -f $(d)/$(basedir)/jre/lib/fontconfig*.bfc rm -f $(d)/$(basedir)/jre/lib/$(archdir)/*/classes.jsa : # remove empty directories rmdir $(d)/$(basedir)/jre/lib/management rmdir $(d)/$(basedir)/jre/lib/applet # rmdir $(d)/$(basedir)/jre/lib/security : # FIXME: fix, move and install tapset files rm -rf $(d)/$(basedir)/tapset : # now move things to the packages. it is so ****** to create : # .install files first. dh_movefiles did do the job perfectly : # $(p_jrehl).install / $(p_jre).install ( \ echo 'etc'; \ echo '$(basedir)/jre/lib/jexec'; \ echo '$(basedir)/jre/lib/rt.jar'; \ echo '$(basedir)/jre/lib/security/policy'; \ echo '$(basedir)/jre/man/ja'; \ echo '$(basedir)/man/ja'; \ echo '$(basedir)/bin/java-rmi.cgi'; \ ) > debian/$(p_jrehl).install ifneq (,$(DEB_HOST_MULTIARCH)) ( \ echo '$(basedir)/jre/lib/meta-index'; \ echo '$(basedir)/jre/lib/ext/meta-index'; \ ) >> debian/$(p_jrehl).install endif ifeq ($(derivative),Ubuntu) ( \ echo 'usr/share/apport/package-hooks'; \ ) >> debian/$(p_jrehl).install endif $(RM) debian/$(p_jre).install cd $(CURDIR)/$(d); \ for i in $(basedir)/jre/{bin,man/man1,man/ja_JP.UTF-8/man1}/*; do \ case "$$i" in \ */policytool*) echo $$i >> ../$(p_jre).install;; \ *) echo $$i >> ../$(p_jrehl).install; \ esac; \ done cd $(CURDIR)/$(d); \ for i in $(basedir)/{bin,man/man1,man/ja_JP.UTF-8/man1}/*; do \ [ -h $$i ] || continue; \ case "$$i" in \ */policytool*) echo $$i >> ../$(p_jre).install;; \ *) echo $$i >> ../$(p_jrehl).install; \ esac; \ done; \ cd $(CURDIR)/$(d); \ for i in $(basedir)/jre/lib/$(archdir)/*; do \ case "$$i" in \ */libjavagtk.so|*/libsplashscreen.so|*/libjsoundalsa.so|$(if $(with_pulse),*/libicedtea-sound.so|)*/xawt) echo $$i >> ../$(p_jre).install;; \ */zero) echo $$i >> ../$(p_jrez).install;; \ *) echo $$i >> ../$(p_jrehl).install; \ esac; \ done : # $(p_jrehl).install ( \ echo '$(basedir)/jre/ASSEMBLY_EXCEPTION $(commonbasedir)/jre/'; \ echo '$(basedir)/jre/THIRD_PARTY_README $(commonbasedir)/jre/'; \ cd $(d); \ for i in $(basedir)/jre/lib/*; do \ case "$$i" in \ */$(archdir)|*/jexec|*/rt.jar|*/security$(if $(DEB_HOST_MULTIARCH),|*/meta-index)) \ continue; \ esac; \ echo $$i $(commonbasedir)/jre/lib/; \ done; \ ) >> debian/$(p_jrehl).install : # $(p_jdkhl).install ( \ cd $(d); \ for i in $(basedir)/include/*.h; do \ case $$i in */jawt.h) continue; esac; \ [ -h $$i ] && continue; \ echo $$i; \ done; \ echo '$(basedir)/include/*/jni_md.h'; \ echo '$(basedir)/lib/jexec'; \ echo '$(basedir)/LICENSE'; \ echo '$(basedir)/ASSEMBLY_EXCEPTION'; \ echo '$(basedir)/THIRD_PARTY_README'; \ for i in $(basedir)/lib/*; do \ case $$i in */jconsole.jar) continue; esac; \ [ -h $$i ] && continue; \ echo $$i; \ done; \ for i in $(basedir)/{bin,man/man1,man/ja_JP.UTF-8/man1}/*; do \ case $$i in */appletviewer*|*/jconsole*) continue; esac; \ [ -h $$i -o "$$i" = $(basedir)/bin/java-rmi.cgi ] && continue; \ echo $$i; \ done; \ ) > debian/$(p_jdkhl).install : # $(p_jdk).install ( \ cd $(d); \ for i in $(basedir)/include/*.h; do \ case $$i in */jawt.h) : ;; *) continue; esac; \ [ -h $$i ] && continue; \ echo $$i; \ done; \ echo '$(basedir)/include/*/jawt_md.h'; \ for i in $(basedir)/lib/*; do \ case $$i in */jconsole.jar) : ;; *) continue; esac; \ [ -h $$i ] && continue; \ echo $$i; \ done; \ for i in $(basedir)/{bin,man/man1,man/ja_JP.UTF-8/man1}/*; do \ case $$i in */appletviewer*|*/jconsole*) : ;; *) continue; esac; \ [ -h $$i -o "$$i" = $(basedir)/bin/java-rmi.cgi ] && continue; \ echo $$i; \ done; \ ) > debian/$(p_jdk).install : # $(p_src).install ( \ echo '$(basedir)/src.zip $(TOP)/$(basename)/'; \ ) > debian/$(p_src).install : # copy apport hook ifeq ($(derivative),Ubuntu) mkdir -p $(d)/usr/share/apport/package-hooks/ cp debian/apport-hook.py $(d)/usr/share/apport/package-hooks/source_openjdk-8.py endif : # move demos and samples, create symlinks for $(p_demo) mkdir -p $(d)/usr/share/doc/$(p_jrehl)/demo for i in $(d)/$(basedir)/demo/*; do \ b=$$(basename $$i); \ case "$$i" in \ */jvmti) \ echo $(basedir)/demo/$$b usr/share/doc/$(p_jrehl)/demo/$$b >> $(d_demo).links;; \ *) \ mv $$i $(d)/usr/share/doc/$(p_jrehl)/demo/$$b; \ echo usr/share/doc/$(p_jrehl)/demo/$$b $(basedir)/demo/$$b >> $(d_demo).links;; \ esac; \ done mv $(d)/$(basedir)/sample $(d)/usr/share/doc/$(p_jrehl)/examples echo usr/share/doc/$(p_jrehl)/examples $(basedir)/sample >> $(d_demo).links echo usr/share/doc/$(p_jre) usr/share/doc/$(p_demo) >> $(d_demo).links : # $(p_demo).install ( \ echo '$(basedir)/demo'; \ echo 'usr/share/doc/$(p_jrehl)/examples'; \ echo 'usr/share/doc/$(p_jrehl)/demo'; \ ) > debian/$(p_demo).install : # $(p_dbg).install ifneq (,$(wildcard $(d)/$(basedir)/jre/lib/$(archdir)/*.diz)) ( \ echo '$(basedir)/jre/lib/$(archdir)/*.diz'; \ echo '$(basedir)/jre/lib/$(archdir)/*/*.diz'; \ ) > debian/$(p_dbg).install endif ifneq (,$(wildcard $(d)/$(basedir)/jre/lib/$(archdir)/*.debuginfo)) ( \ echo '$(basedir)/jre/lib/$(archdir)/*.debuginfo'; \ echo '$(basedir)/jre/lib/$(archdir)/*/*.debuginfo'; \ ) > debian/$(p_dbg).install endif ifneq (,$(findstring old, $(old_debhelper))) dh_install --sourcedir=debian/tmp --fail-missing -XLICENSE -Xrelease else dh_install --sourcedir=debian/tmp -XLICENSE -Xrelease dh_missing --sourcedir=debian/tmp --fail-missing -XLICENSE -Xrelease endif find $(d_jrehl) $(d_jre) $(d_jrez) $(d_jrej) -type f \ \( -name '*.debuginfo' -o -name '*.diz' \) -print | xargs -r rm -f ifneq (,$(DEB_HOST_MULTIARCH)) rm -f $(d_jrehl)/$(commonbasedir)/jre/lib/ext/meta-index endif : # give all permissions to cross-VM extension directory sed -i \ -e '/permission java\.security\.AllPermission;/,/};/c\' \ -e ' permission java.security.AllPermission;\' \ -e '};\' \ -e '\' \ $(if $(DEB_HOST_MULTIARCH),$(foreach i, $(lib_ext_dirs), \ -e 'grant codeBase "file:/$(TOP)/java-$(shortver)-$(origin)-$(i)/jre/lib/ext/*" {\' \ -e ' permission java.security.AllPermission;\' \ -e '};\')) \ -e '\' \ -e '// Comment this out if you want to give all permissions to the\' \ -e '// Debian Java repository too:\' \ -e '//grant codeBase "file:/usr/share/java/repository/-" {\' \ -e '// permission java.security.AllPermission;\' \ -e '//};\' \ -e '' \ $(d_jrehl)/$(security)/java.policy # 'make Emacs Makefile mode happy dh_installdirs -p$(p_jrehl) \ usr/share/doc/$(p_jrehl) dh_installdirs -p$(p_jre) \ usr/share/applications \ usr/share/application-registry \ usr/share/mime-info \ usr/share/pixmaps : # add GNOME stuff cp -p debian/$(basename)-policytool.desktop \ $(d_jre)/usr/share/applications/ ifneq (,$(findstring cautious-launcher, $(java_launcher))) cp -p debian/$(basename)-java.desktop \ $(d_jre)/usr/share/applications/ endif for i in archive; do \ cp debian/$(basename)-$$i.applications \ $(d_jre)/usr/share/application-registry/; \ cp debian/$(basename)-$$i.keys $(d_jre)/usr/share/mime-info/; \ cp debian/$(basename)-$$i.mime $(d_jre)/usr/share/mime-info/; \ done cp -p debian/sun_java.xpm \ $(d_jre)/usr/share/pixmaps/$(basename).xpm mkdir -p $(d_demo)/usr/share/pixmaps cp -p debian/sun_java_app.xpm \ $(d_demo)/usr/share/pixmaps/$(basename)-app.xpm : # install icons for i in 16 24 32 48; do \ install -D -m 644 -p src/jdk/src/solaris/classes/sun/awt/X11/java-icon$${i}.png \ $(d_jre)/usr/share/icons/hicolor/$${i}x$${i}/apps/$(basename).png; \ done : # create docdir symlinks for $(p_jrehl) ( \ echo usr/share/doc/$(p_jrehl) $(basedir)/docs; \ ) > $(d_jrehl).links ifneq (,$(DEB_HOST_MULTIARCH)) echo '/$(basedir) /usr/lib/jvm/$(jdirname)' >> $(d_jrehl).links endif : # create docdir symlinks for $(p_jre) ( \ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jre); \ ) > $(d_jre).links ifneq (,$(filter zero, $(alternate_vms))) : # create docdir symlinks for $(p_jrez) ( \ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jrez); \ ) > $(d_jrez).links endif : # create docdir symlinks for $(p_src) ( \ echo usr/share/doc/$(p_jre) usr/share/doc/$(p_src); \ ) > $(d_src).links : # create docdir symlinks for $(p_jdkhl) ( \ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_jdkhl); \ ) > $(d_jdkhl).links : # create docdir symlinks for $(p_jdk) ( \ echo usr/share/doc/$(p_jre) usr/share/doc/$(p_jdk); \ ) > $(d_jdk).links # doesn't work, no package dependency ifneq (,$(DEB_HOST_MULTIARCH)) echo '$(TOP)/$(basename)/src.zip $(basedir)/src.zip' >> $(d_jdkhl).links endif : # create docdir symlinks for $(p_dbg) ( \ echo usr/share/doc/$(p_jrehl) usr/share/doc/$(p_dbg); \ ) > $(d_dbg).links ifneq (,$(filter ${with_bridge},atk m-a-fake)) : # create links for the atk wrapper echo "usr/share/java/java-atk-wrapper.jar $(basedir)/jre/lib/ext/java-atk-wrapper.jar" \ >> $(d_jre).links echo "usr/lib$(multiarch_dir)/jni/libatk-wrapper.so $(basedir)/jre/lib/ext/libatk-wrapper.so" \ >> $(d_jre).links else ifneq (,$(with_bridge)) : # create links for the gnome accessibility bridge echo "usr/share/java/gnome-java-bridge.jar $(basedir)/jre/lib/ext/gnome-java-bridge.jar" \ >> $(d_jre).links echo "usr/lib$(multiarch_dir)/jni/libjava-access-bridge-jni.so $(basedir)/jre/lib/ext/libjava-access-bridge-jni.so" \ >> $(d_jre).links endif : # create links for the config files find $(d_jrehl)/$(etcdir) -type f ! -name jvm.cfg \ -printf "$(etcdir)/%P $(basedir)/jre/lib/%P\n" >> $(d_jrehl).links ifneq (,$(DEB_HOST_MULTIARCH)) mv $(d_jrehl)/$(etcdir)/jvm.cfg \ $(d_jrehl)/$(etcdir)/jvm-$(DEB_HOST_ARCH).cfg ( \ echo "$(etcdir)/jvm-$(DEB_HOST_ARCH).cfg $(basedir)/jre/lib/$(archdir)/jvm.cfg"; \ ) >> $(d_jrehl).links else ( \ echo "$(etcdir)/jvm.cfg $(basedir)/jre/lib/$(archdir)/jvm.cfg"; \ ) >> $(d_jrehl).links endif ifneq (,$(pkg_certs)) echo "etc/ssl/certs/java/cacerts $(basedir)/jre/lib/security/cacerts" \ >> $(d_jrehl).links endif @echo JRE_HL_TOOLS: $(jre_hl_tools_alt) jexec @echo JRE_TOOLS: $(jre_tools_alt) @echo JDK_HL_TOOLS: $(jdk_hl_tools_alt) @echo JDK_TOOLS: $(jdk_tools_alt) ( \ echo 'name=$(jdirname)'; \ echo 'alias=$(jdiralias)'; \ echo 'priority=$(priority)'; \ echo 'section=main'; \ echo ''; \ for i in $(jre_hl_tools_alt); do \ echo "hl $$i /$(basedir)/jre/bin/$$i"; \ done; \ for i in $(jre_tools_alt); do \ echo "jre $$i /$(basedir)/jre/bin/$$i"; \ done; \ for i in $(jdk_hl_tools_alt); do \ echo "jdkhl $$i /$(basedir)/bin/$$i"; \ done; \ for i in $(jdk_tools_alt); do \ echo "jdk $$i /$(basedir)/bin/$$i"; \ done; \ ) > $(d_jrehl)/$(TOP)/.$(jdiralias).jinfo : # another jvm symlink ln -sf $(jdirname) $(d_jrehl)/usr/lib/jvm/$(jdiralias) mkdir -p $(d_jrehl)/usr/lib/debug/usr/lib/jvm ln -sf $(jdirname) $(d_jrehl)/usr/lib/debug/usr/lib/jvm/$(jdiralias) ifeq ($(with_systemtap),yes FIXME) : # systemtap support mkdir -p $(d_jrehl)/usr/share/systemtap/tapset cp -p build/tapset/hotspot.stp $(d_jrehl)/usr/share/systemtap/tapset/ endif : # OpenJDK Stack Unwinder and Frame Decorator ifneq (,$(filter $(DEB_HOST_ARCH),amd64)) mkdir -p $(d_jrehl)/usr/share/gdb/auto-load/$(basedir)/jre/lib/$(archdir)/server cp debian/dbg8.py \ $(d_jrehl)/usr/share/gdb/auto-load/$(basedir)/jre/lib/$(archdir)/server/libjvm.so-gdb.py ifneq (,$(filter zero, $(alternate_vms))) mkdir -p $(d_jrez)/usr/share/gdb/auto-load/$(basedir)/jre/lib/$(archdir)/zero ln -sf ../server/libjvm.so-gdb.py \ $(d_jrez)/usr/share/gdb/auto-load/$(basedir)/jre/lib/$(archdir)/zero/libjvm.so endif endif ifeq (0,1) : # Install stuff to generate font config and timezone files. mkdir -p $(d_jrehl)/$(commonbasedir)/jre/lib # FIXME: not built in 8 cp -p build/openjdk.build/btjars/compilefontconfig.jar \ $(d_jrehl)/$(commonbasedir)/jre/lib/ cp -p build/openjdk.build/btjars/javazic.jar \ $(d_jrehl)/$(commonbasedir)/jre/lib/ endif : # install lintian overrides for FILE in debian/*.overrides; do \ PKG=`basename $$FILE .overrides`; \ install -D -m644 $$FILE debian/$$PKG/usr/share/lintian/overrides/$$PKG; \ done nodocs = $(if $(findstring nodoc, $(DEB_BUILD_OPTIONS)),-N$(p_doc)) nojrez = $(if $(filter zero, $(alternate_vms)),,-N$(p_jrez)) # Build architecture independant packages binary-indep: build stamps/build-docs install dh_testdir dh_testroot ifeq ($(with_docs),yes) dh_installchangelogs -p$(p_doc) dh_installdocs -p$(p_doc) mkdir -p $(d_doc)/usr/share/doc/$(p_jrehl) for i in $(builddir)/docs/*; do \ [ -e $$i ] || continue; \ b=$$(basename $$i); \ cp -a $$i $(d_doc)/usr/share/doc/$(p_jrehl)/; \ ln -sf ../$(p_jrehl)/$$b $(d_doc)/usr/share/doc/$(p_doc)/$$b; \ done endif # FIXME: desktop and menu files not ready for multiarch. #658321 ifeq (,$(DEB_HOST_MULTIARCH)) dh_installmenu -i $(nodocs) endif -dh_icons -i $(nodocs) || dh_iconcache -i $(nodocs) # dh_installdebconf -i $(nodocs) dh_link -i $(nodocs) dh_compress -i $(nodocs) -Xexamples -Xdemo -Xpackage-list dh_fixperms -i $(nodocs) dh_installdeb -i $(nodocs) dh_gencontrol -i $(nodocs) -- $(control_vars) dh_md5sums -i $(nodocs) dh_builddeb -i $(nodocs) $(bd_options) absarchdir = $(CURDIR)/$(d_jrehl)/$(basedir)/jre/lib/$(archdir) shlibdeps_ld_path =$(absarchdir):$(absarchdir)/client:$(absarchdir)/server:$(absarchdir)/native_threads$(if $(xulrunner_depends),:$(shell pkg-config --libs-only-L libxul | sed 's/^-L//;s/-devel//;s,/lib *$$,,')) # pass vm name as first argument define install_test_results mkdir -p $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH) -cp jtreg_output-$(1) \ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/jtreg_output-$(1).log -cp jtreg-test-output/jtreg-summary-$(1).log jtreg-test-output/check-*-$(1).log \ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/ -cp jtreg-test-output/failed_tests-$(1).tar.gz \ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/failed_tests-$(1).tar.gz -cp jtreg-test-output/jtreport-$(1).tar.gz \ $(d_jdk)/usr/share/doc/$(p_jrehl)/test-$(DEB_HOST_ARCH)/jtreport-$(1).tar.gz endef # Build architecture dependant packages binary-arch: build install dh_testdir dh_testroot dh_installchangelogs -p$(p_jrehl) dh_installdocs -p$(p_jrehl) \ debian/JAVA_HOME \ debian/README.alternatives \ debian/README.Debian ifeq (0,1) # FIXME: IcedTea specific bits for i in AUTHORS NEWS README; do \ cp -p $$i $(d_jrehl)/usr/share/doc/$(p_jrehl)/$$i.IcedTea; \ done endif $(call install_test_results,$(default_vm)) ifeq ($(transitional_jamvm_pkg),yes) dh_installchangelogs -p$(p_jrej) dh_installdocs -p$(p_jrej) endif ifneq (,$(filter zero, $(alternate_vms))) $(call install_test_results,zero) endif # FIXME: desktop and menu files not ready for multiarch. #658321 ifeq (,$(DEB_HOST_MULTIARCH)) dh_installmenu -s $(nodemo) $(nojrez) endif -dh_icons -s $(nodemo) $(nojrez) \ || dh_iconcache -s $(nodemo) $(nojrez) # dh_installdebconf -s $(nodemo) $(nojrez) dh_link -s $(nodemo) $(nojrez) $(if $(filter $(dh_version), 5 6 7 8),NADA=,DH_COMPAT=9) dh_strip -s \ $(nodemo) $(nojrez) \ -Xlibjvm.so -X.debuginfo --dbg-package=$(p_dbg) ifeq (,$(findstring nostrip, $(DEB_BUILD_OPTIONS))) set -ex; \ for i in {$(d_jrehl),$(d_jre),$(d_jrez)}/$(basedir)/jre/lib/$(archdir)/*/libjvm.so; do \ [ -f $$i ] || continue; \ b_id=$$(LC_ALL=C readelf -n $$i | sed -n 's/ *Build ID: *\([0-9a-f][0-9a-f]*\)/\1/p'); \ if [ -z "$$b_id" ]; then \ id=$$(echo $$i | sed -r 's,debian/[^/]+,$(d_dbg)/usr/lib/debug,'); \ echo strip $$i; \ mkdir -p $$(dirname $$id); \ objcopy --only-keep-debug $$i $$id; \ chmod 644 $$id; \ strip --remove-section=.comment --remove-section=.note \ --strip-debug $$i; \ objcopy --add-gnu-debuglink $$id $$i; \ else \ d=usr/lib/debug/.build-id/$${b_id:0:2}; \ f=$${b_id:2}.debug; \ mkdir -p $(d_dbg)/$$d; \ objcopy --only-keep-debug --compress-debug-sections $$i $(d_dbg)/$$d/$$f; \ chmod 644 $(d_dbg)/$$d/$$f; \ strip --remove-section=.comment --remove-section=.note $$i; \ fi; \ done endif dh_compress -a $(nodemo) $(nojrez) -Xexamples -Xdemo -Xpackage-list dh_fixperms -a $(nodemo) $(nojrez) dh_makeshlibs -p$(p_jrehl) -p$(p_jre) dh_shlibdeps -a $(nodemo) $(nojrez) -L $(p_jrehl) \ -l$(shlibdeps_ld_path) \ -- dh_installdeb -a $(nodemo) $(nojrez) dh_gencontrol -a $(nodemo) $(nojrez) \ -- $(control_vars) dh_md5sums -a $(nodemo) $(nojrez) ifeq (0,1) : # FIXME: something seems to hang here ... -ps afx endif NO_PKG_MANGLE=1 \ dh_builddeb -a $(nodemo) $(nojrez) #$(bd_options) gh_url = https://github.com/openjdk/${gh_project}/archive/refs/tags/${gh_tag}.tar.gz gh_project_aarch32 = aarch32-port-jdk8u gh_url_aarch32 = https://github.com/openjdk/${gh_project_aarch32}/archive/refs/tags/${gh_tag_aarch32}.tar.gz gh_tag_api = https://api.github.com/repos/openjdk/${gh_project}/git/ref/tags/${gh_tag} gh_tag_api_aarch32 = https://api.github.com/repos/openjdk/${gh_project_aarch32}/git/ref/tags/${gh_tag_aarch32} origdir_b = openjdk-8-${package_version}.orig orig_tarball_b = openjdk-8_${package_version}.orig.tar origdir = ../${origdir_b} do_fetch = test -s ${origdir}/$(1) || \ if wget -O ${origdir}/$(1)~ $(2); then \ mv ${origdir}/$(1)~ ${origdir}/$(1); \ else \ echo >&2 E: fetching $(1) failed; \ exit 1; \ fi fetch-orig: mkdir -p $(origdir) $(call do_fetch,ti-any-1,${gh_tag_api}) : check API result; \ case $$(jq -r '.object | [.type, .url] | join("!")' \ <${origdir}/ti-any-1) in \ ('tag!https://'*|'commit!https://'*) : ok ;; \ (*) exit 1 ;; esac $(call do_fetch,ti-any-2,"$$(jq -r .object.url <${origdir}/ti-any-1)") : check API result; \ ts=$$(jq -r '.tagger.date // .committer.date' <${origdir}/ti-any-2); \ case $$ts in \ (20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z) \ : ok; echo $$ts >${origdir}/ts-any ;; \ (*) exit 1 ;; esac $(call do_fetch,jdk-any.tar.gz,${gh_url}) ifneq (,$(hotspot_aarch32_archs)) $(call do_fetch,ti-aarch32-1,${gh_tag_api_aarch32}) : check API result; \ case $$(jq -r '.object | [.type, .url] | join("!")' \ <${origdir}/ti-aarch32-1) in \ ('tag!https://'*|'commit!https://'*) : ok ;; \ (*) exit 1 ;; esac $(call do_fetch,ti-aarch32-2,"$$(jq -r .object.url <${origdir}/ti-aarch32-1)") : check API result; \ ts=$$(jq -r '.tagger.date // .committer.date' <${origdir}/ti-aarch32-2); \ case $$ts in \ (20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z) \ : ok; echo $$ts >${origdir}/ts-aarch32 ;; \ (*) exit 1 ;; esac $(call do_fetch,jdk-aarch32.tar.gz,${gh_url_aarch32}) endif $(call do_fetch,icedtea-sound.tar.xz, \ http://icedtea.classpath.org/download/source/icedtea-sound-1.0.1.tar.xz) # checksum generated after PGP validation of manual download cd $(origdir) && \ echo '6ff852b82ae7db7a95981271037eb3a3d52c59581e3b27a638a7c6bc8eecb4a3 *icedtea-sound.tar.xz' | \ sha256sum -c : ls -l $(origdir) hotspot_variants := ifneq (,$(hotspot_aarch32_archs)) hotspot_variants += aarch32 endif munge-orig: set -e; cd ${origdir}; rm -rf xjdk-*; set -x; for x in jdk-*; do \ mkdir -p x"$$x"; \ tar -xzf "$$x" --strip-components=1 -C x"$$x"; \ find x"$$x" -type d -print0 | xargs -0 chmod 755; \ done cd ${origdir}/xjdk-any.tar.gz && tar -czf ../hotspot.tar.gz hotspot set -ex; cd ${origdir}; for extra in ${hotspot_variants}; do \ cd xjdk-$$extra.tar.gz; \ tar -czf ../hotspot-$$extra.tar.gz hotspot; \ cd ..; \ done rm -r ${origdir}/xjdk-*/hotspot ifneq (,$(hotspot_aarch32_archs)) # known deltas unnecessary to diff every time cd ${origdir}/xjdk-aarch32.tar.gz && rm -f \ cross-pkg-config cross_configure.sh cross_make.sh endif wd=$$(pwd) && cd ${origdir} && for extra in ${hotspot_variants}; do \ diff -pruN -x '.hgtags*' -x config.sub \ -x generated-configure.sh \ xjdk-any.tar.gz xjdk-$$extra.tar.gz \ >"$$wd/variant-$$extra.diff"; \ test $$? -lt 2 || exit 1; \ done set -ex; cd ${origdir}/xjdk-any.tar.gz; for dir in corba jaxp jaxws \ jdk langtools nashorn; do \ tar -czf ../$$dir.tar.gz $$dir; \ rm -r $$dir; \ done cd ${origdir} && tar -czf root.tar.gz xjdk-any.tar.gz && rm -r xjdk-* rm ${origdir}/jdk-* : ls -l ${origdir} : "make sure these diffs contain nothing relevant:" ls -l variant-*.diff : "also DO NOT commit *or* upload them!" dfsg-orig: : # remove JSON license from THIRD_PARTY_README; no files shipped set -ex; \ for repo in \ jdk hotspot $(if ${hotspot_aarch32_archs}, hotspot-aarch32) \ nashorn jaxp jaxws langtools corba root; do \ case $$repo in \ (*aarch32*) tsname=ts-aarch32 ;; \ (*) tsname=ts-any ;; \ esac; \ test -f ${origdir}/$$repo.tar.gz || continue; \ mkdir -p $$repo; \ tar -xzf ${origdir}/$$repo.tar.gz --strip-components=1 -C $$repo; \ find $$repo -type d -print0 | xargs -0 chmod 755; \ find $$repo -maxdepth 2 -name THIRD_PARTY_README; \ for f in $$(find $$repo -maxdepth 2 -name THIRD_PARTY_README); do \ awk '/^%% This notice is provided with respect to JSON/ { skip=1 } skip == 0 {print} /^----------/ { skip = 0} ' $$f >$$f.new; \ diff -u $$f $$f.new || true; \ mv $$f.new $$f; \ done; \ case $$repo in \ (jdk) \ rm -v -rf $$repo/src/share/native/java/util/zip/zlib*; \ find $$repo/src/share/native/sun/awt/image/jpeg \ ! -name imageioJPEG.c ! -name jpegdecoder.c ! -name jinclude.h \ -type f -print -delete; \ rm -v -rf $$repo/src/share/native/sun/awt/giflib; \ rm -v -rf $$repo/src/share/native/sun/awt/libpng; \ rm -v -f $$repo/src/share/native/sun/java2d/cmm/lcms/cms*.c; \ rm -v -f $$repo/src/share/native/sun/java2d/cmm/lcms/lcms2*.h; \ rm -v -rf $$repo/src/solaris/native/sun/security/smartcardio/MUSCLE; \ esac; \ find $$repo -perm /111 -print0 | xargs -0 chmod 755; \ find $$repo '!' -perm /111 -print0 | xargs -0 chmod 644; \ ( \ ts=$$(cat ${origdir}/$$tsname); \ tar -cf ${origdir}/$$repo.tar -Hustar -b1 \ --mtime="$$ts" --sort=name \ --owner=0 --group=0 --numeric-owner $$repo; \ xz -e -C crc32 ${origdir}/$$repo.tar; \ touch -d "$$ts" ${origdir}/$$repo.tar.xz; \ rm -rf $$repo ${origdir}/$$repo.tar.gz; \ ) & \ done; \ wait; \ for x in ${origdir}/*.tar.gz; do \ if test -e "$$x"; then \ ls -l ${origdir}; \ exit 1; \ fi; \ done; \ rm ${origdir}/t[is]-*; \ find $(origdir) -perm /111 -print0 | xargs -0 chmod 755; \ find $(origdir) '!' -perm /111 -print0 | xargs -0 chmod 644; \ cd ..; \ tar -cf ${orig_tarball_b} -Hustar -b1 \ --sort=name \ --owner=0 --group=0 --numeric-owner \ ${origdir_b}/*; \ gzip -n9 ${orig_tarball_b} get-orig: fetch-orig munge-orig dfsg-orig debian/refresh: mksh debian/refresher.sh : \ $(if ${hotspot_aarch32_archs}, armhf : ) \ amd64 : binary: binary-arch binary-indep .PHONY: build build-arch build-indep clean binary-indep binary-arch binary install packaging-files .PHONY: get-orig fetch-orig munge-orig dfsg-orig debian/refresh gen-autopkgtests