Commit 42bc608b2a144dfa5141dd6ba5d12cb97ac804a7

Authored by Juan Quintela
Committed by Anthony Liguori
1 parent f57975fb

Generate $target_dir/config.h from $target_dir/config.mak

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 2 changed files with 67 additions and 30 deletions
configure
... ... @@ -1877,17 +1877,14 @@ ln -s $source_path/Makefile.target $target_dir/Makefile
1877 1877  
1878 1878  
1879 1879 echo "# Automatically generated by configure - do not modify" > $config_mak
1880   -echo "/* Automatically generated by configure - do not modify */" > $config_h
1881   -
1882 1880  
1883 1881 echo "include ../config-host.mak" >> $config_mak
1884   -echo "#include \"../config-host.h\"" >> $config_h
1885 1882  
1886 1883 bflt="no"
1887 1884 elfload32="no"
1888 1885 target_nptl="no"
1889 1886 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
1890   -echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
  1887 +echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_mak
1891 1888 gdb_xml_files=""
1892 1889  
1893 1890 TARGET_ARCH="$target_arch2"
... ... @@ -1928,20 +1925,20 @@ case &quot;$target_arch2&quot; in
1928 1925 ;;
1929 1926 mips|mipsel)
1930 1927 TARGET_ARCH=mips
1931   - echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
  1928 + echo "TARGET_ABI_MIPSO32=y" >> $config_mak
1932 1929 target_nptl="yes"
1933 1930 target_phys_bits=64
1934 1931 ;;
1935 1932 mipsn32|mipsn32el)
1936 1933 TARGET_ARCH=mipsn32
1937 1934 TARGET_BASE_ARCH=mips
1938   - echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
  1935 + echo "TARGET_ABI_MIPSN32=y" >> $config_mak
1939 1936 target_phys_bits=64
1940 1937 ;;
1941 1938 mips64|mips64el)
1942 1939 TARGET_ARCH=mips64
1943 1940 TARGET_BASE_ARCH=mips
1944   - echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
  1941 + echo "TARGET_ABI_MIPSN64=y" >> $config_mak
1945 1942 target_phys_bits=64
1946 1943 ;;
1947 1944 ppc)
... ... @@ -1964,7 +1961,7 @@ case &quot;$target_arch2&quot; in
1964 1961 TARGET_ARCH=ppc64
1965 1962 TARGET_BASE_ARCH=ppc
1966 1963 TARGET_ABI_DIR=ppc
1967   - echo "#define TARGET_ABI32 1" >> $config_h
  1964 + echo "TARGET_ABI32=y" >> $config_mak
1968 1965 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1969 1966 target_phys_bits=64
1970 1967 ;;
... ... @@ -1986,7 +1983,7 @@ case &quot;$target_arch2&quot; in
1986 1983 TARGET_ARCH=sparc64
1987 1984 TARGET_BASE_ARCH=sparc
1988 1985 TARGET_ABI_DIR=sparc
1989   - echo "#define TARGET_ABI32 1" >> $config_h
  1986 + echo "TARGET_ABI32=y" >> $config_mak
1990 1987 target_phys_bits=64
1991 1988 ;;
1992 1989 *)
... ... @@ -1996,14 +1993,9 @@ case &quot;$target_arch2&quot; in
1996 1993 esac
1997 1994 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak
1998 1995 echo "TARGET_ARCH2=$target_arch2" >> $config_mak
1999   -echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
2000   -target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`
2001   -echo "#define TARGET_$target_arch_name 1" >> $config_h
  1996 +# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
2002 1997 if [ "$TARGET_BASE_ARCH" = "" ]; then
2003 1998 TARGET_BASE_ARCH=$TARGET_ARCH
2004   -else
2005   - target_base_arch_name=`echo $TARGET_BASE_ARCH | tr '[:lower:]' '[:upper:]'`
2006   - echo "#define TARGET_$target_base_arch_name 1" >> $config_h
2007 1999 fi
2008 2000 echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_mak
2009 2001 if [ "$TARGET_ABI_DIR" = "" ]; then
... ... @@ -2017,12 +2009,10 @@ case &quot;$target_arch2&quot; in
2017 2009 i386|x86_64)
2018 2010 if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
2019 2011 echo "CONFIG_XEN=y" >> $config_mak
2020   - echo "#define CONFIG_XEN 1" >> $config_h
2021 2012 fi
2022 2013 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
2023 2014 then
2024 2015 echo "CONFIG_KQEMU=y" >> $config_mak
2025   - echo "#define CONFIG_KQEMU 1" >> $config_h
2026 2016 fi
2027 2017 esac
2028 2018 case "$target_arch2" in
... ... @@ -2035,31 +2025,25 @@ case &quot;$target_arch2&quot; in
2035 2025 \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then
2036 2026 echo "CONFIG_KVM=y" >> $config_mak
2037 2027 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
2038   - echo "#define CONFIG_KVM 1" >> $config_h
2039 2028 fi
2040 2029 esac
2041 2030 echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
2042   -echo "#define TARGET_PHYS_ADDR_BITS $target_phys_bits" >> $config_h
  2031 +echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_mak
2043 2032 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
2044 2033 if test "$target_bigendian" = "yes" ; then
2045   - echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
2046   - echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
  2034 + echo "TARGET_WORDS_BIGENDIAN=y" >> $config_mak
2047 2035 fi
2048 2036 if test "$target_softmmu" = "yes" ; then
2049 2037 echo "CONFIG_SOFTMMU=y" >> $config_mak
2050   - echo "#define CONFIG_SOFTMMU 1" >> $config_h
2051 2038 fi
2052 2039 if test "$target_user_only" = "yes" ; then
2053 2040 echo "CONFIG_USER_ONLY=y" >> $config_mak
2054   - echo "#define CONFIG_USER_ONLY 1" >> $config_h
2055 2041 fi
2056 2042 if test "$target_linux_user" = "yes" ; then
2057 2043 echo "CONFIG_LINUX_USER=y" >> $config_mak
2058   - echo "#define CONFIG_LINUX_USER 1" >> $config_h
2059 2044 fi
2060 2045 if test "$target_darwin_user" = "yes" ; then
2061 2046 echo "CONFIG_DARWIN_USER=y" >> $config_mak
2062   - echo "#define CONFIG_DARWIN_USER 1" >> $config_h
2063 2047 fi
2064 2048 list=""
2065 2049 if test ! -z "$gdb_xml_files" ; then
... ... @@ -2072,28 +2056,26 @@ echo &quot;TARGET_XML_FILES=$list&quot; &gt;&gt; $config_mak
2072 2056 case "$target_arch2" in
2073 2057 arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|sparc|sparc64|sparc32plus)
2074 2058 echo "CONFIG_SOFTFLOAT=y" >> $config_mak
2075   - echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
2076 2059 ;;
2077 2060 esac
2078 2061  
2079 2062 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2080 2063 echo "TARGET_HAS_BFLT=y" >> $config_mak
2081   - echo "#define TARGET_HAS_BFLT 1" >> $config_h
2082 2064 fi
2083 2065 if test "$target_user_only" = "yes" \
2084 2066 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2085   - echo "#define USE_NPTL 1" >> $config_h
  2067 + echo "USE_NPTL=y" >> $config_mak
2086 2068 fi
2087 2069 # 32 bit ELF loader in addition to native 64 bit loader?
2088 2070 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
2089 2071 echo "TARGET_HAS_ELFLOAD32=y" >> $config_mak
2090   - echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2091 2072 fi
2092 2073 if test "$target_bsd_user" = "yes" ; then
2093 2074 echo "CONFIG_BSD_USER=y" >> $config_mak
2094   - echo "#define CONFIG_BSD_USER 1" >> $config_h
2095 2075 fi
2096 2076  
  2077 +$source_path/create_config < $config_mak > $config_h
  2078 +
2097 2079 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2098 2080  
2099 2081 done # for target in $targets
... ...
create_config 0 → 100755
  1 +#!/bin/sh
  2 +
  3 +echo "/* Automatically generated by configure - do not modify */"
  4 +echo "#include \"../config-host.h\""
  5 +
  6 +while read line; do
  7 +
  8 +case $line in
  9 + CONFIG_*=y) # configuration
  10 + name=${line%=*}
  11 + echo "#define $name 1"
  12 + ;;
  13 + CONFIG_*=*) # configuration
  14 + name=${line%=*}
  15 + value=${line#*=}
  16 + echo "#define $name $value"
  17 + ;;
  18 + TARGET_ARCH=*) # configuration
  19 + target_arch=${line#*=}
  20 + arch_name=`echo $target_arch | tr '[:lower:]' '[:upper:]'`
  21 + echo "#define TARGET_ARCH \"$target_arch\""
  22 + echo "#define TARGET_$arch_name 1"
  23 + ;;
  24 + TARGET_BASE_ARCH=*) # configuration
  25 + target_base_arch=${line#*=}
  26 + if [ "$target_base_arch" != "$target_arch" ]; then
  27 + base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'`
  28 + echo "#define TARGET_$base_arch_name 1"
  29 + fi
  30 + ;;
  31 + TARGET_XML_FILES=*)
  32 + # do nothing
  33 + ;;
  34 + TARGET_ABI_DIR=*)
  35 + # do nothing
  36 + ;;
  37 + TARGET_ARCH2=*)
  38 + # do nothing
  39 + ;;
  40 + TARGET_*=y) # configuration
  41 + name=${line%=*}
  42 + echo "#define $name 1"
  43 + ;;
  44 + TARGET_*=*) # configuration
  45 + name=${line%=*}
  46 + value=${line#*=}
  47 + echo "#define $name $value"
  48 + ;;
  49 + USE_NPTL=y) # configuration
  50 + name=${line%=*}
  51 + echo "#define $name 1"
  52 + ;;
  53 +esac
  54 +
  55 +done # read
... ...