OpenJDK11 build on macOS with autoconf 2.72 / -std=gnu++11 option
Baesken, Matthias
matthias.baesken at sap.com
Fri Jan 5 15:36:49 UTC 2024
Seems there is already an util helper " UTIL_GET_NON_MATCHING_VALUES" .
So should we do something like this (maybe with a few more unwanted -std= settings ?
Seems the UTIL_GET_NON_MATCHING_VALUES so far accepts only fix strings, is that correct ?
diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4
index 289eec3356b..8ff95c1114c 100644
--- a/make/autoconf/toolchain.m4
+++ b/make/autoconf/toolchain.m4
@@ -389,6 +389,12 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
CFLAGS="$ORG_CFLAGS"
CXXFLAGS="$ORG_CXXFLAGS"
+
+ # filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
+ UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
+ if test "x$cxx_filtered" != x; then
+ CXX="$cxx_filtered"
+ fi
])
Best regards, Matthias
>
>Btw. Is there already something at make/autoconf that does similar filtering of unwanted flags ?
>The mentioned TOOLCHAIN_POST_DETECTION seems just to reset some variables like CXX_CFLAGS to old values , not sure if this is what we want here ?
>
>
>>Hi Erik, I created :
>>
>>https://bugs.openjdk.org/browse/JDK-8323008
>>8323008: filter out any -std* flags added by autoconf from CC/CXX
>>
More information about the build-dev
mailing list