java/openjdk11: respect compiler and linker flags

pass CFLAGS, CXXFLAGS and LDFLAGS to the build
This enables more easily testing different build options.

fix build on gcc by passing --disable-precompiled-headers not only on powerpc64
"Without this, I was getting PCH-error from g++12 on my amd64 machine too."

PR:	279367
Tested by:	poudriere
Approved by:	maintainer timeout (java@)
This commit is contained in:
Mikhail T. 2024-09-09 09:50:21 +02:00 committed by Ronald Klop
parent 0cb139ce88
commit e3120f0ac0
No known key found for this signature in database
GPG key ID: 551E8E6207A42166

View file

@ -1,6 +1,7 @@
PORTNAME= openjdk
DISTVERSIONPREFIX= jdk-
DISTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_PATCH_VERSION}+${JDK_BUILD_NUMBER}-${BSD_JDK_VERSION}
PORTREVISION= 1
CATEGORIES= java devel
PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION}
@ -88,6 +89,9 @@ CONFIGURE_ARGS= --with-boot-jdk=${BOOTSTRAPJDKDIR} \
--disable-hotspot-gtest \
--with-jvm-features=shenandoahgc \
--with-alsa=${LOCALBASE} \
--with-extra-cflags="${CFLAGS}" \
--with-extra-cxxflags="${CXXFLAGS}" \
--with-extra-ldflags="${LDFLAGS}" \
--with-fontconfig=${LOCALBASE} \
--with-freetype=system \
--with-freetype-include=${LOCALBASE}/include/freetype2 \
@ -147,9 +151,10 @@ CONFIGURE_ARGS+= --with-toolchain-type=${COMPILER_TYPE}
.if ${COMPILER_TYPE} == gcc
USE_GCC= yes
CONFIGURE_ARGS+= --with-extra-ldflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT} -L${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
--with-extra-cflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}" \
--with-extra-cxxflags="-Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}"
LDFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT} -L${LOCALBASE}/lib/gcc${GCC_DEFAULT}
CFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}
CXXFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/gcc${GCC_DEFAULT}
CONFIGURE_ARGS+=--disable-precompiled-headers
.else
MAKE_ENV+= USE_CLANG=true
.endif