[PATCH v1 29/39] configure: don't allow plugins to be enabled for a non-TCG build

Alex Bennée posted 39 patches 4 years, 5 months ago
Maintainers: Kamil Rytarowski <kamil@netbsd.org>, Reinoud Zandijk <reinoud@netbsd.org>, Ryo ONODERA <ryoon@netbsd.org>, Brad Smith <brad@comstyle.com>
[PATCH v1 29/39] configure: don't allow plugins to be enabled for a non-TCG build
Posted by Alex Bennée 4 years, 5 months ago
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 650d9c0735..44a487e090 100755
--- a/configure
+++ b/configure
@@ -1098,6 +1098,7 @@ for opt do
   --enable-cap-ng) cap_ng="enabled"
   ;;
   --disable-tcg) tcg="disabled"
+                 plugins="no"
   ;;
   --enable-tcg) tcg="enabled"
   ;;
@@ -1509,7 +1510,11 @@ for opt do
   ;;
   --disable-xkbcommon) xkbcommon="disabled"
   ;;
-  --enable-plugins) plugins="yes"
+  --enable-plugins) if test "$tcg" = "enabled"; then
+                        plugins="yes"
+                    else
+                        error_exit "Can't enable plugins on non-TCG builds"
+                    fi
   ;;
   --disable-plugins) plugins="no"
   ;;
-- 
2.20.1


Re: [PATCH v1 29/39] configure: don't allow plugins to be enabled for a non-TCG build
Posted by Thomas Huth 4 years, 5 months ago
On 06/07/2021 16.58, Alex Bennée wrote:
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   configure | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 650d9c0735..44a487e090 100755
> --- a/configure
> +++ b/configure
> @@ -1098,6 +1098,7 @@ for opt do
>     --enable-cap-ng) cap_ng="enabled"
>     ;;
>     --disable-tcg) tcg="disabled"
> +                 plugins="no"
>     ;;
>     --enable-tcg) tcg="enabled"
>     ;;
> @@ -1509,7 +1510,11 @@ for opt do
>     ;;
>     --disable-xkbcommon) xkbcommon="disabled"
>     ;;
> -  --enable-plugins) plugins="yes"
> +  --enable-plugins) if test "$tcg" = "enabled"; then
> +                        plugins="yes"
> +                    else
> +                        error_exit "Can't enable plugins on non-TCG builds"
> +                    fi

That's the wrong spot for checking. While it works fine with:

  .../configure --disable-tcg --enable-plugins

it fails to bail out with:

  .../configure --enable-plugins --disable-tcg

You should do such checks after all options have been parsed.

  Thomas