qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Avi Kivity <avi@redhat.com>, Alex Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH 4/7] Allow a cross compiler to be used for rom builds
Date: Wed, 29 Jul 2009 13:45:56 -0500	[thread overview]
Message-ID: <1248893159-18785-4-git-send-email-aliguori@us.ibm.com> (raw)
In-Reply-To: <1248893159-18785-1-git-send-email-aliguori@us.ibm.com>

The host tool chain is not enough to build all of the possible roms for qemu.
This patch introduces a new option, --i386-cross-prefix, that provides the
cross prefix for a toolchain to build i386 roms.

This converts multiboot to use that toolchain.  If you don't specify
a cross prefix, then the host tool chain will be used if the architecture
matches.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 configure                  |   30 ++++++++++++++++++++++++++----
 roms/multiboot/Makefile    |    9 ++++-----
 roms/multiboot/multiboot.S |    2 +-
 3 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index f477aaf..75e5657 100755
--- a/configure
+++ b/configure
@@ -25,6 +25,7 @@ prefix=""
 interp_prefix="/usr/gnemul/qemu-%M"
 static="no"
 cross_prefix=""
+i386_cross_prefix=""
 cc="gcc"
 audio_drv_list=""
 audio_card_list="ac97 es1370 sb16"
@@ -43,6 +44,8 @@ for opt do
   case "$opt" in
   --cross-prefix=*) cross_prefix="$optarg"
   ;;
+  --i386-cross-prefix=*) i386_cross_prefix="$optarg"
+  ;;
   --cc=*) cc="$optarg"
   ;;
   esac
@@ -376,6 +379,8 @@ for opt do
   ;;
   --cross-prefix=*)
   ;;
+  --i386-cross-prefix=*)
+  ;;
   --cc=*)
   ;;
   --host-cc=*) host_cc="$optarg"
@@ -624,6 +629,7 @@ echo ""
 echo "Advanced options (experts only):"
 echo "  --source-path=PATH       path of source code [$source_path]"
 echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
+echo "  --i386-cross-prefix=P    use P for i386 compile tools"
 echo "  --cc=CC                  use C compiler CC [$cc]"
 echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
 echo "  --extra-cflags=CFLAGS    append extra C compiler flags CFLAGS"
@@ -1739,11 +1745,12 @@ if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
 fi
 echo "TOOLS=$tools" >> $config_host_mak
 
-# Mac OS X ships with a broken assembler
 roms=
-if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
-        "$targetos" != "Darwin" ; then
-  roms="multiboot"
+# Mac OS X ships with a broken assembler
+if test \( \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
+        "$targetos" != "Darwin" \) -o \
+        "$i386_cross_prefix" ; then
+  roms="$roms multiboot"
 fi
 echo "ROMS=$roms" >> $config_host_mak
 
@@ -2114,6 +2121,21 @@ for rom in $roms; do
     mkdir -p pc-bios/$rom
     rm -f pc-bios/$rom/Makefile
     ln -s $source_path/roms/$rom/Makefile pc-bios/$rom/Makefile
+    config_mak="pc-bios/$rom/config.mak"
+    case "$rom" in
+      multiboot)
+	prefix=${i386_cross_prefix}
+	;;
+    esac
+    echo "# Automatically generated by configure - do not modify" > $config_mak
+    echo "include ../../config-host.mak" >> $config_mak
+    echo "include ${source_path}/rules.mak" >> $config_mak
+    echo "SRC_PATH=${source_path}/roms/$rom" >> $config_mak
+    echo "TOP_DIR=${source_path}" >> $config_mak
+    echo "CC=${prefix}${cc}" >> $config_mak
+    echo "CPP=${prefix}cpp" >> $config_mak
+    echo "LD=${prefix}${ld}" >> $config_mak
+    echo "OBJCOPY=${prefix}${objcopy}" >> $config_mak
 done
 
 # build tree in object directory if source path is different from current one
diff --git a/roms/multiboot/Makefile b/roms/multiboot/Makefile
index c6b5ca4..010feff 100644
--- a/roms/multiboot/Makefile
+++ b/roms/multiboot/Makefile
@@ -1,12 +1,11 @@
 all: build-all
 
-include ../../config-host.mak
-include $(SRC_PATH)/rules.mak
+include config.mak
 
-VPATH=$(SRC_PATH)/roms/multiboot
+VPATH=$(SRC_PATH)
 
 CPPFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
-CPPFLAGS += -I$(SRC_PATH)
+CPPFLAGS += -I$(TOP_DIR)
 CPPFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
 
 build-all: multiboot.bin
@@ -18,7 +17,7 @@ build-all: multiboot.bin
 	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"  Building $(TARGET_DIR)$@")
 
 %.bin: %.raw
-	$(call quiet-command,$(SRC_PATH)/roms/multiboot/signrom.sh $< $@,"  Signing $(TARGET_DIR)$@")
+	$(call quiet-command,$(SRC_PATH)/signrom.sh $< $@,"  Signing $(TARGET_DIR)$@")
 
 clean:
 	$(RM) *.o *.img *.bin *~
diff --git a/roms/multiboot/multiboot.S b/roms/multiboot/multiboot.S
index 93beb51..ba7724b 100644
--- a/roms/multiboot/multiboot.S
+++ b/roms/multiboot/multiboot.S
@@ -19,7 +19,7 @@
  */
 
 #define NO_QEMU_PROTOS
-#include "../../hw/fw_cfg.h"
+#include "hw/fw_cfg.h"
 
 #define BIOS_CFG_IOPORT_CFG	0x510
 #define BIOS_CFG_IOPORT_DATA	0x511
-- 
1.6.2.5

  parent reply	other threads:[~2009-07-29 18:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 18:45 [Qemu-devel] [PATCH 1/7] Rename pc-bios/optionrom -> roms/multiboot Anthony Liguori
2009-07-29 18:45 ` [Qemu-devel] [PATCH 2/7] Always build roms in a separate directory Anthony Liguori
2009-07-29 18:45 ` [Qemu-devel] [PATCH 3/7] If we built a rom, install it. Otherwise, use shipped copy Anthony Liguori
     [not found]   ` <m37hxr46rt.fsf@neno.mitica>
2009-07-29 22:16     ` [Qemu-devel] " Anthony Liguori
2009-07-30  9:34       ` Avi Kivity
2009-07-30  9:39         ` Alexander Graf
2009-07-30 10:07           ` Avi Kivity
2009-07-30 10:04             ` Alexander Graf
2009-07-29 18:45 ` Anthony Liguori [this message]
2009-07-29 18:45 ` [Qemu-devel] [PATCH 5/7] Add proper headers to all BIOS patches Anthony Liguori
2009-07-29 18:45 ` [Qemu-devel] [PATCH 6/7] Add pc-bios as a git submodule Anthony Liguori
2009-07-29 21:25   ` [Qemu-devel] " Alexander Graf
2009-07-29 21:40     ` Anthony Liguori
2009-07-29 21:51       ` Alexander Graf
2009-07-29 22:10   ` [Qemu-devel] " Jordan Justen
2009-07-29 22:13     ` Anthony Liguori
2009-07-29 18:45 ` [Qemu-devel] [PATCH 7/7] Remove BIOS patches from the queue and update the README Anthony Liguori
2009-07-30  9:38   ` [Qemu-devel] " Avi Kivity
     [not found] ` <m3eirz474o.fsf@neno.mitica>
2009-07-29 19:35   ` [Qemu-devel] Re: [PATCH 1/7] Rename pc-bios/optionrom -> roms/multiboot Anthony Liguori
2009-07-30  9:38   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1248893159-18785-4-git-send-email-aliguori@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).