[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] tools: fix dependency for ipxe and rombios



It appears that the test in 01d631028 for ipxe's dependency on rombios
is not good enough. Configuring with --disable-rombios doesn't disable
ipxe.

Fix it by testing the dependency in AC_ARG_ENABLE and AC_ARG_WITH at
the same time.

Now we have four options for ipxe:

  --enable-ipxe         enable building in-tree ipxe
  --disable-ipxe        disable building in-tree ipxe
  --with-system-ipxe    specify a path to be baked into code, disable
                        building in-tree ipxe, this trumps --{en,dis}able-ipxe
  --without-system-ipxe no effect

Any enablement of ipxe also depends on the presence of rombios.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

I opt to maintain consistency with other options.

We probably need similar fix with other --without-* options.
---
 tools/configure    | 70 ++++++++++++++++++++++++++++--------------------------
 tools/configure.ac | 28 ++++++++++++++--------
 2 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/tools/configure b/tools/configure
index 3b55fb2e36..a3011159fc 100755
--- a/tools/configure
+++ b/tools/configure
@@ -693,6 +693,7 @@ APPEND_INCLUDES
 PREPEND_LIB
 PREPEND_INCLUDES
 EXTRA_QEMUU_CONFIGURE_ARGS
+ipxe
 qemu_xen_systemd
 qemu_xen_path
 qemu_xen
@@ -703,7 +704,6 @@ AS86
 qemu_traditional
 blktap2
 LINUX_BACKEND_MODULES
-ipxe
 seabios
 ovmf
 xsmpolicy
@@ -806,7 +806,6 @@ enable_ocamltools
 enable_xsmpolicy
 enable_ovmf
 enable_seabios
-enable_ipxe
 with_linux_backend_modules
 enable_blktap2
 enable_qemu_traditional
@@ -814,6 +813,7 @@ enable_rombios
 with_system_qemu
 with_system_seabios
 with_system_ovmf
+enable_ipxe
 with_system_ipxe
 with_extra_qemuu_configure_args
 with_xenstored
@@ -1491,13 +1491,14 @@ Optional Features:
   --disable-xsmpolicy     Disable XSM policy compilation (default is ENABLED)
   --enable-ovmf           Enable OVMF (default is DISABLED)
   --disable-seabios       Disable SeaBIOS (default is ENABLED)
-  --disable-ipxe          Disable IPXE (default is ENABLED)
   --enable-blktap2        Enable blktap2, (DEFAULT is off)
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
                           for Linux or NetBSD x86, otherwise off)
   --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
                           is enabled, otherwise off)
+  --disable-ipxe          Enable in-tree IPXE, (DEFAULT is on if rombios is
+                          enabled, otherwise off, see also --with-system-ipxe)
   --enable-systemd        Enable systemd support (default is DISABLED)
 
 Optional Packages:
@@ -1533,7 +1534,10 @@ Optional Packages:
                           and installing our own version
   --with-system-ipxe[=PATH]
                           Use system supplied IPXE PATH instead of building
-                          and installing our own version
+                          and installing our own version, it takes precedence
+                          over --{en,dis}able-ipxe and is bound by the
+                          presence of rombios, --without-system-ipxe has no
+                          effect
   --with-extra-qemuu-configure-args[="--ARG1 ..."]
                           List of additional configure options for upstream
                           qemu
@@ -4191,29 +4195,6 @@ seabios=$ax_cv_seabios
 
 
 
-# Check whether --enable-ipxe was given.
-if test "${enable_ipxe+set}" = set; then :
-  enableval=$enable_ipxe;
-fi
-
-
-if test "x$enable_ipxe" = "xno"; then :
-
-    ax_cv_ipxe="n"
-
-elif test "x$enable_ipxe" = "xyes"; then :
-
-    ax_cv_ipxe="y"
-
-elif test -z $ax_cv_ipxe; then :
-
-    ax_cv_ipxe="y"
-
-fi
-ipxe=$ax_cv_ipxe
-
-
-
 
 # Check whether --with-linux-backend-modules was given.
 if test "${with_linux_backend_modules+set}" = set; then :
@@ -4604,22 +4585,42 @@ _ACEOF
 
 fi
 
+# Check whether --enable-ipxe was given.
+if test "${enable_ipxe+set}" = set; then :
+  enableval=$enable_ipxe;
+     if test "x$enable_ipxe" = "xno"; then :
+  ipxe=n
+else
+  ipxe=y
+fi
+     if test "x$enable_rombios" = "xno" -a "x$ipxe" = "xy" ; then :
+  ipxe=n
+fi
+
+else
+
+    if test "x$enable_rombios" = "xno"; then :
+  ipxe=n
+else
+  ipxe=y
+fi
+
+fi
+
 
 # Check whether --with-system-ipxe was given.
 if test "${with_system_ipxe+set}" = set; then :
   withval=$with_system_ipxe;
-    # Disable compilation of IPXE.
-    ipxe=n
     case $withval in
         no) ipxe_path= ;;
-        /*)  ipxe_path=$withval ;;
+        /*)  ipxe_path=$withval; ipxe=n ;;
         *) as_fn_error $? "IPXE specified, but is not an absolute path" 
"$LINENO" 5 ;;
     esac
+    if test "x$enable_rombios" = "xno"; then :
 
-    # IPXE depends on Rombios
-    if test "x$enable_rombios" = "xno"; then
-        as_fn_error $? "Rombios is required for using IPXE" "$LINENO" 5
-    fi
+        ipxe_path=
+
+fi
 
 fi
 
@@ -4634,6 +4635,7 @@ _ACEOF
 fi
 
 
+
 # Check whether --with-extra-qemuu-configure-args was given.
 if test "${with_extra_qemuu_configure_args+set}" = set; then :
   withval=$with_extra_qemuu_configure_args;
diff --git a/tools/configure.ac b/tools/configure.ac
index 0f85472602..b8d48028ee 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -84,7 +84,6 @@ AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])
 AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
 AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
-AX_ARG_DEFAULT_ENABLE([ipxe], [Disable IPXE])
 
 AC_ARG_WITH([linux-backend-modules],
     AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"],
@@ -244,28 +243,37 @@ AS_IF([test "x$ovmf" = "xy" -o -n "$ovmf_path" ], [
                        [OVMF path])
 ])
 
+AC_ARG_ENABLE([ipxe],
+    AS_HELP_STRING([--disable-ipxe],
+                   [Enable in-tree IPXE, (DEFAULT is on if rombios is enabled,
+                    otherwise off, see also --with-system-ipxe)]),
+    [
+     AS_IF([test "x$enable_ipxe" = "xno"], [ipxe=n], [ipxe=y])
+     AS_IF([test "x$enable_rombios" = "xno" -a "x$ipxe" = "xy" ], [ipxe=n], [])
+    ],
+    [
+    AS_IF([test "x$enable_rombios" = "xno"], [ipxe=n], [ipxe=y])
+])
 AC_ARG_WITH([system-ipxe],
     AS_HELP_STRING([--with-system-ipxe@<:@=PATH@:>@],
        [Use system supplied IPXE PATH instead of building and installing
-        our own version]),[
-    # Disable compilation of IPXE.
-    ipxe=n
+        our own version, it takes precedence over --{en,dis}able-ipxe and is
+        bound by the presence of rombios, --without-system-ipxe has no 
effect]),[
     case $withval in
         no) ipxe_path= ;;
-        /*)  ipxe_path=$withval ;;
+        /*)  ipxe_path=$withval; ipxe=n ;;
         *) AC_MSG_ERROR([IPXE specified, but is not an absolute path]) ;;
     esac
-
-    # IPXE depends on Rombios
-    if test "x$enable_rombios" = "xno"; then
-        AC_MSG_ERROR([Rombios is required for using IPXE])
-    fi
+    AS_IF([test "x$enable_rombios" = "xno"], [
+        ipxe_path=
+    ], [])
 ],[])
 AS_IF([test "x$ipxe" = "xy" -o -n "$ipxe_path" ], [
     AC_DEFINE_UNQUOTED([IPXE_PATH],
                        ["${ipxe_path:-$XENFIRMWAREDIR/ipxe.bin}"],
                        [IPXE path])
 ])
+AC_SUBST(ipxe)
 
 AC_ARG_WITH([extra-qemuu-configure-args],
     AS_HELP_STRING([--with-extra-qemuu-configure-args@<:@="--ARG1 ..."@:>@],
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.