Fix issue with -Werror cleanup sed command in configure.ac (#4223)

This commit is contained in:
jhendersonHDF 2024-03-24 20:06:56 -05:00 committed by GitHub
parent 638c4d901f
commit be16b70272
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,21 +198,36 @@ saved_user_CPPFLAGS="$CPPFLAGS"
##
## Regex:
##
## -Werror Literal -Werror
## \( Start optional capturing group
## = Literal equals sign
## [^[:space:]-] Non-space characters
## \+ 1 or more of the above
## \) End optional capturing group
## \? 0 or 1 capturing group matches
## -Werror Literal -Werror
## \( Start optional capturing group
## = Literal equals sign
## [^[:space:]] Non-space characters
## \+ 1 or more of the above
## \) End optional capturing group
## \? 0 or 1 capturing group matches
##
WERROR_SED= "sed -e 's/-Werror\(=[^[:space:]]\+\)\?//g'"
CFLAGS="`echo $CFLAGS | $WERROR_SED`"
CXXFLAGS="`echo $CXXFLAGS | $WERROR_SED`"
FCFLAGS="`echo $FCFLAGS | $WERROR_SED`"
JAVACFLAGS="`echo $JAVACFLAGS | $WERROR_SED`"
CPPFLAGS="`echo $CPPFLAGS | $WERROR_SED`"
## Note that the outer pair of '[]' ends up getting removed
WERROR_SED='s/-Werror\(=[[^[:space:]]]\+\)\?//g'
CFLAGS_SED="`echo $CFLAGS | sed -e $WERROR_SED`"
if test $? -eq 0; then
CFLAGS="$CFLAGS_SED"
fi
CXXFLAGS_SED="`echo $CXXFLAGS | sed -e $WERROR_SED`"
if test $? -eq 0; then
CXXFLAGS="$CXXFLAGS_SED"
fi
FCFLAGS_SED="`echo $FCFLAGS | sed -e $WERROR_SED`"
if test $? -eq 0; then
FCFLAGS="$FCFLAGS_SED"
fi
JAVACFLAGS_SED="`echo $JAVACFLAGS | sed -e $WERROR_SED`"
if test $? -eq 0; then
JAVACFLAGS="$JAVACFLAGS_SED"
fi
CPPFLAGS_SED="`echo $CPPFLAGS | sed -e $WERROR_SED`"
if test $? -eq 0; then
CPPFLAGS="$CPPFLAGS_SED"
fi
## Support F9X variable to define Fortran compiler if FC variable is
## not used. This should be deprecated in the future.