RFR: 8296478: Rework 8282948 and 8282700 to use the new autoconf UTIL_ARG_WITH [v8]
Julian Waters
jwaters at openjdk.org
Fri Dec 9 12:59:54 UTC 2022
On Tue, 6 Dec 2022 19:42:19 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
>>
>> CHECK_VALUE
>
> make/autoconf/jdk-version.m4 line 94:
>
>> 92: properties of MS Windows binaries.],
>> 93: DEFAULT_DESC: [not specified],
>> 94: CHECK_VALUE: [
>
> I see that this check is repeated all over the place. I suggest that you create a new `TYPE` for this. I suggest calling it `identifier`. Then you replace `TYPE: string` with `TYPE: identifier` in all places where we check that the value is non-empty and contains only printable characters. The type itself is declared in line 692 in util.m4 (and documented on line 582). Then you need to add a type checking method:
>
> AC_DEFUN([UTIL_CHECK_TYPE_identifier],
> [
> # Check that the argument is non-empty and only contains printable characters
> if test "x$1" = x; then
> FAILURE="Value cannot be empty"
> elif [ ! [[ $1 =~ ^[[:print:]]*$ ]] ]; then
> FAILURE="Value contains non-printing characters: $1"
> fi
> ])
Seems to me like a util function for CHECK_VALUE would be a slightly better approach than creating a new type, like the one we already have:
###############################################################################
# Helper functions for CHECK_VALUE in ARG_WITH.
AC_DEFUN([UTIL_CHECK_STRING_NON_EMPTY],
[
if test "x$RESULT" = "x"; then
FAILURE="Value cannot be empty"
fi
])
-------------
PR: https://git.openjdk.org/jdk/pull/11020
More information about the build-dev
mailing list