Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[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_*=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  ARCH=*) # configuration
65     arch=${line#*=}
66     arch_name=`echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
67     echo "#define HOST_$arch_name 1"
68     ;;
69  HOST_USB=*)
70     # do nothing
71     ;;
72  HOST_CC=*)
73     # do nothing
74     ;;
75  HOST_*=y) # configuration
76     name=${line%=*}
77     echo "#define $name 1"
78     ;;
79  HOST_*=*) # configuration
80     name=${line%=*}
81     value=${line#*=}
82     echo "#define $name $value"
83     ;;
84  TARGET_BASE_ARCH=*) # configuration
85     target_base_arch=${line#*=}
86     base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
87     echo "#define TARGET_$base_arch_name 1"
88     ;;
89  TARGET_XML_FILES=*)
90     # do nothing
91     ;;
92  TARGET_ABI_DIR=*)
93     # do nothing
94     ;;
95  TARGET_NAME=*)
96     target_name=${line#*=}
97     echo "#define TARGET_NAME \"$target_name\""
98     ;;
99  TARGET_DIRS=*)
100     # do nothing
101     ;;
102  TARGET_*=y) # configuration
103     name=${line%=*}
104     echo "#define $name 1"
105     ;;
106  TARGET_*=*) # configuration
107     name=${line%=*}
108     value=${line#*=}
109     echo "#define $name $value"
110     ;;
111  DSOSUF=*)
112     echo "#define HOST_DSOSUF \"${line#*=}\""
113     ;;
114 esac
115
116 done # read