vl: Table-based select_vgahw()
[qemu.git] / scripts / create_config
1 #!/bin/sh
2
3 echo "/* Automatically generated by create_config - do not modify */"
4
5 while read line; do
6
7 case $line in
8  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     ;;
16  qemu_*dir=*) # qemu-specific directory configuration
17     name=${line%=*}
18     value=${line#*=}
19     define_name=`echo $name | LC_ALL=C tr '[a-z]' '[A-Z]'`
20     eval "define_value=\"$value\""
21     echo "#define CONFIG_$define_name \"$define_value\""
22     # save for the next definitions
23     eval "$name=\$define_value"
24     ;;
25  prefix=*)
26     # save for the next definitions
27     prefix=${line#*=}
28     ;;
29  IASL=*) # iasl executable
30     value=${line#*=}
31     echo "#define CONFIG_IASL $value"
32     ;;
33  CONFIG_AUDIO_DRIVERS=*)
34     drivers=${line#*=}
35     echo "#define CONFIG_AUDIO_DRIVERS \\"
36     for drv in $drivers; do
37       echo "    &${drv}_audio_driver,\\"
38     done
39     echo ""
40     ;;
41  CONFIG_BDRV_RW_WHITELIST=*)
42     echo "#define CONFIG_BDRV_RW_WHITELIST\\"
43     for drv in ${line#*=}; do
44       echo "    \"${drv}\",\\"
45     done
46     echo "    NULL"
47     ;;
48  CONFIG_BDRV_RO_WHITELIST=*)
49     echo "#define CONFIG_BDRV_RO_WHITELIST\\"
50     for drv in ${line#*=}; do
51       echo "    \"${drv}\",\\"
52     done
53     echo "    NULL"
54     ;;
55  CONFIG_*='$(CONFIG_SOFTMMU)'|CONFIG_*=y) # configuration
56     name=${line%=*}
57     echo "#define $name 1"
58     ;;
59  CONFIG_*=*) # configuration
60     name=${line%=*}
61     value=${line#*=}
62     echo "#define $name $value"
63     ;;
64  HAVE_*=y) # configuration
65     name=${line%=*}
66     echo "#define $name 1"
67     ;;
68  HAVE_*=*) # configuration
69     name=${line%=*}
70     value=${line#*=}
71     echo "#define $name $value"
72     ;;
73  ARCH=*) # configuration
74     arch=${line#*=}
75     arch_name=`echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
76     echo "#define HOST_$arch_name 1"
77     ;;
78  HOST_USB=*)
79     # do nothing
80     ;;
81  HOST_CC=*)
82     # do nothing
83     ;;
84  HOST_*=y) # configuration
85     name=${line%=*}
86     echo "#define $name 1"
87     ;;
88  HOST_*=*) # configuration
89     name=${line%=*}
90     value=${line#*=}
91     echo "#define $name $value"
92     ;;
93  TARGET_BASE_ARCH=*) # configuration
94     target_base_arch=${line#*=}
95     base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
96     echo "#define TARGET_$base_arch_name 1"
97     ;;
98  TARGET_XML_FILES=*)
99     # do nothing
100     ;;
101  TARGET_ABI_DIR=*)
102     # do nothing
103     ;;
104  TARGET_NAME=*)
105     target_name=${line#*=}
106     echo "#define TARGET_NAME \"$target_name\""
107     ;;
108  TARGET_DIRS=*)
109     # do nothing
110     ;;
111  TARGET_*=y) # configuration
112     name=${line%=*}
113     echo "#define $name 1"
114     ;;
115  TARGET_*=*) # configuration
116     name=${line%=*}
117     value=${line#*=}
118     echo "#define $name $value"
119     ;;
120  DSOSUF=*)
121     echo "#define HOST_DSOSUF \"${line#*=}\""
122     ;;
123 esac
124
125 done # read