Generate config-host.h from config-host.mak

Generate CONFIG_AUDIO_DRIVERS.  Order is important here, because the
first driver in the list is the one used by default.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/create_config b/create_config
index 8b7b365..8e757f3 100755
--- a/create_config
+++ b/create_config
@@ -1,11 +1,35 @@
 #!/bin/sh
 
-echo "/* Automatically generated by configure - do not modify */"
-echo "#include \"../config-host.h\""
-
 while read line; do
 
 case $line in
+ VERSION=*) # configuration
+    version=${line#*=}
+    echo "#define QEMU_VERSION \"$version\""
+    ;;
+ PKGVERSION=*) # configuration
+    pkgversion=${line#*=}
+    echo "#define QEMU_PKGVERSION \"$pkgversion\""
+    ;;
+ ARCH=*) # configuration
+    arch=${line#*=}
+    arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'`
+    echo "#define HOST_$arch_name 1"
+    ;;
+ CONFIG__sparc_*=y) # configuration
+    name=${line%=*}
+    name=${name#CONFIG}
+    value=${line#*=}
+    echo "#define $name $value"
+    ;;
+ CONFIG_AUDIO_DRIVERS=*)
+    drivers=${line#*=}
+    echo "#define CONFIG_AUDIO_DRIVERS \\"
+    for drv in $drivers; do
+      echo "    &${drv}_audio_driver,\\"
+    done
+    echo ""
+    ;;
  CONFIG_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"
@@ -15,6 +39,26 @@
     value=${line#*=}
     echo "#define $name $value"
     ;;
+ ARCH=*) # configuration
+    arch=${line#*=}
+    arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'`
+    echo "#define HOST_$arch_name 1"
+    ;;
+ HOST_USB=*)
+    # do nothing
+    ;;
+ HOST_CC=*)
+    # do nothing
+    ;;
+ HOST_*=y) # configuration
+    name=${line%=*}
+    echo "#define $name 1"
+    ;;
+ HOST_*=*) # configuration
+    name=${line%=*}
+    value=${line#*=}
+    echo "#define $name $value"
+    ;;
  TARGET_ARCH=*) # configuration
     target_arch=${line#*=}
     arch_name=`echo $target_arch | tr '[:lower:]' '[:upper:]'`
@@ -37,6 +81,9 @@
  TARGET_ARCH2=*)
     # do nothing
     ;;
+ TARGET_DIRS=*)
+    # do nothing
+    ;;
  TARGET_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"