meson: infrastructure for building emulators
[qemu/ar7.git] / scripts / create_config
blobbc826610413b791d94d314e84091f0bbb0db6229
1 #!/bin/sh
3 test $# -gt 0 && exec < $1
5 echo "/* Automatically generated by create_config - do not modify */"
7 while read line; do
9 case $line in
10 VERSION=*) # configuration
11 version=${line#*=}
12 major=$(echo "$version" | cut -d. -f1)
13 minor=$(echo "$version" | cut -d. -f2)
14 micro=$(echo "$version" | cut -d. -f3)
15 echo "#define QEMU_VERSION \"$version\""
16 echo "#define QEMU_VERSION_MAJOR $major"
17 echo "#define QEMU_VERSION_MINOR $minor"
18 echo "#define QEMU_VERSION_MICRO $micro"
20 qemu_*dir=* | qemu_*path=*) # qemu-specific directory configuration
21 name=${line%=*}
22 value=${line#*=}
23 define_name=$(echo $name | LC_ALL=C tr '[a-z]' '[A-Z]')
24 eval "define_value=\"$value\""
25 echo "#define CONFIG_$define_name \"$define_value\""
26 # save for the next definitions
27 eval "$name=\$define_value"
29 prefix=*)
30 # save for the next definitions
31 prefix=${line#*=}
33 IASL=*) # iasl executable
34 value=${line#*=}
35 echo "#define CONFIG_IASL $value"
37 CONFIG_AUDIO_DRIVERS=*)
38 drivers=${line#*=}
39 echo "#define CONFIG_AUDIO_DRIVERS \\"
40 for drv in $drivers; do
41 echo " \"${drv}\",\\"
42 done
43 echo ""
45 CONFIG_BDRV_RW_WHITELIST=*)
46 echo "#define CONFIG_BDRV_RW_WHITELIST\\"
47 for drv in ${line#*=}; do
48 echo " \"${drv}\",\\"
49 done
50 echo " NULL"
52 CONFIG_BDRV_RO_WHITELIST=*)
53 echo "#define CONFIG_BDRV_RO_WHITELIST\\"
54 for drv in ${line#*=}; do
55 echo " \"${drv}\",\\"
56 done
57 echo " NULL"
59 CONFIG_*=y) # configuration
60 name=${line%=*}
61 echo "#define $name 1"
63 CONFIG_*=n) # configuration
65 CONFIG_*=*) # configuration
66 name=${line%=*}
67 value=${line#*=}
68 echo "#define $name $value"
70 HAVE_*=y) # configuration
71 name=${line%=*}
72 echo "#define $name 1"
74 HAVE_*=*) # configuration
75 name=${line%=*}
76 value=${line#*=}
77 echo "#define $name $value"
79 ARCH=*) # configuration
80 arch=${line#*=}
81 arch_name=$(echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]')
82 echo "#define HOST_$arch_name 1"
84 HOST_USB=*)
85 # do nothing
87 HOST_CC=*)
88 # do nothing
90 HOST_*=y) # configuration
91 name=${line%=*}
92 echo "#define $name 1"
94 HOST_*=*) # configuration
95 name=${line%=*}
96 value=${line#*=}
97 echo "#define $name $value"
99 TARGET_BASE_ARCH=*) # configuration
100 target_base_arch=${line#*=}
101 base_arch_name=$(echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]')
102 echo "#define TARGET_$base_arch_name 1"
104 TARGET_XML_FILES=*)
105 # do nothing
107 TARGET_ABI_DIR=*)
108 # do nothing
110 TARGET_NAME=*)
111 target_name=${line#*=}
112 echo "#define TARGET_NAME \"$target_name\""
114 TARGET_DIRS=*)
115 # do nothing
117 TARGET_*=y) # configuration
118 name=${line%=*}
119 echo "#define $name 1"
121 TARGET_*=*) # configuration
122 name=${line%=*}
123 value=${line#*=}
124 echo "#define $name $value"
126 DSOSUF=*)
127 echo "#define HOST_DSOSUF \"${line#*=}\""
129 esac
131 done # read