]> Git Repo - qemu.git/blob - scripts/create_config
Merge remote-tracking branch 'sstabellini/xen_fixes_20130603' 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  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_*=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  ARCH=*) # configuration
61     arch=${line#*=}
62     arch_name=`echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
63     echo "#define HOST_$arch_name 1"
64     ;;
65  HOST_USB=*)
66     # do nothing
67     ;;
68  HOST_CC=*)
69     # do nothing
70     ;;
71  HOST_*=y) # configuration
72     name=${line%=*}
73     echo "#define $name 1"
74     ;;
75  HOST_*=*) # configuration
76     name=${line%=*}
77     value=${line#*=}
78     echo "#define $name $value"
79     ;;
80  TARGET_ARCH=*) # configuration
81     target_arch=${line#*=}
82     echo "#define TARGET_ARCH \"$target_arch\""
83     ;;
84  TARGET_BASE_ARCH=*) # configuration
85     target_base_arch=${line#*=}
86     if [ "$target_base_arch" != "$target_arch" ]; then
87       base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'`
88       echo "#define TARGET_$base_arch_name 1"
89     fi
90     ;;
91  TARGET_XML_FILES=*)
92     # do nothing
93     ;;
94  TARGET_ABI_DIR=*)
95     # do nothing
96     ;;
97  TARGET_ARCH2=*)
98     # do nothing
99     ;;
100  TARGET_DIRS=*)
101     # do nothing
102     ;;
103  TARGET_*=y) # configuration
104     name=${line%=*}
105     echo "#define $name 1"
106     ;;
107  TARGET_*=*) # configuration
108     name=${line%=*}
109     value=${line#*=}
110     echo "#define $name $value"
111     ;;
112 esac
113
114 done # read
This page took 0.030694 seconds and 4 git commands to generate.