Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 3 | while read line; do |
| 4 | |
| 5 | case $line in |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame^] | 6 | VERSION=*) # configuration |
| 7 | version=${line#*=} |
| 8 | echo "#define QEMU_VERSION \"$version\"" |
| 9 | ;; |
| 10 | PKGVERSION=*) # configuration |
| 11 | pkgversion=${line#*=} |
| 12 | echo "#define QEMU_PKGVERSION \"$pkgversion\"" |
| 13 | ;; |
| 14 | ARCH=*) # configuration |
| 15 | arch=${line#*=} |
| 16 | arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'` |
| 17 | echo "#define HOST_$arch_name 1" |
| 18 | ;; |
| 19 | CONFIG__sparc_*=y) # configuration |
| 20 | name=${line%=*} |
| 21 | name=${name#CONFIG} |
| 22 | value=${line#*=} |
| 23 | echo "#define $name $value" |
| 24 | ;; |
| 25 | CONFIG_AUDIO_DRIVERS=*) |
| 26 | drivers=${line#*=} |
| 27 | echo "#define CONFIG_AUDIO_DRIVERS \\" |
| 28 | for drv in $drivers; do |
| 29 | echo " &${drv}_audio_driver,\\" |
| 30 | done |
| 31 | echo "" |
| 32 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 33 | CONFIG_*=y) # configuration |
| 34 | name=${line%=*} |
| 35 | echo "#define $name 1" |
| 36 | ;; |
| 37 | CONFIG_*=*) # configuration |
| 38 | name=${line%=*} |
| 39 | value=${line#*=} |
| 40 | echo "#define $name $value" |
| 41 | ;; |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame^] | 42 | ARCH=*) # configuration |
| 43 | arch=${line#*=} |
| 44 | arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'` |
| 45 | echo "#define HOST_$arch_name 1" |
| 46 | ;; |
| 47 | HOST_USB=*) |
| 48 | # do nothing |
| 49 | ;; |
| 50 | HOST_CC=*) |
| 51 | # do nothing |
| 52 | ;; |
| 53 | HOST_*=y) # configuration |
| 54 | name=${line%=*} |
| 55 | echo "#define $name 1" |
| 56 | ;; |
| 57 | HOST_*=*) # configuration |
| 58 | name=${line%=*} |
| 59 | value=${line#*=} |
| 60 | echo "#define $name $value" |
| 61 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 62 | TARGET_ARCH=*) # configuration |
| 63 | target_arch=${line#*=} |
| 64 | arch_name=`echo $target_arch | tr '[:lower:]' '[:upper:]'` |
| 65 | echo "#define TARGET_ARCH \"$target_arch\"" |
| 66 | echo "#define TARGET_$arch_name 1" |
| 67 | ;; |
| 68 | TARGET_BASE_ARCH=*) # configuration |
| 69 | target_base_arch=${line#*=} |
| 70 | if [ "$target_base_arch" != "$target_arch" ]; then |
| 71 | base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'` |
| 72 | echo "#define TARGET_$base_arch_name 1" |
| 73 | fi |
| 74 | ;; |
| 75 | TARGET_XML_FILES=*) |
| 76 | # do nothing |
| 77 | ;; |
| 78 | TARGET_ABI_DIR=*) |
| 79 | # do nothing |
| 80 | ;; |
| 81 | TARGET_ARCH2=*) |
| 82 | # do nothing |
| 83 | ;; |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame^] | 84 | TARGET_DIRS=*) |
| 85 | # do nothing |
| 86 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 87 | TARGET_*=y) # configuration |
| 88 | name=${line%=*} |
| 89 | echo "#define $name 1" |
| 90 | ;; |
| 91 | TARGET_*=*) # configuration |
| 92 | name=${line%=*} |
| 93 | value=${line#*=} |
| 94 | echo "#define $name $value" |
| 95 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 96 | esac |
| 97 | |
| 98 | done # read |