Thanks , I created   https://github.com/openjdk/jdk/pull/17301  .

Best regards, Matthias



-----Original Message-----
From: erik.joels...@oracle.com <erik.joels...@oracle.com> 
Sent: Friday, 5 January 2024 19:10
To: Baesken, Matthias <matthias.baes...@sap.com>; Kim Barrett 
<kim.barr...@oracle.com>
Cc: build-dev@openjdk.org; Magnus Ihse Bursie <magnus.ihse.bur...@oracle.com>; 
Langer, Christoph <christoph.lan...@sap.com>
Subject: Re: OpenJDK11 build on macOS with autoconf 2.72 / -std=gnu++11 option

That looks like a neat solution.

/Erik

On 1/5/24 07:36, Baesken, Matthias wrote:
> 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
>>>
>

Reply via email to