diff mbox

[2/2] tools/configure: fix --with-system-{ovmf/seabios}

Message ID 1474908249-22819-3-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monne Sept. 26, 2016, 4:44 p.m. UTC
Current configure code doesn't define {SEABIOS/OVMF}_PATH when
--with-system-{ovmf/seabios} is used. Fix this by making sure those defines
are always set if the internal {ovmf/seabios}_path variables are also set.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
---
Please re-run autogen.sh before committing.
---
 tools/configure.ac | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Wei Liu Sept. 26, 2016, 4:57 p.m. UTC | #1
On Mon, Sep 26, 2016 at 06:44:09PM +0200, Roger Pau Monne wrote:
> Current configure code doesn't define {SEABIOS/OVMF}_PATH when
> --with-system-{ovmf/seabios} is used. Fix this by making sure those defines
> are always set if the internal {ovmf/seabios}_path variables are also set.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
> Please re-run autogen.sh before committing.
> ---
>  tools/configure.ac | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/configure.ac b/tools/configure.ac
> index f010d72..6788ea2 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -222,10 +222,9 @@ AC_ARG_WITH([system-seabios],
>          *)  seabios_path=$withval ;;
>      esac
>  ],[])
> -AS_IF([test "x$seabios" = "xy"], [
> -    AC_DEFINE_UNQUOTED([SEABIOS_PATH],
> -                       ["${seabios_path:-$XENFIRMWAREDIR/seabios.bin}"],
> -                       [SeaBIOS path])
> +AS_IF([test "x$seabios" = "xy"], [seabios_path=$XENFIRMWAREDIR/seabios.bin])
> +AS_IF([test -n "$seabios_path"], [
> +    AC_DEFINE_UNQUOTED([SEABIOS_PATH],["$seabios_path"],[SeaBIOS path])
>  ])

What about just change the test condition in the original code to

  test "x$seabios" = "xy" || -n "$seabios_path"

?

That should result in the same thing, right?


>  
>  AC_ARG_WITH([system-ovmf],
> @@ -239,10 +238,9 @@ AC_ARG_WITH([system-ovmf],
>          *)  ovmf_path=$withval ;;
>      esac
>  ],[])
> -AS_IF([test "x$ovmf" = "xy"], [
> -    AC_DEFINE_UNQUOTED([OVMF_PATH],
> -                       ["${ovmf_path:-$XENFIRMWAREDIR/ovmf.bin}"],
> -                       [OVMF path])
> +AS_IF([test "x$ovmf" = "xy"], [ovmf_path=$XENFIRMWAREDIR/ovmf.bin])
> +AS_IF([test -n "$ovmf_path"], [
> +    AC_DEFINE_UNQUOTED([OVMF_PATH],["$ovmf_path"],[OVMF path])
>  ])
>  
>  AC_ARG_WITH([extra-qemuu-configure-args],
> -- 
> 2.7.4 (Apple Git-66)
>
Roger Pau Monne Sept. 26, 2016, 5:15 p.m. UTC | #2
On Mon, Sep 26, 2016 at 05:57:00PM +0100, Wei Liu wrote:
> On Mon, Sep 26, 2016 at 06:44:09PM +0200, Roger Pau Monne wrote:
> > Current configure code doesn't define {SEABIOS/OVMF}_PATH when
> > --with-system-{ovmf/seabios} is used. Fix this by making sure those defines
> > are always set if the internal {ovmf/seabios}_path variables are also set.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > Cc: Wei Liu <wei.liu2@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > ---
> > Please re-run autogen.sh before committing.
> > ---
> >  tools/configure.ac | 14 ++++++--------
> >  1 file changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index f010d72..6788ea2 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -222,10 +222,9 @@ AC_ARG_WITH([system-seabios],
> >          *)  seabios_path=$withval ;;
> >      esac
> >  ],[])
> > -AS_IF([test "x$seabios" = "xy"], [
> > -    AC_DEFINE_UNQUOTED([SEABIOS_PATH],
> > -                       ["${seabios_path:-$XENFIRMWAREDIR/seabios.bin}"],
> > -                       [SeaBIOS path])
> > +AS_IF([test "x$seabios" = "xy"], [seabios_path=$XENFIRMWAREDIR/seabios.bin])
> > +AS_IF([test -n "$seabios_path"], [
> > +    AC_DEFINE_UNQUOTED([SEABIOS_PATH],["$seabios_path"],[SeaBIOS path])
> >  ])
> 
> What about just change the test condition in the original code to
> 
>   test "x$seabios" = "xy" || -n "$seabios_path"
> 
> ?
>
> That should result in the same thing, right?

Yes, that's right. Should I do it, or are you going to send it? TBH, it's 
just a one line change, and the idea is yours.

Roger.
diff mbox

Patch

diff --git a/tools/configure.ac b/tools/configure.ac
index f010d72..6788ea2 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -222,10 +222,9 @@  AC_ARG_WITH([system-seabios],
         *)  seabios_path=$withval ;;
     esac
 ],[])
-AS_IF([test "x$seabios" = "xy"], [
-    AC_DEFINE_UNQUOTED([SEABIOS_PATH],
-                       ["${seabios_path:-$XENFIRMWAREDIR/seabios.bin}"],
-                       [SeaBIOS path])
+AS_IF([test "x$seabios" = "xy"], [seabios_path=$XENFIRMWAREDIR/seabios.bin])
+AS_IF([test -n "$seabios_path"], [
+    AC_DEFINE_UNQUOTED([SEABIOS_PATH],["$seabios_path"],[SeaBIOS path])
 ])
 
 AC_ARG_WITH([system-ovmf],
@@ -239,10 +238,9 @@  AC_ARG_WITH([system-ovmf],
         *)  ovmf_path=$withval ;;
     esac
 ],[])
-AS_IF([test "x$ovmf" = "xy"], [
-    AC_DEFINE_UNQUOTED([OVMF_PATH],
-                       ["${ovmf_path:-$XENFIRMWAREDIR/ovmf.bin}"],
-                       [OVMF path])
+AS_IF([test "x$ovmf" = "xy"], [ovmf_path=$XENFIRMWAREDIR/ovmf.bin])
+AS_IF([test -n "$ovmf_path"], [
+    AC_DEFINE_UNQUOTED([OVMF_PATH],["$ovmf_path"],[OVMF path])
 ])
 
 AC_ARG_WITH([extra-qemuu-configure-args],