blob: 0098e683e20c9b7c600f712d0d6d6cf50f37517e [file] [log] [blame]
Juan Quintela42bc6082009-07-16 18:34:20 +02001#!/bin/sh
2
Juan Quintela1215c6e2009-10-07 02:40:58 +02003echo "/* Automatically generated by create_config - do not modify */"
4
Juan Quintela42bc6082009-07-16 18:34:20 +02005while read line; do
6
7case $line in
Juan Quintela2358a492009-07-27 16:13:25 +02008 VERSION=*) # configuration
9 version=${line#*=}
10 echo "#define QEMU_VERSION \"$version\""
11 ;;
12 PKGVERSION=*) # configuration
13 pkgversion=${line#*=}
14 echo "#define QEMU_PKGVERSION \"$pkgversion\""
15 ;;
Jan Kiszkac3d96972010-06-11 22:58:29 +020016 prefix=* | [a-z]*dir=*) # directory configuration
Paolo Bonzini1dabe052010-05-26 16:08:25 +020017 name=${line%=*}
18 value=${line#*=}
19 define_name=`echo $name | tr '[:lower:]' '[:upper:]'`
20 eval "define_value=\"$value\""
21 echo "#define CONFIG_QEMU_$define_name \"$define_value\""
22 # save for the next definitions
23 eval "$name=\$define_value"
24 ;;
Juan Quintela2358a492009-07-27 16:13:25 +020025 CONFIG_AUDIO_DRIVERS=*)
26 drivers=${line#*=}
27 echo "#define CONFIG_AUDIO_DRIVERS \\"
28 for drv in $drivers; do
29 echo " &${drv}_audio_driver,\\"
30 done
31 echo ""
32 ;;
Markus Armbrustereb852012009-10-27 18:41:44 +010033 CONFIG_BDRV_WHITELIST=*)
34 echo "#define CONFIG_BDRV_WHITELIST \\"
35 for drv in ${line#*=}; do
36 echo " \"${drv}\",\\"
37 done
38 echo " NULL"
39 ;;
Juan Quintela42bc6082009-07-16 18:34:20 +020040 CONFIG_*=y) # configuration
41 name=${line%=*}
42 echo "#define $name 1"
43 ;;
44 CONFIG_*=*) # configuration
45 name=${line%=*}
46 value=${line#*=}
47 echo "#define $name $value"
48 ;;
Juan Quintela2358a492009-07-27 16:13:25 +020049 ARCH=*) # configuration
50 arch=${line#*=}
51 arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'`
52 echo "#define HOST_$arch_name 1"
53 ;;
54 HOST_USB=*)
55 # do nothing
56 ;;
57 HOST_CC=*)
58 # do nothing
59 ;;
60 HOST_*=y) # configuration
61 name=${line%=*}
62 echo "#define $name 1"
63 ;;
64 HOST_*=*) # configuration
65 name=${line%=*}
66 value=${line#*=}
67 echo "#define $name $value"
68 ;;
Juan Quintela42bc6082009-07-16 18:34:20 +020069 TARGET_ARCH=*) # configuration
70 target_arch=${line#*=}
Juan Quintela42bc6082009-07-16 18:34:20 +020071 echo "#define TARGET_ARCH \"$target_arch\""
Juan Quintela42bc6082009-07-16 18:34:20 +020072 ;;
73 TARGET_BASE_ARCH=*) # configuration
74 target_base_arch=${line#*=}
75 if [ "$target_base_arch" != "$target_arch" ]; then
76 base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'`
77 echo "#define TARGET_$base_arch_name 1"
78 fi
79 ;;
80 TARGET_XML_FILES=*)
81 # do nothing
82 ;;
83 TARGET_ABI_DIR=*)
84 # do nothing
85 ;;
86 TARGET_ARCH2=*)
87 # do nothing
88 ;;
Juan Quintela2358a492009-07-27 16:13:25 +020089 TARGET_DIRS=*)
90 # do nothing
91 ;;
Juan Quintela42bc6082009-07-16 18:34:20 +020092 TARGET_*=y) # configuration
93 name=${line%=*}
94 echo "#define $name 1"
95 ;;
96 TARGET_*=*) # configuration
97 name=${line%=*}
98 value=${line#*=}
99 echo "#define $name $value"
100 ;;
Juan Quintela42bc6082009-07-16 18:34:20 +0200101esac
102
103done # read