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 | ;; |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 19 | CONFIG_AUDIO_DRIVERS=*) |
| 20 | drivers=${line#*=} |
| 21 | echo "#define CONFIG_AUDIO_DRIVERS \\" |
| 22 | for drv in $drivers; do |
| 23 | echo " &${drv}_audio_driver,\\" |
| 24 | done |
| 25 | echo "" |
| 26 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 27 | CONFIG_*=y) # configuration |
| 28 | name=${line%=*} |
| 29 | echo "#define $name 1" |
| 30 | ;; |
| 31 | CONFIG_*=*) # configuration |
| 32 | name=${line%=*} |
| 33 | value=${line#*=} |
| 34 | echo "#define $name $value" |
| 35 | ;; |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 36 | ARCH=*) # configuration |
| 37 | arch=${line#*=} |
| 38 | arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'` |
| 39 | echo "#define HOST_$arch_name 1" |
| 40 | ;; |
| 41 | HOST_USB=*) |
| 42 | # do nothing |
| 43 | ;; |
| 44 | HOST_CC=*) |
| 45 | # do nothing |
| 46 | ;; |
| 47 | HOST_*=y) # configuration |
| 48 | name=${line%=*} |
| 49 | echo "#define $name 1" |
| 50 | ;; |
| 51 | HOST_*=*) # configuration |
| 52 | name=${line%=*} |
| 53 | value=${line#*=} |
| 54 | echo "#define $name $value" |
| 55 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 56 | TARGET_ARCH=*) # configuration |
| 57 | target_arch=${line#*=} |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 58 | echo "#define TARGET_ARCH \"$target_arch\"" |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 59 | ;; |
| 60 | TARGET_BASE_ARCH=*) # configuration |
| 61 | target_base_arch=${line#*=} |
| 62 | if [ "$target_base_arch" != "$target_arch" ]; then |
| 63 | base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'` |
| 64 | echo "#define TARGET_$base_arch_name 1" |
| 65 | fi |
| 66 | ;; |
| 67 | TARGET_XML_FILES=*) |
| 68 | # do nothing |
| 69 | ;; |
| 70 | TARGET_ABI_DIR=*) |
| 71 | # do nothing |
| 72 | ;; |
| 73 | TARGET_ARCH2=*) |
| 74 | # do nothing |
| 75 | ;; |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 76 | TARGET_DIRS=*) |
| 77 | # do nothing |
| 78 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 79 | TARGET_*=y) # configuration |
| 80 | name=${line%=*} |
| 81 | echo "#define $name 1" |
| 82 | ;; |
| 83 | TARGET_*=*) # configuration |
| 84 | name=${line%=*} |
| 85 | value=${line#*=} |
| 86 | echo "#define $name $value" |
| 87 | ;; |
Juan Quintela | 42bc608 | 2009-07-16 18:34:20 +0200 | [diff] [blame] | 88 | esac |
| 89 | |
| 90 | done # read |