Hello Agatha.
Thanks for the patch.

> diff --git a/configure.ac b/configure.ac
> index edd53b2bb42..46f8cbc89ff 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2979,7 +2979,10 @@ copy_dirs=
>  AC_ARG_WITH([build-sysroot], 
>    [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
>                 [use sysroot as the system root during the build])],
> -  [if test x"$withval" != x ; then
> +  [if test x"$withval" = "xyes" ; then
> +     AC_MSG_ERROR([--with-build-sysroot requires a path argument, 
> use--with-build-sysroot=path])
> +   fi
> +   if test x"$withval" != x ; then
>       SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
>     fi],
>    [SYSROOT_CFLAGS_FOR_TARGET=])
>
> [...]
>
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 4e8269d03b6..afb6a0d7921 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -140,7 +140,10 @@ AC_ARG_WITH([native-system-header-dir],
>  AC_ARG_WITH(build-sysroot, 
>    [AS_HELP_STRING([--with-build-sysroot=sysroot],
>                    [use sysroot as the system root during the build])],
> -  [if test x"$withval" != x ; then
> +  [if test x"$withval" = "xyes"; then
> +     AC_MSG_ERROR([--with-build-sysroot requires a path argument, 
> use--with-build-sysroot=path])
> +   fi
> +   if test x"$withval" != x ; then
>       SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
>     fi],
>    [SYSROOT_CFLAGS_FOR_TARGET=])

The fix LGTM.

While looking at it I wondered whether there is still a need to check
for an empty withval in the ACTION-IF-GIVEN section of the macro, once
"yes" is discarded.  According to the documentation, passing
--sysroot="" to gcc will make it look for system headers and libraries
in DIR/usr/include and DIR/usr/lib, where DIR="" in this case, so
/usr/include and /usr/lib which I think is the default :) Probably
better not to rely on that though..

Reply via email to