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