From patchwork Sat Feb 9 19:01:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 219427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D580A2C008D for ; Sun, 10 Feb 2013 06:02:02 +1100 (EST) Received: from localhost ([::1]:60099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FgU-0001G5-Qc for incoming@patchwork.ozlabs.org; Sat, 09 Feb 2013 14:01:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FgO-0001G0-BJ for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:01:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4FgJ-0001uS-88 for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:01:52 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:63318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FgJ-0001u5-0e for qemu-devel@nongnu.org; Sat, 09 Feb 2013 14:01:47 -0500 Received: by mail-lb0-f176.google.com with SMTP id s4so3790757lbc.35 for ; Sat, 09 Feb 2013 11:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=KqfcbldgSiXigfzVjRIGLvEt/k6nYOqryEmdxM17DFY=; b=t3t5ciDMacxSqZ8S+ZELHAB1bDmOJYztLiGO1wPFqWyhdJ1tsmIept3l200G2IdqSp PMGicy03yJbS2oSwqDc6Z+YPOa4NhDE8mplCbw5r/TPL5pk8oonmoDNrRoc03/KtDNVn trB3sgTwt4HaE2z0Us1DYn8PlmBATD0uwZM/dpu1x7RAADRMo9pIGTOIt1xE9GTcBDRV ZlFSmVpB60qIGhrLEfH7MSXeK0zPkDpwe3RAkl/9/IMvyLxZWKWCjsSO6rnd1/eGHuG9 xNVfYomjRsbxJeBYkooUsypt8wCIwXho3r3kg5G/7YeyClMaRRhqvC7Aycz5c6Aja2/B biTw== X-Received: by 10.152.147.130 with SMTP id tk2mr8436406lab.24.1360436505737; Sat, 09 Feb 2013 11:01:45 -0800 (PST) Received: from localhost.localdomain ([2001:5c0:1115:ba00:edb6:7a04:4e42:52c0]) by mx.google.com with ESMTPS id u5sm11365378lbm.8.2013.02.09.11.01.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 11:01:44 -0800 (PST) From: Blue Swirl To: qemu-devel@nongnu.org Date: Sat, 9 Feb 2013 19:01:40 +0000 Message-Id: X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.176 Cc: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH] pc-bios: build OpenBIOS if possible X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Check if xsltproc and Sparc32, Sparc64 and PPC compilers are available. If found, rebuild OpenBIOS ROMs from submodule. Signed-off-by: Blue Swirl --- A patch to OpenBIOS is also needed to support out of tree build, just sent to the list. --- configure | 25 ++++++++++++++++++++++++- pc-bios/openbios/Makefile | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletions(-) create mode 100644 pc-bios/openbios/Makefile diff --git a/configure b/configure index 8789324..918c423 100755 --- a/configure +++ b/configure @@ -76,6 +76,20 @@ has() { type "$1" >/dev/null 2>&1 } +# check for cross compile or native tools for arch $1 +has_crossgcc() { + if test "$cpu" = "$1"; then + return 1 + fi + for ccprefix in "${1}-linux-gnu-" "${1}-linux-" \ + "${1}-elf-" "${1}-eabi-"; do + if has "${1}gcc"; then + return 1 + fi + done + return 0 +} + # search for an executable in PATH path_of() { local_command="$1" @@ -3241,6 +3255,14 @@ if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then roms="$roms spapr-rtas" fi +# OpenBIOS needs xsltproc, and Sparc32, Sparc64 and PPC cross compilers +if has xsltproc; then + if has_crossgcc "sparc" -a has_crossgcc "sparc64" -a \ + \( has_crossgcc "powerpc" -o has_crossgcc "ppc" \); then + roms="$roms openbios" + fi +fi + # add pixman flags after all config tests are done QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags" libs_softmmu="$libs_softmmu $pixman_libs" @@ -4280,7 +4302,7 @@ fi # build tree in object directory in case the source is not in the current directory DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" -DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas" +DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/openbios" DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS qapi-generated" FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" @@ -4288,6 +4310,7 @@ FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" FILES="$FILES tests/tcg/lm32/Makefile" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" +FILES="$FILES pc-bios/openbios/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" for bios_file in \ $source_path/pc-bios/*.bin \ diff --git a/pc-bios/openbios/Makefile b/pc-bios/openbios/Makefile new file mode 100644 index 0000000..77d0815 --- /dev/null +++ b/pc-bios/openbios/Makefile @@ -0,0 +1,29 @@ +all: build-all +# Dummy command so that make thinks it has done something + @true + +include ../../config-host.mak + +.PHONY : all clean build-all + +# Avoid polluting sub-make environment, especially MAKEFLAGS causes build to fail +unexport AS AS_FLAGS CC CFLAGS CPP INCLUDES LD LDFLAGS VERSION SRCDIR ODIR +unexport HOSTCC HOSTCFLAGS HOSTARCH HOSTINCLUDES TARGET MAKE MAKEFLAGS MFLAGS + +build-all: config + make -C build build-verbose + cp build/obj-sparc32/openbios-builtin.elf ../openbios-sparc32 + cp build/obj-sparc64/openbios-builtin.elf ../openbios-sparc64 + cp build/obj-ppc/openbios-qemu.elf ../openbios-ppc + +config: config-timestamp + @cmp $< $@ >/dev/null 2>&1 || cp $< $@ + +config-timestamp: $(SRC_PATH)/roms/openbios/config/scripts/switch-arch + mkdir build || true + cd build && sh $(SRC_PATH)/roms/openbios/config/scripts/switch-arch sparc32 sparc64 ppc + touch $@ + +clean: + make -C build $@ + rm -f config config-timestamp