Skip to contentSkip to conversation

More Build System cleanups (v3)

PATCH New [email protected] 1 participant 27 messages Jul 13, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

cover More Build System cleanups (v3)

From: Juan Quintela <[email protected]>

Hi

Yet more cleanups. Apart from rebasing to today qemu, I have:

Re-factor ARCH/TARGET_ARCH code to avoid duplicated code.
That code is not finished yet, but you can get one idea of the way that I think should be cleaned.

Basically I am:
a- generating the config*.h variables from the config*.mak variables
(that is still done on configure, but will be done other place at some point).
b- use the pattern:
var=""
case $other_var in
.... lot of stuff ....
esac
if [ "$var" = "" ]; then
var=default_value
fi
.... use $var ....

Anthony, just feel free to stop on the 19 patch (that is the last one that I sent in the previous series).

As always, any comments, suggestions?

Later, Juan.

v2:

This series rebase my changes on top of today git. Also add more cleanups. Anthony, feel free to cherry pick any patches that you like, if you don't want all of them.

- The bigger stuff here is move to only one qemu compilation rule for both bsd-user/darwin-user/linux-user/softmmu (the only thing that really changed was ARLIBS

- Start moving CFLAGS/LDFLAGS setup to ./configure. Just removed OS_* and ARCH_*, planing how to move the other ones.

Comments? For yesterday series, only comment was that we needed more of it :)

Later, Juan "compiling for qemu ifdef removal prize"

v1:

More cleanups, 1st two are two compile fixes for my previous series (the XEN one already sent to the list.

Generate TARGET_BASE_ARCH and TARGET_CPU on configure, and then we don't complicate Makefile.target having to regerate it.

Switch all objects that depends of one traget to obj-$(TARGET_BASE_ARCH)-y variable, that way we would be able to share Makefiles at some point.

Once there, fix kvm, xen and kqemu to not being duplicated for each arch that support i.t

Juan Quintela (26):
fix XEN Build
fix sparc not solaris build
Remove duplicated definition
use block-nested-y for files inside block/
use nwfpe-obj-y for consistence
Remove unused Makefile variable
already defined several lines before in block-obj-y configure already knows what TARGET_BASE_ARCH we need, no need to put
the logic in Makefile.target
TARGET_ARCH2 is already known at configure time.
change ifdefs by obj-$(TARGET_BASE_ARCH)
configure xen in a single place
configure kvm in a single place
configure kqemu in a single place
BASE_LDFLAGS is not used anywhere else
TARGET_ARCH == TARGET_BASE_ARCH in m68k and arm
Refactor a single rule to generate all qemu-* executables qemu binary don't exist anymore. I guess not much people is
compiling on alpha
We can wrap OS_CFLAGS/OS_LDFLAGS in CFLAGS/LDFLAGS at configure time We can wrap ARCH_CFLAGS/ARCH_LDFLAGS in CFLAGS/LDFLAGS at configure
time
generate ARCH name instead of coding it
Refactor common code using a list
Refactor targe_bigendian selection in another list
print only once TARGET_ARCH
Only setup TARGET_ARCH when it is different of
generate TARGET_ARCH for config.h
generate TARGET_<arch name> for config.h

 Makefile        |   26 +++---
 Makefile.hw     |    3 -
 Makefile.target |  282 ++++++++++++++++++++++---------------------------------
 configure       |  260 ++++++++++++++-------------------------------------
 4 files changed, 195 insertions(+), 376 deletions(-)
#1 lore raw

PATCH 1/26 fix XEN Build

From: Juan Quintela <[email protected]>

I miss s/yes/y/ in one place

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 1a71f3a..1b68c70 100644
@@ -544,7 +544,7 @@ endif
 
 # xen backend driver support
 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
-ifeq ($(CONFIG_XEN), yes)
+ifeq ($(CONFIG_XEN), y)
   LIBS += $(XEN_LIBS)
 endif
 
Signature · 1 line
1.6.2.5
#2 lore raw

PATCH 2/26 fix sparc not solaris build

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 1b68c70..a4cb506 100644
@@ -89,7 +89,7 @@ translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-tim
 endif
 
 ifeq ($(ARCH),sparc)
-  ifneq ($(CONFIG_SOLARIS),yes)
+  ifneq ($(CONFIG_SOLARIS),y)
     HELPER_CFLAGS+=-ffixed-i0
   endif
 endif
Signature · 1 line
1.6.2.5
#3 lore raw

PATCH 3/26 Remove duplicated definition

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
Makefile.target +0 -2
index a4cb506..ca11c75 100644
@@ -687,8 +687,6 @@ ifdef CONFIG_SLIRP
 CPPFLAGS+=-I$(SRC_PATH)/slirp
 endif
 
-LIBS+=$(PTHREADLIBS)
-LIBS+=$(CLOCKLIBS)
 # specific flags are needed for non soft mmu emulator
 ifdef CONFIG_STATIC
 LDFLAGS+=-static
Signature · 1 line
1.6.2.5
#4 lore raw

PATCH 4/26 use block-nested-y for files inside block/

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
Makefile +11 -9
index caf8530..365aad2 100644
@@ -67,23 +67,25 @@ recurse-all: $(SUBDIR_RULES)
 # block-obj-y is code used by both qemu system emulation and qemu-img
 
 block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
-block-obj-y += block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o
-block-obj-y += block/dmg.o block/bochs.o block/vpc.o block/vvfat.o
-block-obj-y += block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o
-block-obj-y += block/qcow2-snapshot.o
-block-obj-y += block/parallels.o block/nbd.o
-block-obj-y += nbd.o block.o aio.o
+block-obj-y += nbd.o block.o aio.o aes.o
+
+block-nested-y += cow.o qcow.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
+block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
+block-nested-y += parallels.o nbd.o
+
 
 ifdef CONFIG_WIN32
-block-obj-y += block/raw-win32.o
+block-nested-y += raw-win32.o
 else
 ifdef CONFIG_AIO
 block-obj-y += posix-aio-compat.o
 endif
-block-obj-y += block/raw-posix.o
+block-nested-y += raw-posix.o
 endif
 
-block-obj-$(CONFIG_CURL) += block/curl.o
+block-nested-$(CONFIG_CURL) += curl.o
+
+block-obj-y +=  $(addprefix block/, $(block-nested-y))
 
 ######################################################################
 # libqemu_common.a: Target independent part of system emulation. The
Signature · 1 line
1.6.2.5
#5 lore raw

PATCH 5/26 use nwfpe-obj-y for consistence

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile.target +4 -3
index ca11c75..48f0a6c 100644
@@ -336,9 +336,10 @@ ifeq ($(TARGET_ARCH), i386)
 obj-y += vm86.o
 endif
 ifeq ($(TARGET_ARCH), arm)
-obj-y += nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
-nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
- nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
+nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
+nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
+obj-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
+obj-y += arm-semi.o
 endif
 ifeq ($(TARGET_ARCH), m68k)
 obj-y += m68k-sim.o m68k-semi.o
Signature · 1 line
1.6.2.5
#6 lore raw

PATCH 6/26 Remove unused Makefile variable

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 48f0a6c..3a3e1db 100644
@@ -221,7 +221,7 @@ tcg/tcg.o: cpu.h
 
 # HELPER_CFLAGS is used for all the code compiled with static register
 # variables
-op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
+op_helper.o: CFLAGS += $(HELPER_CFLAGS)
 
 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
 
Signature · 1 line
1.6.2.5
#7 lore raw

PATCH 7/26 already defined several lines before in block-obj-y

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index 365aad2..f9ce954 100644
@@ -108,7 +108,7 @@ obj-y += sd.o ssi-sd.o
 obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
 obj-y += bt-hci-csr.o
 obj-y += buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
-obj-y += qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
+obj-y += qemu-char.o aio.o net-checksum.o savevm.o
 obj-y += msmouse.o ps2.o
 obj-y += qdev.o ssi.o
 
Signature · 1 line
1.6.2.5
#8 lore raw

PATCH 8/26 configure already knows what TARGET_BASE_ARCH we need, no need to put the logic in Makefile.target

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |   22 ++--------------------
 configure       |    8 ++++++++
 2 files changed, 10 insertions(+), 20 deletions(-)
Makefile.target +2 -20
index 3a3e1db..9f55041 100644
@@ -1,28 +1,10 @@
 include config.mak
 include $(SRC_PATH)/rules.mak
 
+ifndef TARGET_BASE_ARCH
 TARGET_BASE_ARCH:=$(TARGET_ARCH)
-ifeq ($(TARGET_ARCH), x86_64)
-TARGET_BASE_ARCH:=i386
-endif
-ifeq ($(TARGET_ARCH), mipsn32)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), mips64)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), ppc64)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppc64h)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppcemb)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), sparc64)
-TARGET_BASE_ARCH:=sparc
 endif
+
 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
configure +8 -0
index a55dbc5..02a5338 100755
@@ -1996,6 +1996,7 @@ case "$target_arch2" in
   ;;
   x86_64)
     echo "TARGET_ARCH=x86_64" >> $config_mak
+    echo "TARGET_BASE_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     echo "#define TARGET_X86_64 1" >> $config_h
@@ -2064,6 +2065,7 @@ case "$target_arch2" in
   ;;
   mipsn32|mipsn32el)
     echo "TARGET_ARCH=mipsn32" >> $config_mak
+    echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
@@ -2071,6 +2073,7 @@ case "$target_arch2" in
   ;;
   mips64|mips64el)
     echo "TARGET_ARCH=mips64" >> $config_mak
+    echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mips64\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_MIPS64 1" >> $config_h
@@ -2086,6 +2089,7 @@ case "$target_arch2" in
   ;;
   ppcemb)
     echo "TARGET_ARCH=ppcemb" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
@@ -2100,6 +2104,7 @@ case "$target_arch2" in
   ;;
   ppc64)
     echo "TARGET_ARCH=ppc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
@@ -2109,6 +2114,7 @@ case "$target_arch2" in
   ;;
   ppc64abi32)
     echo "TARGET_ARCH=ppc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
@@ -2134,6 +2140,7 @@ case "$target_arch2" in
   ;;
   sparc64)
     echo "TARGET_ARCH=sparc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
@@ -2142,6 +2149,7 @@ case "$target_arch2" in
   ;;
   sparc32plus)
     echo "TARGET_ARCH=sparc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
     echo "TARGET_ARCH2=sparc32plus" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
Signature · 1 line
1.6.2.5
#9 lore raw

PATCH 9/26 TARGET_ARCH2 is already known at configure time.

In reply to [email protected]

From: Juan Quintela <[email protected]>

Remove re-construction in Makefile.target

---
 Makefile.target |   25 -------------------------
 configure       |    7 ++++++-
 2 files changed, 6 insertions(+), 26 deletions(-)
Makefile.target +0 -25
index 9f55041..54c3568 100644
@@ -14,31 +14,6 @@ LIBS=
 ifndef TARGET_ARCH2
 TARGET_ARCH2=$(TARGET_ARCH)
 endif
-ifeq ($(TARGET_ARCH),arm)
-  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=armeb
-  endif
-endif
-ifeq ($(TARGET_ARCH),sh4)
-  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=sh4eb
-  endif
-endif
-ifeq ($(TARGET_ARCH),mips)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mipsel
-  endif
-endif
-ifeq ($(TARGET_ARCH),mipsn32)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mipsn32el
-  endif
-endif
-ifeq ($(TARGET_ARCH),mips64)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mips64el
-  endif
-endif
 
 ifdef CONFIG_USER_ONLY
 # user emulator name
configure +6 -1
index 02a5338..5beb64b 100755
@@ -2025,6 +2025,7 @@ case "$target_arch2" in
   ;;
   arm|armeb)
     echo "TARGET_ARCH=arm" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"arm\"" >> $config_h
     echo "#define TARGET_ARM 1" >> $config_h
     bflt="yes"
@@ -2057,6 +2058,7 @@ case "$target_arch2" in
   ;;
  mips|mipsel)
     echo "TARGET_ARCH=mips" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"mips\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
@@ -2065,6 +2067,7 @@ case "$target_arch2" in
   ;;
   mipsn32|mipsn32el)
     echo "TARGET_ARCH=mipsn32" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
@@ -2073,6 +2076,7 @@ case "$target_arch2" in
   ;;
   mips64|mips64el)
     echo "TARGET_ARCH=mips64" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mips64\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
@@ -2126,6 +2130,7 @@ case "$target_arch2" in
   ;;
   sh4|sh4eb)
     echo "TARGET_ARCH=sh4" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"sh4\"" >> $config_h
     echo "#define TARGET_SH4 1" >> $config_h
     bflt="yes"
@@ -2151,7 +2156,7 @@ case "$target_arch2" in
     echo "TARGET_ARCH=sparc64" >> $config_mak
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
-    echo "TARGET_ARCH2=sparc32plus" >> $config_mak
+    echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
Signature · 1 line
1.6.2.5
#10 lore raw

PATCH 10/26 change ifdefs by obj-$(TARGET_BASE_ARCH)

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |  181 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 93 insertions(+), 88 deletions(-)
Makefile.target +93 -88
index 54c3568..1037923 100644
@@ -519,122 +519,127 @@ obj-y += e1000.o
 # Generic watchdog support and some watchdog devices
 obj-y += wdt_ib700.o wdt_i6300esb.o
 
-ifeq ($(TARGET_BASE_ARCH), i386)
 # Hardware support
-obj-y += ide.o pckbd.o vga.o $(sound-obj-y) dma.o
-obj-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
-obj-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
-obj-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
-obj-y += device-hotplug.o pci-hotplug.o smbios.o
+obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
+obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
+obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
+obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
+obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
+
+ifeq ($(TARGET_BASE_ARCH), i386)
 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
 endif
-ifeq ($(TARGET_BASE_ARCH), ppc)
-CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+
 # shared objects
-obj-y += ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
+obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
 # PREP target
-obj-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
-obj-y += prep_pci.o ppc_prep.o
+obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
+obj-ppc-y += prep_pci.o ppc_prep.o
 # Mac shared devices
-obj-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
+obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
 # OldWorld PowerMac
-obj-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
+obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
 # NewWorld PowerMac
-obj-y += unin_pci.o ppc_newworld.o
+obj-ppc-y += unin_pci.o ppc_newworld.o
 # PowerPC 4xx boards
-obj-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
-obj-y += ppc440.o ppc440_bamboo.o
+obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
+obj-ppc-y += ppc440.o ppc440_bamboo.o
 # PowerPC E500 boards
-obj-y += ppce500_pci.o ppce500_mpc8544ds.o
+obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
+obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
+
+ifeq ($(TARGET_BASE_ARCH), ppc)
+CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+endif
+
 ifdef FDT_LIBS
-obj-y += device_tree.o
+obj-ppc-y += device_tree.o
 LIBS+= $(FDT_LIBS)
 endif
-obj-$(CONFIG_KVM) += kvm_ppc.o
-endif
+
+obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
+obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
+obj-mips-y += g364fb.o jazz_led.o dp8393x.o
+obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
+obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
+obj-mips-y += mipsnet.o
+obj-mips-y += pflash_cfi01.o
+obj-mips-y += vmware_vga.o
+
 ifeq ($(TARGET_BASE_ARCH), mips)
-obj-y += mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
-obj-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
-obj-y += g364fb.o jazz_led.o dp8393x.o
-obj-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
-obj-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
-obj-y += mipsnet.o
-obj-y += pflash_cfi01.o
-obj-y += vmware_vga.o
 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
 endif
-ifeq ($(TARGET_BASE_ARCH), microblaze)
-obj-y += petalogix_s3adsp1800_mmu.o
 
-obj-y += microblaze_pic_cpu.o
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o
-obj-y += xilinx_ethlite.o
+obj-microblaze-y = petalogix_s3adsp1800_mmu.o
+
+obj-microblaze-y += microblaze_pic_cpu.o
+obj-microblaze-y += xilinx_intc.o
+obj-microblaze-y += xilinx_timer.o
+obj-microblaze-y += xilinx_uartlite.o
+obj-microblaze-y += xilinx_ethlite.o
+
+obj-microblaze-y += pflash_cfi02.o
 
-obj-y += pflash_cfi02.o
 ifdef FDT_LIBS
-obj-y += device_tree.o
+obj-microblaze-y += device_tree.o
 LIBS+= $(FDT_LIBS)
 endif
-endif
-ifeq ($(TARGET_BASE_ARCH), cris)
+
 # Boards
-obj-y += cris_pic_cpu.o etraxfs.o axis_dev88.o
+obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
 
 # IO blocks
-obj-y += etraxfs_dma.o
-obj-y += etraxfs_pic.o
-obj-y += etraxfs_eth.o
-obj-y += etraxfs_timer.o
-obj-y += etraxfs_ser.o
+obj-cris-y += etraxfs_dma.o
+obj-cris-y += etraxfs_pic.o
+obj-cris-y += etraxfs_eth.o
+obj-cris-y += etraxfs_timer.o
+obj-cris-y += etraxfs_ser.o
+
+obj-cris-y += pflash_cfi02.o
 
-obj-y += pflash_cfi02.o
-endif
-ifeq ($(TARGET_BASE_ARCH), sparc)
 ifeq ($(TARGET_ARCH), sparc64)
-obj-y += sun4u.o ide.o pckbd.o vga.o apb_pci.o
-obj-y += fdc.o mc146818rtc.o serial.o
-obj-y += cirrus_vga.o parallel.o
+obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
+obj-sparc-y += fdc.o mc146818rtc.o serial.o
+obj-sparc-y += cirrus_vga.o parallel.o
 else
-obj-y += sun4m.o tcx.o iommu.o slavio_intctl.o
-obj-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
-obj-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
-endif
-endif
+obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
+obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
+obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
+endif
+
+obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
+obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
+obj-arm-y += versatile_pci.o
+obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
+obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
+obj-arm-y += pl061.o
+obj-arm-y += arm-semi.o
+obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
+obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
+obj-arm-y += pflash_cfi01.o gumstix.o
+obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
+obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o
+obj-arm-y += omap_sx1.o palm.o tsc210x.o
+obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
+obj-arm-y += mst_fpga.o mainstone.o
+obj-arm-y += musicpal.o pflash_cfi02.o
+obj-arm-y += framebuffer.o
+obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
+obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
+obj-arm-y += syborg_virtio.o
+
 ifeq ($(TARGET_BASE_ARCH), arm)
-obj-y += integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
-obj-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
-obj-y += versatile_pci.o
-obj-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
-obj-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
-obj-y += pl061.o
-obj-y += arm-semi.o
-obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
-obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
-obj-y += pflash_cfi01.o gumstix.o
-obj-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
-obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
-obj-y += omap2.o omap_dss.o soc_dma.o
-obj-y += omap_sx1.o palm.o tsc210x.o
-obj-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
-obj-y += mst_fpga.o mainstone.o
-obj-y += musicpal.o pflash_cfi02.o
-obj-y += framebuffer.o
-obj-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
-obj-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
-obj-y += syborg_virtio.o
 CPPFLAGS += -DHAS_AUDIO
 endif
-ifeq ($(TARGET_BASE_ARCH), sh4)
-obj-y += shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
-obj-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
-obj-y += ide.o
-endif
-ifeq ($(TARGET_BASE_ARCH), m68k)
-obj-y += an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
-obj-y += m68k-semi.o dummy_m68k.o
-endif
+
+obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
+obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
+obj-sh4-y += ide.o
+
+obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
+obj-m68k-y += m68k-semi.o dummy_m68k.o
+
 ifdef CONFIG_COCOA
 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
 ifdef CONFIG_COREAUDIO
@@ -685,8 +690,8 @@ monitor.o: qemu-monitor.h
 
 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
 $(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
-$(QEMU_PROG): $(obj-y) ../libqemu_common.a libqemu.a $(HWLIB)
-	$(call LINK,$(obj-y))
+$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../libqemu_common.a libqemu.a $(HWLIB)
+	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
 
 endif # !CONFIG_USER_ONLY
 
Signature · 1 line
1.6.2.5
#11 lore raw

PATCH 11/26 configure xen in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
configure +7 -10
index 5beb64b..ea17fb7 100755
@@ -1987,11 +1987,6 @@ case "$target_arch2" in
       echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
       echo "#define CONFIG_KVM 1" >> $config_h
     fi
-    if test "$xen" = "yes" -a "$target_softmmu" = "yes";
-    then
-      echo "CONFIG_XEN=y" >> $config_mak
-      echo "#define CONFIG_XEN 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -2010,11 +2005,6 @@ case "$target_arch2" in
       echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
       echo "#define CONFIG_KVM 1" >> $config_h
     fi
-    if test "$xen" = "yes" -a "$target_softmmu" = "yes"
-    then
-      echo "CONFIG_XEN=y" >> $config_mak
-      echo "#define CONFIG_XEN 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2171,6 +2161,13 @@ esac
 if [ $target_phys_bits -lt $hostlongbits ] ; then
   target_phys_bits=$hostlongbits
 fi
+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
+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 "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
Signature · 1 line
1.6.2.5
#12 lore raw

PATCH 12/26 configure kvm in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   40 ++++++++++++----------------------------
 1 files changed, 12 insertions(+), 28 deletions(-)
configure +12 -28
index ea17fb7..864cf77 100755
@@ -1958,19 +1958,6 @@ target_nptl="no"
 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 gdb_xml_files=""
-target_kvm="$kvm"
-
-# Make sure the target and host cpus are compatible
-if test ! \( "$target_arch2" = "$cpu" -o \
-  \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
-  \( "$target_arch2" = "x86_64" -a "$cpu" = "i386"   \) -o \
-  \( "$target_arch2" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
-  target_kvm="no"
-fi
-# Disable KVM for linux-user
-if test "$target_softmmu" = "no" ; then
-  target_kvm="no"
-fi
 
 case "$target_arch2" in
   i386)
@@ -1982,11 +1969,6 @@ case "$target_arch2" in
       echo "CONFIG_KQEMU=y" >> $config_mak
       echo "#define CONFIG_KQEMU 1" >> $config_h
     fi
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -2000,11 +1982,6 @@ case "$target_arch2" in
       echo "CONFIG_KQEMU=y" >> $config_mak
       echo "#define CONFIG_KQEMU 1" >> $config_h
     fi
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2088,11 +2065,6 @@ case "$target_arch2" in
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPCEMB 1" >> $config_h
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
   ;;
@@ -2168,6 +2140,18 @@ case "$target_arch2" in
       echo "#define CONFIG_XEN 1" >> $config_h
     fi
 esac
+case "$target_arch2" in
+  i386|x86_64|ppcemb)
+    # Make sure the target and host cpus are compatible
+    if test ! \( "$target_arch2" = "$cpu" -o \
+      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
+      \( "$target_arch2" = "x86_64" -a "$cpu" = "i386"   \) -o \
+      \( "$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
+    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 "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
Signature · 1 line
1.6.2.5
#13 lore raw

PATCH 13/26 configure kqemu in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
configure +5 -10
index 864cf77..b737c17 100755
@@ -1964,11 +1964,6 @@ case "$target_arch2" in
     echo "TARGET_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"i386\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
-    if test $kqemu = "yes" -a "$target_softmmu" = "yes"
-    then
-      echo "CONFIG_KQEMU=y" >> $config_mak
-      echo "#define CONFIG_KQEMU 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -1977,11 +1972,6 @@ case "$target_arch2" in
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     echo "#define TARGET_X86_64 1" >> $config_h
-    if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
-    then
-      echo "CONFIG_KQEMU=y" >> $config_mak
-      echo "#define CONFIG_KQEMU 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2139,6 +2129,11 @@ case "$target_arch2" in
       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
   i386|x86_64|ppcemb)
Signature · 1 line
1.6.2.5
#14 lore raw

PATCH 14/26 BASE_LDFLAGS is not used anywhere else

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
Makefile.target +0 -4
index 1037923..5d30df5 100644
@@ -56,10 +56,6 @@ ifeq ($(ARCH),alpha)
 CFLAGS+=-msmall-data
 endif
 
-ifeq ($(ARCH),hppa)
-BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-endif
-
 ifeq ($(ARCH),ia64)
 CFLAGS+=-mno-sdata
 endif
Signature · 1 line
1.6.2.5
#15 lore raw

PATCH 15/26 TARGET_ARCH == TARGET_BASE_ARCH in m68k and arm

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
Makefile.target +8 -9
index 5d30df5..bb2a93a 100644
@@ -288,23 +288,22 @@ obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
 ifeq ($(TARGET_ARCH), i386)
 obj-y += vm86.o
 endif
-ifeq ($(TARGET_ARCH), arm)
+
 nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
 nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
-obj-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
-obj-y += arm-semi.o
-endif
-ifeq ($(TARGET_ARCH), m68k)
-obj-y += m68k-sim.o m68k-semi.o
-endif
+obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
+obj-arm-y += arm-semi.o
+
+obj-m68k-y += m68k-sim.o m68k-semi.o
 
 # Note: this is a workaround. The real fix is to avoid compiling
 # cpu_signal_handler() in cpu-exec.c.
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
 $(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a
-$(QEMU_PROG): $(obj-y) ../libqemu_user.a libqemu.a
-	$(call LINK,$(obj-y))
+$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)  ../libqemu_user.a libqemu.a
+	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
+
 ifeq ($(ARCH),alpha)
 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
 # the address space (31 bit so sign extending doesn't matter)
Signature · 1 line
1.6.2.5
#16 lore raw

PATCH 16/26 Refactor a single rule to generate all qemu-* executables

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
Makefile.target +9 -13
index bb2a93a..bcacbbd 100644
@@ -300,9 +300,7 @@ obj-m68k-y += m68k-sim.o m68k-semi.o
 # cpu_signal_handler() in cpu-exec.c.
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
-$(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a
-$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)  ../libqemu_user.a libqemu.a
-	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
+ARLIBS=../libqemu_user.a libqemu.a
 
 ifeq ($(ARCH),alpha)
 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
@@ -332,9 +330,7 @@ obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
 # cpu_signal_handler() in cpu-exec.c.
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
-$(QEMU_PROG): ARLIBS=libqemu.a
-$(QEMU_PROG): $(obj-y) libqemu.a
-	$(call LINK,$(obj-y))
+ARLIBS=libqemu.a
 
 endif #CONFIG_DARWIN_USER
 
@@ -432,9 +428,7 @@ obj-y += uaccess.o
 # cpu_signal_handler() in cpu-exec.c.
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
-$(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a
-$(QEMU_PROG): $(obj-y) libqemu.a ../libqemu_user.a
-	$(call LINK,$(obj-y))
+ARLIBS=libqemu.a ../libqemu_user.a
 
 endif #CONFIG_BSD_USER
 
@@ -683,13 +677,15 @@ vl.o: qemu-options.h
 
 monitor.o: qemu-monitor.h
 
-$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
-$(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
-$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../libqemu_common.a libqemu.a $(HWLIB)
-	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
+LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
+ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
 
 endif # !CONFIG_USER_ONLY
 
+$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
+	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
+
+
 gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
 ifeq ($(TARGET_XML_FILES),)
 	$(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
Signature · 1 line
1.6.2.5
#17 lore raw

PATCH 17/26 qemu binary don't exist anymore. I guess not much people is compiling on alpha

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
Makefile.target +0 -7
index bcacbbd..a250c5d 100644
@@ -301,13 +301,6 @@ obj-m68k-y += m68k-sim.o m68k-semi.o
 signal.o: CFLAGS += $(HELPER_CFLAGS)
 
 ARLIBS=../libqemu_user.a libqemu.a
-
-ifeq ($(ARCH),alpha)
-# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
-# the address space (31 bit so sign extending doesn't matter)
-	echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
-endif
-
 endif #CONFIG_LINUX_USER
 
 #########################################################
Signature · 1 line
1.6.2.5
#18 lore raw

PATCH 18/26 We can wrap OS_CFLAGS/OS_LDFLAGS in CFLAGS/LDFLAGS at configure time

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile        |    4 ++--
 Makefile.hw     |    4 ++--
 Makefile.target |    4 ++--
 configure       |    6 ++----
 4 files changed, 8 insertions(+), 10 deletions(-)
Makefile +2 -2
index f9ce954..a9343b6 100644
@@ -17,8 +17,8 @@ endif
 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
 
 
-CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
-LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
+CFLAGS +=  $(ARCH_CFLAGS)
+LDFLAGS +=  $(ARCH_LDFLAGS)
 
 CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Makefile.hw +2 -2
index f7a9507..0cf591f 100644
@@ -8,8 +8,8 @@ include $(SRC_PATH)/rules.mak
 
 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
 
-CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
-LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
+CFLAGS += $(ARCH_CFLAGS)
+LDFLAGS += $(ARCH_LDFLAGS)
 
 CPPFLAGS += -I. -I.. -I$(SRC_PATH) -MMD -MP -MT $@
 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Makefile.target +2 -2
index a250c5d..df7c0d5 100644
@@ -60,8 +60,8 @@ ifeq ($(ARCH),ia64)
 CFLAGS+=-mno-sdata
 endif
 
-CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
-LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
+CFLAGS+= $(ARCH_CFLAGS)
+LDFLAGS+= $(ARCH_LDFLAGS)
 
 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 CPPFLAGS+=-U_FORTIFY_SOURCE
configure +2 -4
index b737c17..0550f21 100755
@@ -1486,12 +1486,10 @@ echo "AR=$ar" >> $config_mak
 # XXX: only use CFLAGS and LDFLAGS ?  
 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
 # compilation of dyngen tool (useful for win32 build on Linux host)
-echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
-echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
-echo "CFLAGS=$CFLAGS $EXTRA_CFLAGS" >> $config_mak
-echo "LDFLAGS=$LDFLAGS $EXTRA_LDFLAGS" >> $config_mak
+echo "CFLAGS=$CFLAGS $OS_CFLAGS $EXTRA_CFLAGS" >> $config_mak
+echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $EXTRA_LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
 echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak
 echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
Signature · 1 line
1.6.2.5
#19 lore raw

PATCH 19/26 We can wrap ARCH_CFLAGS/ARCH_LDFLAGS in CFLAGS/LDFLAGS at configure time

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile        |    4 ----
 Makefile.hw     |    3 ---
 Makefile.target |    3 ---
 configure       |    9 ++-------
 4 files changed, 2 insertions(+), 17 deletions(-)
Makefile +0 -4
index a9343b6..fe4d85c 100644
@@ -16,10 +16,6 @@ endif
 
 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
 
-
-CFLAGS +=  $(ARCH_CFLAGS)
-LDFLAGS +=  $(ARCH_LDFLAGS)
-
 CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 CPPFLAGS += -U_FORTIFY_SOURCE
Makefile.hw +0 -3
index 0cf591f..b309160 100644
@@ -8,9 +8,6 @@ include $(SRC_PATH)/rules.mak
 
 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
 
-CFLAGS += $(ARCH_CFLAGS)
-LDFLAGS += $(ARCH_LDFLAGS)
-
 CPPFLAGS += -I. -I.. -I$(SRC_PATH) -MMD -MP -MT $@
 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 CPPFLAGS+=-I$(SRC_PATH)/fpu
Makefile.target +0 -3
index df7c0d5..6883c44 100644
@@ -60,9 +60,6 @@ ifeq ($(ARCH),ia64)
 CFLAGS+=-mno-sdata
 endif
 
-CFLAGS+= $(ARCH_CFLAGS)
-LDFLAGS+= $(ARCH_LDFLAGS)
-
 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 CPPFLAGS+=-U_FORTIFY_SOURCE
 LIBS+=-lm
configure +2 -7
index 0550f21..c8415bf 100755
@@ -1483,13 +1483,8 @@ echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak
 echo "CC=$cc" >> $config_mak
 echo "HOST_CC=$host_cc" >> $config_mak
 echo "AR=$ar" >> $config_mak
-# XXX: only use CFLAGS and LDFLAGS ?  
-# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
-# compilation of dyngen tool (useful for win32 build on Linux host)
-echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
-echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
-echo "CFLAGS=$CFLAGS $OS_CFLAGS $EXTRA_CFLAGS" >> $config_mak
-echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $EXTRA_LDFLAGS" >> $config_mak
+echo "CFLAGS=$CFLAGS $OS_CFLAGS $ARCH_CFLAGS $EXTRA_CFLAGS" >> $config_mak
+echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $ARCH_LDFLAGS $EXTRA_LDFLAGS" >> $config_mak
 echo "EXESUF=$EXESUF" >> $config_mak
 echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak
 echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
Signature · 1 line
1.6.2.5
#20 lore raw

PATCH 20/26 generate ARCH name instead of coding it

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   55 +++++++++++++++++++++----------------------------------
 1 files changed, 21 insertions(+), 34 deletions(-)
configure +21 -34
index c8415bf..57d4538 100755
@@ -1490,78 +1490,65 @@ echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak
 echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
 case "$cpu" in
   i386)
-    echo "ARCH=i386" >> $config_mak
-    echo "#define HOST_I386 1" >> $config_h
+    ARCH=i386
   ;;
   x86_64)
-    echo "ARCH=x86_64" >> $config_mak
-    echo "#define HOST_X86_64 1" >> $config_h
+    ARCH=x86_64
   ;;
   alpha)
-    echo "ARCH=alpha" >> $config_mak
-    echo "#define HOST_ALPHA 1" >> $config_h
+   ARCH=alpha
   ;;
   armv4b)
-    echo "ARCH=arm" >> $config_mak
-    echo "#define HOST_ARM 1" >> $config_h
+    ARCH=arm
   ;;
   armv4l)
-    echo "ARCH=arm" >> $config_mak
-    echo "#define HOST_ARM 1" >> $config_h
+    ARCH=arm
   ;;
   cris)
-    echo "ARCH=cris" >> $config_mak
-    echo "#define HOST_CRIS 1" >> $config_h
+    ARCH=cris
   ;;
   hppa)
-    echo "ARCH=hppa" >> $config_mak
-    echo "#define HOST_HPPA 1" >> $config_h
+    ARCH=hppa
   ;;
   ia64)
-    echo "ARCH=ia64" >> $config_mak
-    echo "#define HOST_IA64 1" >> $config_h
+    ARCH=ia64
   ;;
   m68k)
-    echo "ARCH=m68k" >> $config_mak
-    echo "#define HOST_M68K 1" >> $config_h
+    ARCH=m68k
   ;;
   microblaze)
-    echo "ARCH=microblaze" >> $config_mak
-    echo "#define HOST_MICROBLAZE 1" >> $config_h
+    ARCH=microblaze
   ;;
   mips)
-    echo "ARCH=mips" >> $config_mak
-    echo "#define HOST_MIPS 1" >> $config_h
+    ARCH=mips
   ;;
   mips64)
-    echo "ARCH=mips64" >> $config_mak
-    echo "#define HOST_MIPS64 1" >> $config_h
+    ARCH=mips64
   ;;
   ppc)
-    echo "ARCH=ppc" >> $config_mak
-    echo "#define HOST_PPC 1" >> $config_h
+    ARCH=ppc
   ;;
   ppc64)
-    echo "ARCH=ppc64" >> $config_mak
-    echo "#define HOST_PPC64 1" >> $config_h
+    ARCH=ppc64
   ;;
   s390)
-    echo "ARCH=s390" >> $config_mak
-    echo "#define HOST_S390 1" >> $config_h
+    ARCH=s390
   ;;
   sparc)
-    echo "ARCH=sparc" >> $config_mak
-    echo "#define HOST_SPARC 1" >> $config_h
+    ARCH=sparc
   ;;
   sparc64)
-    echo "ARCH=sparc64" >> $config_mak
-    echo "#define HOST_SPARC64 1" >> $config_h
+    ARCH=sparc64
   ;;
   *)
     echo "Unsupported CPU = $cpu"
     exit 1
   ;;
 esac
+echo "ARCH=$ARCH" >> $config_mak
+arch_name=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
+echo "#define HOST_$arch_name 1" >> $config_h
+
 if test "$debug_tcg" = "yes" ; then
   echo "#define DEBUG_TCG 1" >> $config_h
 fi
Signature · 1 line
1.6.2.5
#21 lore raw

PATCH 21/26 Refactor common code using a list

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   51 +++------------------------------------------------
 1 files changed, 3 insertions(+), 48 deletions(-)
configure +3 -48
index 57d4538..8e75a6f 100755
@@ -1489,57 +1489,12 @@ echo "EXESUF=$EXESUF" >> $config_mak
 echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak
 echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
 case "$cpu" in
-  i386)
-    ARCH=i386
-  ;;
-  x86_64)
-    ARCH=x86_64
-  ;;
-  alpha)
-   ARCH=alpha
-  ;;
-  armv4b)
-    ARCH=arm
+  i386|x86_64|alpha|cris|hppa|ia64|m68k|microbaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64)
+    ARCH=$cpu
   ;;
-  armv4l)
+  armv4b|arm4l)
     ARCH=arm
   ;;
-  cris)
-    ARCH=cris
-  ;;
-  hppa)
-    ARCH=hppa
-  ;;
-  ia64)
-    ARCH=ia64
-  ;;
-  m68k)
-    ARCH=m68k
-  ;;
-  microblaze)
-    ARCH=microblaze
-  ;;
-  mips)
-    ARCH=mips
-  ;;
-  mips64)
-    ARCH=mips64
-  ;;
-  ppc)
-    ARCH=ppc
-  ;;
-  ppc64)
-    ARCH=ppc64
-  ;;
-  s390)
-    ARCH=s390
-  ;;
-  sparc)
-    ARCH=sparc
-  ;;
-  sparc64)
-    ARCH=sparc64
-  ;;
   *)
     echo "Unsupported CPU = $cpu"
     exit 1
Signature · 1 line
1.6.2.5
#22 lore raw

PATCH 22/26 Refactor targe_bigendian selection in another list

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)
configure +5 -14
index 8e75a6f..cc13438 100755
@@ -1821,20 +1821,11 @@ config_mak=$target_dir/config.mak
 config_h=$target_dir/config.h
 target_arch2=`echo $target | cut -d '-' -f 1`
 target_bigendian="no"
-[ "$target_arch2" = "armeb" ] && target_bigendian=yes
-[ "$target_arch2" = "m68k" ] && target_bigendian=yes
-[ "$target_arch2" = "microblaze" ] && target_bigendian=yes
-[ "$target_arch2" = "mips" ] && target_bigendian=yes
-[ "$target_arch2" = "mipsn32" ] && target_bigendian=yes
-[ "$target_arch2" = "mips64" ] && target_bigendian=yes
-[ "$target_arch2" = "ppc" ] && target_bigendian=yes
-[ "$target_arch2" = "ppcemb" ] && target_bigendian=yes
-[ "$target_arch2" = "ppc64" ] && target_bigendian=yes
-[ "$target_arch2" = "ppc64abi32" ] && target_bigendian=yes
-[ "$target_arch2" = "sh4eb" ] && target_bigendian=yes
-[ "$target_arch2" = "sparc" ] && target_bigendian=yes
-[ "$target_arch2" = "sparc64" ] && target_bigendian=yes
-[ "$target_arch2" = "sparc32plus" ] && target_bigendian=yes
+case "$target_arch2" in
+  armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|sh4eb|sparc|sparc64|sparc32plus)
+  target_bigendian=yes
+  ;;
+esac
 target_softmmu="no"
 target_user_only="no"
 target_linux_user="no"
Signature · 1 line
1.6.2.5
#23 lore raw

PATCH 23/26 print only once TARGET_ARCH

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)
configure +19 -18
index cc13438..475b260 100755
@@ -1887,13 +1887,13 @@ gdb_xml_files=""
 
 case "$target_arch2" in
   i386)
-    echo "TARGET_ARCH=i386" >> $config_mak
+    TARGET_ARCH=i386
     echo "#define TARGET_ARCH \"i386\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     target_phys_bits=32
   ;;
   x86_64)
-    echo "TARGET_ARCH=x86_64" >> $config_mak
+    TARGET_ARCH=x86_64
     echo "TARGET_BASE_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
@@ -1901,13 +1901,13 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   alpha)
-    echo "TARGET_ARCH=alpha" >> $config_mak
+    TARGET_ARCH=alpha
     echo "#define TARGET_ARCH \"alpha\"" >> $config_h
     echo "#define TARGET_ALPHA 1" >> $config_h
     target_phys_bits=64
   ;;
   arm|armeb)
-    echo "TARGET_ARCH=arm" >> $config_mak
+    TARGET_ARCH=arm
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"arm\"" >> $config_h
     echo "#define TARGET_ARM 1" >> $config_h
@@ -1917,14 +1917,14 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   cris)
-    echo "TARGET_ARCH=cris" >> $config_mak
+    TARGET_ARCH=cris
     echo "#define TARGET_ARCH \"cris\"" >> $config_h
     echo "#define TARGET_CRIS 1" >> $config_h
     target_nptl="yes"
     target_phys_bits=32
   ;;
   m68k)
-    echo "TARGET_ARCH=m68k" >> $config_mak
+    TARGET_ARCH=m68k
     echo "#define TARGET_ARCH \"m68k\"" >> $config_h
     echo "#define TARGET_M68K 1" >> $config_h
     bflt="yes"
@@ -1932,7 +1932,7 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   microblaze)
-    echo "TARGET_ARCH=microblaze" >> $config_mak
+    TARGET_ARCH=microblaze
     echo "#define TARGET_ARCH \"microblaze\"" >> $config_h
     echo "#define TARGET_MICROBLAZE 1" >> $config_h
     bflt="yes"
@@ -1940,7 +1940,7 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
  mips|mipsel)
-    echo "TARGET_ARCH=mips" >> $config_mak
+    TARGET_ARCH=mips
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"mips\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
@@ -1949,7 +1949,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   mipsn32|mipsn32el)
-    echo "TARGET_ARCH=mipsn32" >> $config_mak
+    TARGET_ARCH=mipsn32
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
@@ -1958,7 +1958,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   mips64|mips64el)
-    echo "TARGET_ARCH=mips64" >> $config_mak
+    TARGET_ARCH=mips64
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mips64\"" >> $config_h
@@ -1968,14 +1968,14 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   ppc)
-    echo "TARGET_ARCH=ppc" >> $config_mak
+    TARGET_ARCH=ppc
     echo "#define TARGET_ARCH \"ppc\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=32
   ;;
   ppcemb)
-    echo "TARGET_ARCH=ppcemb" >> $config_mak
+    TARGET_ARCH=ppcemb
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
@@ -1985,7 +1985,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   ppc64)
-    echo "TARGET_ARCH=ppc64" >> $config_mak
+    TARGET_ARCH=ppc64
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
@@ -1995,7 +1995,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   ppc64abi32)
-    echo "TARGET_ARCH=ppc64" >> $config_mak
+    TARGET_ARCH=ppc64
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
@@ -2007,7 +2007,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   sh4|sh4eb)
-    echo "TARGET_ARCH=sh4" >> $config_mak
+    TARGET_ARCH=sh4
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_ARCH \"sh4\"" >> $config_h
     echo "#define TARGET_SH4 1" >> $config_h
@@ -2016,13 +2016,13 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   sparc)
-    echo "TARGET_ARCH=sparc" >> $config_mak
+    TARGET_ARCH=sparc
     echo "#define TARGET_ARCH \"sparc\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     target_phys_bits=64
   ;;
   sparc64)
-    echo "TARGET_ARCH=sparc64" >> $config_mak
+    TARGET_ARCH=sparc64
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
@@ -2031,7 +2031,7 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   sparc32plus)
-    echo "TARGET_ARCH=sparc64" >> $config_mak
+    TARGET_ARCH=sparc64
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
@@ -2046,6 +2046,7 @@ case "$target_arch2" in
     exit 1
   ;;
 esac
+echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak
 if [ $target_phys_bits -lt $hostlongbits ] ; then
   target_phys_bits=$hostlongbits
 fi
Signature · 1 line
1.6.2.5
#24 lore raw

PATCH 24/26 Only setup TARGET_ARCH when it is different of

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
configure +1 -11
index 475b260..cf1c457 100755
@@ -1885,15 +1885,14 @@ interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 gdb_xml_files=""
 
+TARGET_ARCH="$target_arch2"
 case "$target_arch2" in
   i386)
-    TARGET_ARCH=i386
     echo "#define TARGET_ARCH \"i386\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     target_phys_bits=32
   ;;
   x86_64)
-    TARGET_ARCH=x86_64
     echo "TARGET_BASE_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
@@ -1901,7 +1900,6 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   alpha)
-    TARGET_ARCH=alpha
     echo "#define TARGET_ARCH \"alpha\"" >> $config_h
     echo "#define TARGET_ALPHA 1" >> $config_h
     target_phys_bits=64
@@ -1917,14 +1915,12 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   cris)
-    TARGET_ARCH=cris
     echo "#define TARGET_ARCH \"cris\"" >> $config_h
     echo "#define TARGET_CRIS 1" >> $config_h
     target_nptl="yes"
     target_phys_bits=32
   ;;
   m68k)
-    TARGET_ARCH=m68k
     echo "#define TARGET_ARCH \"m68k\"" >> $config_h
     echo "#define TARGET_M68K 1" >> $config_h
     bflt="yes"
@@ -1932,7 +1928,6 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   microblaze)
-    TARGET_ARCH=microblaze
     echo "#define TARGET_ARCH \"microblaze\"" >> $config_h
     echo "#define TARGET_MICROBLAZE 1" >> $config_h
     bflt="yes"
@@ -1968,14 +1963,12 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   ppc)
-    TARGET_ARCH=ppc
     echo "#define TARGET_ARCH \"ppc\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=32
   ;;
   ppcemb)
-    TARGET_ARCH=ppcemb
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
@@ -1985,7 +1978,6 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   ppc64)
-    TARGET_ARCH=ppc64
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
@@ -2016,13 +2008,11 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   sparc)
-    TARGET_ARCH=sparc
     echo "#define TARGET_ARCH \"sparc\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     target_phys_bits=64
   ;;
   sparc64)
-    TARGET_ARCH=sparc64
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
Signature · 1 line
1.6.2.5
#25 lore raw

PATCH 25/26 generate TARGET_ARCH for config.h

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)
configure +2 -18
index cf1c457..5835dbe 100755
@@ -1888,26 +1888,22 @@ gdb_xml_files=""
 TARGET_ARCH="$target_arch2"
 case "$target_arch2" in
   i386)
-    echo "#define TARGET_ARCH \"i386\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     target_phys_bits=32
   ;;
   x86_64)
     echo "TARGET_BASE_ARCH=i386" >> $config_mak
-    echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     echo "#define TARGET_X86_64 1" >> $config_h
     target_phys_bits=64
   ;;
   alpha)
-    echo "#define TARGET_ARCH \"alpha\"" >> $config_h
     echo "#define TARGET_ALPHA 1" >> $config_h
     target_phys_bits=64
   ;;
   arm|armeb)
     TARGET_ARCH=arm
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_ARCH \"arm\"" >> $config_h
     echo "#define TARGET_ARM 1" >> $config_h
     bflt="yes"
     target_nptl="yes"
@@ -1915,20 +1911,17 @@ case "$target_arch2" in
     target_phys_bits=32
   ;;
   cris)
-    echo "#define TARGET_ARCH \"cris\"" >> $config_h
     echo "#define TARGET_CRIS 1" >> $config_h
     target_nptl="yes"
     target_phys_bits=32
   ;;
   m68k)
-    echo "#define TARGET_ARCH \"m68k\"" >> $config_h
     echo "#define TARGET_M68K 1" >> $config_h
     bflt="yes"
     gdb_xml_files="cf-core.xml cf-fp.xml"
     target_phys_bits=32
   ;;
   microblaze)
-    echo "#define TARGET_ARCH \"microblaze\"" >> $config_h
     echo "#define TARGET_MICROBLAZE 1" >> $config_h
     bflt="yes"
     target_nptl="yes"
@@ -1937,7 +1930,6 @@ case "$target_arch2" in
  mips|mipsel)
     TARGET_ARCH=mips
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_ARCH \"mips\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
     target_nptl="yes"
@@ -1947,7 +1939,6 @@ case "$target_arch2" in
     TARGET_ARCH=mipsn32
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
-    echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
     target_phys_bits=64
@@ -1956,14 +1947,12 @@ case "$target_arch2" in
     TARGET_ARCH=mips64
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
-    echo "#define TARGET_ARCH \"mips64\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_MIPS64 1" >> $config_h
     echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
     target_phys_bits=64
   ;;
   ppc)
-    echo "#define TARGET_ARCH \"ppc\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=32
@@ -1971,7 +1960,6 @@ case "$target_arch2" in
   ppcemb)
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
-    echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPCEMB 1" >> $config_h
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
@@ -1980,7 +1968,6 @@ case "$target_arch2" in
   ppc64)
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
-    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPC64 1" >> $config_h
     gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
@@ -1991,7 +1978,6 @@ case "$target_arch2" in
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
-    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPC64 1" >> $config_h
     echo "#define TARGET_ABI32 1" >> $config_h
@@ -2001,20 +1987,17 @@ case "$target_arch2" in
   sh4|sh4eb)
     TARGET_ARCH=sh4
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_ARCH \"sh4\"" >> $config_h
     echo "#define TARGET_SH4 1" >> $config_h
     bflt="yes"
     target_nptl="yes"
     target_phys_bits=32
   ;;
   sparc)
-    echo "#define TARGET_ARCH \"sparc\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     target_phys_bits=64
   ;;
   sparc64)
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
-    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
     elfload32="yes"
@@ -2025,7 +2008,6 @@ case "$target_arch2" in
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
     echo "#define TARGET_ABI32 1" >> $config_h
@@ -2037,6 +2019,8 @@ case "$target_arch2" in
   ;;
 esac
 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak
+echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
+
 if [ $target_phys_bits -lt $hostlongbits ] ; then
   target_phys_bits=$hostlongbits
 fi
Signature · 1 line
1.6.2.5
#26 lore raw

PATCH 26/26 generate TARGET_<arch name> for config.h

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)
configure +8 -16
index 5835dbe..819276a 100755
@@ -1886,37 +1886,33 @@ echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 gdb_xml_files=""
 
 TARGET_ARCH="$target_arch2"
+target_arch_name=""
+
 case "$target_arch2" in
   i386)
-    echo "#define TARGET_I386 1" >> $config_h
     target_phys_bits=32
   ;;
   x86_64)
     echo "TARGET_BASE_ARCH=i386" >> $config_mak
     echo "#define TARGET_I386 1" >> $config_h
-    echo "#define TARGET_X86_64 1" >> $config_h
     target_phys_bits=64
   ;;
   alpha)
-    echo "#define TARGET_ALPHA 1" >> $config_h
     target_phys_bits=64
   ;;
   arm|armeb)
     TARGET_ARCH=arm
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_ARM 1" >> $config_h
     bflt="yes"
     target_nptl="yes"
     gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
     target_phys_bits=32
   ;;
   cris)
-    echo "#define TARGET_CRIS 1" >> $config_h
     target_nptl="yes"
     target_phys_bits=32
   ;;
   m68k)
-    echo "#define TARGET_M68K 1" >> $config_h
     bflt="yes"
     gdb_xml_files="cf-core.xml cf-fp.xml"
     target_phys_bits=32
@@ -1930,7 +1926,6 @@ case "$target_arch2" in
  mips|mipsel)
     TARGET_ARCH=mips
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
     target_nptl="yes"
     target_phys_bits=64
@@ -1939,7 +1934,7 @@ case "$target_arch2" in
     TARGET_ARCH=mipsn32
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
-    echo "#define TARGET_MIPS 1" >> $config_h
+    target_arch_name=mips
     echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
     target_phys_bits=64
   ;;
@@ -1948,7 +1943,6 @@ case "$target_arch2" in
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_MIPS 1" >> $config_h
-    echo "#define TARGET_MIPS64 1" >> $config_h
     echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
     target_phys_bits=64
   ;;
@@ -1961,7 +1955,6 @@ case "$target_arch2" in
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_PPC 1" >> $config_h
-    echo "#define TARGET_PPCEMB 1" >> $config_h
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
   ;;
@@ -1969,7 +1962,6 @@ case "$target_arch2" in
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_PPC 1" >> $config_h
-    echo "#define TARGET_PPC64 1" >> $config_h
     gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
   ;;
@@ -1979,7 +1971,6 @@ case "$target_arch2" in
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
     echo "#define TARGET_PPC 1" >> $config_h
-    echo "#define TARGET_PPC64 1" >> $config_h
     echo "#define TARGET_ABI32 1" >> $config_h
     gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
@@ -1987,19 +1978,16 @@ case "$target_arch2" in
   sh4|sh4eb)
     TARGET_ARCH=sh4
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
-    echo "#define TARGET_SH4 1" >> $config_h
     bflt="yes"
     target_nptl="yes"
     target_phys_bits=32
   ;;
   sparc)
-    echo "#define TARGET_SPARC 1" >> $config_h
     target_phys_bits=64
   ;;
   sparc64)
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "#define TARGET_SPARC 1" >> $config_h
-    echo "#define TARGET_SPARC64 1" >> $config_h
     elfload32="yes"
     target_phys_bits=64
   ;;
@@ -2009,7 +1997,6 @@ case "$target_arch2" in
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
     echo "TARGET_ARCH2=$target_arch2" >> $config_mak
     echo "#define TARGET_SPARC 1" >> $config_h
-    echo "#define TARGET_SPARC64 1" >> $config_h
     echo "#define TARGET_ABI32 1" >> $config_h
     target_phys_bits=64
   ;;
@@ -2018,8 +2005,13 @@ case "$target_arch2" in
     exit 1
   ;;
 esac
+if [ "$target_arch_name" = "" ]; then
+    target_arch_name=`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`
+fi
+
 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak
 echo "#define TARGET_ARCH \"$TARGET_ARCH\"" >> $config_h
+echo "#define TARGET_$target_arch_name 1" >> $config_h
 
 if [ $target_phys_bits -lt $hostlongbits ] ; then
   target_phys_bits=$hostlongbits
Signature · 1 line
1.6.2.5