Skip to contentSkip to conversation

Add --disable-bridge-helper configure flag

PATCH Superseded Fabien Chouteau 2 participants 2 messages Jul 11, 2012 Kbuild

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add --disable-bridge-helper configure flag

Bridge helper uses ioctl's not available on old Linux versions, we add this flag to disable the build.

---
 Makefile  |    2 +-
 configure |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
Makefile +1 -1
index 34d6a9e..c50ec5e 100644
@@ -37,7 +37,7 @@ $(call set-vpath, $(SRC_PATH))
 
 LIBS+=-lz $(LIBS_TOOLS)
 
-HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(CONFIG_BRIDGE_HELPER) = qemu-bridge-helper$(EXESUF)
 
 ifdef BUILD_DOCS
 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
configure +14 -0
index 500fe24..0e8159e 100755
@@ -195,6 +195,7 @@ zlib="yes"
 guest_agent="yes"
 libiscsi=""
 coroutine=""
+bridge_helper="yes"
 
 # parse CC options first
 for opt do
@@ -824,6 +825,10 @@ for opt do
   ;;
   --disable-guest-agent) guest_agent="no"
   ;;
+  --enable-bridge-helper) bridge_helper="yes"
+  ;;
+  --disable-bridge-helper) bridge_helper="no"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -1110,6 +1115,8 @@ echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
 echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
 echo "  --with-coroutine=BACKEND coroutine backend. Supported options:"
 echo "                           gthread, ucontext, sigaltstack, windows"
+echo "  --enable-bridge-helper   enable building of the qemu-bridge-helper (default)"
+echo "  --disable-bridge-helper  disable building of the qemu-bridge-helper"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -3896,6 +3903,13 @@ if test "$tcg_interpreter" = "yes" ; then
   echo "CONFIG_TCI_DIS=y"  >> $libdis_config_mak
 fi
 
+if test "$bridge_helper" = "yes" \
+    && test "$linux" = "yes"     \
+    && test "$static" = "no";
+then
+    echo "CONFIG_BRIDGE_HELPER=y" >> $config_host_mak
+fi
+
 case "$ARCH" in
 alpha)
   # Ensure there's only a single GP
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 2 lines · Fabien Chouteau

Bridge helper uses ioctl's not available on old Linux versions, we add this flag to disable the build.

This is still the wrong approach -- you need to be testing for presence of the ioctls and disabling the bridge helper if they're not found. Once you've done that you can, if you like, add an enable/disable switch with the usual semantics (no switch == detect and use if possible, --enable.. == detect and fail configure if we couldn't build it, --disable == don't build).

-- PMM