aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-28 20:45:46 +0300
committerAvi Kivity <avi@redhat.com>2009-07-28 20:45:46 +0300
commitdd93aa4ddbda4a3b69fd04d16407868b5de9df00 (patch)
tree281ca109032e849b7d31759093b7ef2e27f36dd4
parent2b2cd95530d9eb52b1dbce15d78745e8a4cd7bd5 (diff)
parent42bc608b2a144dfa5141dd6ba5d12cb97ac804a7 (diff)
Merge commit '42bc608b2a144dfa5141dd6ba5d12cb97ac804a7' into upstream-merge
* commit '42bc608b2a144dfa5141dd6ba5d12cb97ac804a7': Generate $target_dir/config.h from $target_dir/config.mak Refactor config_softfloat selection in another list Conflicts: configure create_config (support USE_KVM_*) Signed-off-by: Avi Kivity <avi@redhat.com>
-rwxr-xr-xconfigure70
-rwxr-xr-xcreate_config58
2 files changed, 76 insertions, 52 deletions
diff --git a/configure b/configure
index 652d824de..9344f3bd5 100755
--- a/configure
+++ b/configure
@@ -2029,17 +2029,14 @@ ln -s $source_path/Makefile.target $target_dir/Makefile
echo "# Automatically generated by configure - do not modify" > $config_mak
-echo "/* Automatically generated by configure - do not modify */" > $config_h
-
echo "include ../config-host.mak" >> $config_mak
-echo "#include \"../config-host.h\"" >> $config_h
bflt="no"
elfload32="no"
target_nptl="no"
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
-echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
+echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_mak
gdb_xml_files=""
disable_cpu_emulation() {
@@ -2052,16 +2049,13 @@ disable_cpu_emulation() {
configure_kvm() {
if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
\( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
- echo "#define CONFIG_KVM 1" >> $config_h
echo "CONFIG_KVM=y" >> $config_mak
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
if test $kvm_cap_pit = "yes" ; then
echo "USE_KVM_PIT=1" >> $config_mak
- echo "#define USE_KVM_PIT 1" >> $config_h
fi
if test $kvm_cap_device_assignment = "yes" ; then
echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
- echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
fi
disable_cpu_emulation
fi
@@ -2111,20 +2105,20 @@ case "$target_arch2" in
;;
mips|mipsel)
TARGET_ARCH=mips
- echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
+ echo "TARGET_ABI_MIPSO32=y" >> $config_mak
target_nptl="yes"
target_phys_bits=64
;;
mipsn32|mipsn32el)
TARGET_ARCH=mipsn32
TARGET_BASE_ARCH=mips
- echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
+ echo "TARGET_ABI_MIPSN32=y" >> $config_mak
target_phys_bits=64
;;
mips64|mips64el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
- echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
+ echo "TARGET_ABI_MIPSN64=y" >> $config_mak
target_phys_bits=64
;;
ppc)
@@ -2147,7 +2141,7 @@ case "$target_arch2" in
TARGET_ARCH=ppc64
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
- echo "#define TARGET_ABI32 1" >> $config_h
+ echo "TARGET_ABI32=y" >> $config_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
target_phys_bits=64
;;
@@ -2169,7 +2163,7 @@ case "$target_arch2" in
TARGET_ARCH=sparc64
TARGET_BASE_ARCH=sparc
TARGET_ABI_DIR=sparc
- echo "#define TARGET_ABI32 1" >> $config_h
+ echo "TARGET_ABI32=y" >> $config_mak
target_phys_bits=64
;;
*)
@@ -2179,14 +2173,9 @@ case "$target_arch2" in
esac
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak
echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
-target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`
-echo "#define TARGET_$target_arch_name 1" >> $config_h
+# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
if [ "$TARGET_BASE_ARCH" = "" ]; then
TARGET_BASE_ARCH=$TARGET_ARCH
-else
- target_base_arch_name=`echo $TARGET_BASE_ARCH | tr '[:lower:]' '[:upper:]'`
- echo "#define TARGET_$target_base_arch_name 1" >> $config_h
fi
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_mak
if [ "$TARGET_ABI_DIR" = "" ]; then
@@ -2200,12 +2189,10 @@ case "$target_arch2" in
i386|x86_64)
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
echo "CONFIG_XEN=y" >> $config_mak
- echo "#define CONFIG_XEN 1" >> $config_h
fi
if test $kqemu = "yes" -a "$target_softmmu" = "yes"
then
echo "CONFIG_KQEMU=y" >> $config_mak
- echo "#define CONFIG_KQEMU 1" >> $config_h
fi
esac
case "$target_arch2" in
@@ -2218,32 +2205,26 @@ case "$target_arch2" in
\( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then
echo "CONFIG_KVM=y" >> $config_mak
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
- echo "#define CONFIG_KVM 1" >> $config_h
configure_kvm
fi
esac
echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
-echo "#define TARGET_PHYS_ADDR_BITS $target_phys_bits" >> $config_h
+echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_mak
echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
if test "$target_bigendian" = "yes" ; then
- echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
- echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
+ echo "TARGET_WORDS_BIGENDIAN=y" >> $config_mak
fi
if test "$target_softmmu" = "yes" ; then
echo "CONFIG_SOFTMMU=y" >> $config_mak
- echo "#define CONFIG_SOFTMMU 1" >> $config_h
fi
if test "$target_user_only" = "yes" ; then
echo "CONFIG_USER_ONLY=y" >> $config_mak
- echo "#define CONFIG_USER_ONLY 1" >> $config_h
fi
if test "$target_linux_user" = "yes" ; then
echo "CONFIG_LINUX_USER=y" >> $config_mak
- echo "#define CONFIG_LINUX_USER 1" >> $config_h
fi
if test "$target_darwin_user" = "yes" ; then
echo "CONFIG_DARWIN_USER=y" >> $config_mak
- echo "#define CONFIG_DARWIN_USER 1" >> $config_h
fi
list=""
if test ! -z "$gdb_xml_files" ; then
@@ -2253,44 +2234,29 @@ if test ! -z "$gdb_xml_files" ; then
fi
echo "TARGET_XML_FILES=$list" >> $config_mak
-if test "$target_arch2" = "arm" \
- -o "$target_arch2" = "armeb" \
- -o "$target_arch2" = "m68k" \
- -o "$target_arch2" = "microblaze" \
- -o "$target_arch2" = "mips" \
- -o "$target_arch2" = "mipsel" \
- -o "$target_arch2" = "mipsn32" \
- -o "$target_arch2" = "mipsn32el" \
- -o "$target_arch2" = "mips64" \
- -o "$target_arch2" = "mips64el" \
- -o "$target_arch2" = "ppc" \
- -o "$target_arch2" = "ppc64" \
- -o "$target_arch2" = "ppc64abi32" \
- -o "$target_arch2" = "ppcemb" \
- -o "$target_arch2" = "sparc" \
- -o "$target_arch2" = "sparc64" \
- -o "$target_arch2" = "sparc32plus"; then
- echo "CONFIG_SOFTFLOAT=y" >> $config_mak
- echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
-fi
+case "$target_arch2" in
+ arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|sparc|sparc64|sparc32plus)
+ echo "CONFIG_SOFTFLOAT=y" >> $config_mak
+ ;;
+esac
+
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
echo "TARGET_HAS_BFLT=y" >> $config_mak
- echo "#define TARGET_HAS_BFLT 1" >> $config_h
fi
if test "$target_user_only" = "yes" \
-a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
- echo "#define USE_NPTL 1" >> $config_h
+ echo "USE_NPTL=y" >> $config_mak
fi
# 32 bit ELF loader in addition to native 64 bit loader?
if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
echo "TARGET_HAS_ELFLOAD32=y" >> $config_mak
- echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
fi
if test "$target_bsd_user" = "yes" ; then
echo "CONFIG_BSD_USER=y" >> $config_mak
- echo "#define CONFIG_BSD_USER 1" >> $config_h
fi
+$source_path/create_config < $config_mak > $config_h
+
test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
done # for target in $targets
diff --git a/create_config b/create_config
new file mode 100755
index 000000000..b7b33bb3d
--- /dev/null
+++ b/create_config
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+echo "/* Automatically generated by configure - do not modify */"
+echo "#include \"../config-host.h\""
+
+while read line; do
+
+case $line in
+ CONFIG_*=y) # configuration
+ name=${line%=*}
+ echo "#define $name 1"
+ ;;
+ CONFIG_*=*) # configuration
+ name=${line%=*}
+ value=${line#*=}
+ echo "#define $name $value"
+ ;;
+ TARGET_ARCH=*) # configuration
+ target_arch=${line#*=}
+ arch_name=`echo $target_arch | tr '[:lower:]' '[:upper:]'`
+ echo "#define TARGET_ARCH \"$target_arch\""
+ echo "#define TARGET_$arch_name 1"
+ ;;
+ TARGET_BASE_ARCH=*) # configuration
+ target_base_arch=${line#*=}
+ if [ "$target_base_arch" != "$target_arch" ]; then
+ base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'`
+ echo "#define TARGET_$base_arch_name 1"
+ fi
+ ;;
+ TARGET_XML_FILES=*)
+ # do nothing
+ ;;
+ TARGET_ABI_DIR=*)
+ # do nothing
+ ;;
+ TARGET_ARCH2=*)
+ # do nothing
+ ;;
+ TARGET_*=y) # configuration
+ name=${line%=*}
+ echo "#define $name 1"
+ ;;
+ TARGET_*=*) # configuration
+ name=${line%=*}
+ value=${line#*=}
+ echo "#define $name $value"
+ ;;
+ USE_NPTL=y) # configuration
+ name=${line%=*}
+ echo "#define $name 1"
+ ;;
+ USE_KVM_*)
+ echo "#define $(echo "$line" | sed 's/=/ /')"
+ ;;
+esac
+
+done # read