Skip to contentSkip to conversation

passthrough for configure options to qemu

RFC In review Carlo Marcelo Arenas Belon 2 participants 2 messages Oct 23, 2007 – Oct 25, 2007 KVM

lore
Share & tools
lore
#0 lore raw

RFC v3 1/1 passthrough for configure options to qemu

The following patch implement a configure passthrough for qemu and migrate all currently implemented qemu specific configuration flags (enable-alsa, disable-vnc-tls and disable-gcc-check) to use it.

It uses qemu's configure to get a list of hints for additional options to use and to keep backward compatible descriptions of the options that can be used, but adding disable-gcc-check statically so it is clear what the impact of overriding the use of gcc4 is.

Qemu's configure has been enhanced to protect against the use of invalid options as well as reconfigured to stderr for fatal errors so they can be integrated into kvm's configure.

Carlo

---

configure +11 -20
index a0c8746..43bd8a7 100755
@@ -6,9 +6,7 @@ want_module=1
 qemu_cc=
 qemu_cflags=
 qemu_ldflags=
-enable_alsa=
-disable_vnc_tls=
-disable_gcc_check=
+qemu_conf=
 cross_prefix=
 arch=`uname -m`
 target_exec=
@@ -26,11 +24,16 @@ usage() {
 	    --qemu-cc=CC           specify compiler for qemu (must be gcc-3.x)
 	    --qemu-cflags=CFLAGS   CFLAGS to add to qemu configuration
 	    --qemu-ldflags=LDFLAGS LDFLAGS to add to qemu configuration
-	    --enable-alsa          enable alsa support for qemu
-	    --disable-vnc-tls      disable vnc tls support for qemu
+
+	Any additional option is given to qemu's configure verbatim; including:
 	    --disable-gcc-check    don't insist on gcc-3.x
 	                           CAUTION: this will break running without kvm
 EOF
+    cd qemu
+    ./configure --help | egrep "enable-|disable-" \
+        | grep -v user | grep -v system | grep -v kqemu | grep -v kvm \
+        | sed -e "s/^  /    /g" \
+        | sed -e"s/  enable/enable/g" | sed -e "s/  disable/disable/g"
     exit 1
 }
 
@@ -60,15 +63,6 @@ while [[ "$1" = -* ]]; do
 	--qemu-ldflags)
 	    qemu_ldflags="$arg"
 	    ;;
-	--enable-alsa)
-	    enable_alsa=1
-	    ;;
-	--disable-vnc-tls)
-	    disable_vnc_tls=1
-	    ;;
-	--disable-gcc-check)
-	    disable_gcc_check=1
-	    ;;
 	--arch)
 	    arch="$arg"
 	    ;;
@@ -79,7 +73,7 @@ while [[ "$1" = -* ]]; do
 	    usage
 	    ;;
 	*)
-	    usage
+	    qemu_conf="$qemu_conf $opt"
 	    ;;
     esac
 done
@@ -111,14 +105,11 @@ fi
     --disable-kqemu --extra-cflags="-I $PWD/../user $qemu_cflags" \
     --extra-ldflags="-L $PWD/../user $qemu_ldflags" \
     --enable-kvm --kernel-path="$libkvm_kerneldir" \
-    ${enable_alsa:+"--enable-alsa"} \
-    ${disable_vnc_tls:+"--disable-vnc-tls"} \
-    ${disable_gcc_check:+"--disable-gcc-check"} \
     --prefix="$prefix" \
     ${qemu_cc:+"--cc=$qemu_cc"} \
     ${cross_prefix:+"--cross-prefix=$cross_prefix"} \
-    ${cross_prefix:+"--cpu=$arch"}
-)
+    ${cross_prefix:+"--cpu=$arch"} $qemu_conf > /dev/null
+) || usage
 
 
 cat <<EOF > config.mak
qemu/configure +13 -11
index fc1e59a..a95018a 100755
@@ -311,6 +311,8 @@ for opt do
         *)     echo "undefined SPARC architecture. Exiting";exit 1;;
       esac
   ;;
+  *) show_help="yes"
+  ;;
   esac
 done
 
@@ -419,7 +421,7 @@ EOF
 if $cc -c -o $TMPO $TMPC 2> /dev/null ; then
   : C compiler works ok
 else
-    echo "ERROR: \"$cc\" either does not exist or does not work"
+    echo "ERROR: \"$cc\" either does not exist or does not work" 1>&2
     exit 1
 fi
 
@@ -438,26 +440,26 @@ if test "$check_gcc" = "yes" ; then
 int main(){return 0;}
 EOF
     if "$cc" -o $TMPE $TMPC 2> /dev/null ; then
-	echo "WARNING: \"$cc\" looks like gcc 4.x"
+	echo "WARNING: \"$cc\" looks like gcc 4.x" 1>&2
 	found_compat_cc="no"
 	if test "$gcc3_search" = "yes" ; then
-	    echo "Looking for gcc 3.x"
+	    echo "Looking for gcc 3.x" 1>&2
 	    for compat_cc in $gcc3_list ; do
 		if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
-		    echo "Found \"$compat_cc\""
+		    echo "Found \"$compat_cc\"" 1>&2
 		    cc="$cross_prefix$compat_cc"
 		    found_compat_cc="yes"
 		    break
 		fi
 	    done
 	    if test "$found_compat_cc" = "no" ; then
-		echo "gcc 3.x not found!"
+		echo "gcc 3.x not found!" 1>&2
 	    fi
 	fi
 	if test "$found_compat_cc" = "no" ; then
-	    echo "QEMU is known to have problems when compiled with gcc 4.x"
-	    echo "It is recommended that you use gcc 3.x to build QEMU"
-	    echo "To use this compiler anyway, configure with --disable-gcc-check"
+	    echo "QEMU is known to have problems when compiled with gcc 4.x" 1>&2
+	    echo "It is recommended that you use gcc 3.x to build QEMU" 1>&2
+	    echo "To use this compiler anyway, configure with --disable-gcc-check" 1>&2
 	    exit 1;
 	fi
     fi
@@ -970,9 +972,9 @@ esac
 
 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
         -a "$sdl" = "no" -a "$cocoa" = "no" ; then
-    echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
-    echo "To build QEMU without graphical output configure with --disable-gfx-check"
-    echo "Note that this will disable all output from the virtual graphics card."
+    echo "ERROR: QEMU requires SDL or Cocoa for graphical output" 1>&2
+    echo "To build QEMU without graphical output configure with --disable-gfx-check" 1>&2
+    echo "Note that this will disable all output from the virtual graphics card." 1>&2
     exit 1;
 fi
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#1 lore raw
Quoted 4 lines · Carlo Marcelo Arenas Belon

The following patch implement a configure passthrough for qemu and migrate all currently implemented qemu specific configuration flags (enable-alsa, disable-vnc-tls and disable-gcc-check) to use it.

Quoted 10 lines

It uses qemu's configure to get a list of hints for additional options to use and to keep backward compatible descriptions of the options that can be used, but adding disable-gcc-check statically so it is clear what the impact of overriding the use of gcc4 is.

Qemu's configure has been enhanced to protect against the use of invalid options as well as reconfigured to stderr for fatal errors so they can be integrated into kvm's configure.

I'd like to see qemu-devel accept the qemu changes first.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/