All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] optionrom build fixes
@ 2009-07-21 12:11 quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 1/5] move cc-option definition to rules.mak quintela
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>

Hi

This series of patches get optionrom to use rules.mak and use the normal qemu
build system. As it used its own variant of cc-option, move cc-option definition
to rules.mak and remove the own implementation in optionrom.

Anthony, this one includes my two previous patches to this zone:
- put pc-bios/optionrom/multiboot.bin into .gitignore
- Don't build it in mac os X

cc'd alexander graf, that was the original author.

Later, Juan.

Juan Quintela (5):
  move cc-option definition to rules.mak
  Use quiet-command for building optionrom
  use cc-option for optionrom
  multiboot.bin is a generated file
  Don't build option roms on Mac OS X

 .gitignore                 |    1 +
 Makefile.target            |    6 ------
 configure                  |    4 +++-
 pc-bios/optionrom/Makefile |   36 +++++++-----------------------------
 rules.mak                  |    6 ++++++
 5 files changed, 17 insertions(+), 36 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/5] move cc-option definition to rules.mak
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
@ 2009-07-21 12:11 ` quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 2/5] Use quiet-command for building optionrom quintela
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 Makefile.target |    6 ------
 rules.mak       |    6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index f9cd42a..4c807df 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -21,12 +21,6 @@ endif

 PROGS=$(QEMU_PROG)

-# cc-option
-# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
-
-cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
-              > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
-
 HELPER_CFLAGS=

 ifeq ($(ARCH),i386)
diff --git a/rules.mak b/rules.mak
index 8d6d96e..f9d0ca0 100644
--- a/rules.mak
+++ b/rules.mak
@@ -17,3 +17,9 @@ LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS
 	$(call quiet-command,rm -f $@ && $(AR) rcs $@ $^,"  AR    $(TARGET_DIR)$@")

 quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
+
+# cc-option
+# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
+
+cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
+              > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/5] Use quiet-command for building optionrom
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 1/5] move cc-option definition to rules.mak quintela
@ 2009-07-21 12:11 ` quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 3/5] use cc-option for optionrom quintela
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 pc-bios/optionrom/Makefile |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 88fbc4c..2a0a7e7 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -1,6 +1,7 @@
 all: build-all

 include ../../config-host.mak
+include ../../rules.mak

 VPATH=$(SRC_PATH)/pc-bios/optionrom

@@ -22,25 +23,22 @@ try-run = $(shell set -e;		\
 cc-option-yn = $(call try-run,\
 	$(CC) $(KBUILD_CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n)

-CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
-CFLAGS += -I$(SRC_PATH)
+CPPFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
+CPPFLAGS += -I$(SRC_PATH)
 ifeq ($(call cc-option-yn,-fno-stack-protector),y)
-CFLAGS += -fno-stack-protector
+CPPFLAGS += -fno-stack-protector
 endif

 build-all: multiboot.bin

-%.o: %.S
-	$(CC) $(CFLAGS) -o $@ -c $<
-
 %.img: %.o
-	$(LD) -Ttext 0 -e _start -s -o $@ $<
+	$(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")

 %.raw: %.img
-	$(OBJCOPY) -O binary -j .text $< $@
+	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"  Building $(TARGET_DIR)$@")

 %.bin: %.raw
-	$(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@
+	$(call quiet-command,$(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@,"  Signing $(TARGET_DIR)$@")

 clean:
 	$(RM) *.o *.img *.bin *~
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 3/5] use cc-option for optionrom
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 1/5] move cc-option definition to rules.mak quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 2/5] Use quiet-command for building optionrom quintela
@ 2009-07-21 12:11 ` quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 4/5] multiboot.bin is a generated file quintela
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 pc-bios/optionrom/Makefile |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 2a0a7e7..b3f487b 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -5,29 +5,9 @@ include ../../rules.mak

 VPATH=$(SRC_PATH)/pc-bios/optionrom

-# from kernel sources - scripts/Kbuild.include
-# try-run
-# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
-# Exit code chooses option. "$$TMP" is can be used as temporary file and
-# is automatically cleaned up.
-try-run = $(shell set -e;		\
-	TMP="$(TMPOUT).$$$$.tmp";	\
-	if ($(1)) >/dev/null 2>&1;	\
-	then echo "$(2)";		\
-	else echo "$(3)";		\
-	fi;				\
-	rm -f "$$TMP")
-
-# cc-option-yn
-# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
-cc-option-yn = $(call try-run,\
-	$(CC) $(KBUILD_CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n)
-
 CPPFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
 CPPFLAGS += -I$(SRC_PATH)
-ifeq ($(call cc-option-yn,-fno-stack-protector),y)
-CPPFLAGS += -fno-stack-protector
-endif
+CPPFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"")

 build-all: multiboot.bin

-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 4/5] multiboot.bin is a generated file
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
                   ` (2 preceding siblings ...)
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 3/5] use cc-option for optionrom quintela
@ 2009-07-21 12:11 ` quintela
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 5/5] Don't build option roms on Mac OS X quintela
  2009-07-21 22:51 ` [Qemu-devel] Re: [PATCH 0/5] optionrom build fixes Alexander Graf
  5 siblings, 0 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 .gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4165e51..d546609 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,4 +42,5 @@ qemu-monitor.texi
 patches
 pc-bios/bios-pq/status
 pc-bios/vgabios-pq/status
+pc-bios/optionrom/multiboot.bin
 .stgit-*
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 5/5] Don't build option roms on Mac OS X
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
                   ` (3 preceding siblings ...)
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 4/5] multiboot.bin is a generated file quintela
@ 2009-07-21 12:11 ` quintela
  2009-07-21 22:51 ` [Qemu-devel] Re: [PATCH 0/5] optionrom build fixes Alexander Graf
  5 siblings, 0 replies; 7+ messages in thread
From: quintela @ 2009-07-21 12:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, Juan Quintela

From: Juan Quintela <quintela@redhat.com>


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 0db885b..152bd17 100755
--- a/configure
+++ b/configure
@@ -1826,8 +1826,10 @@ 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" ; then
+if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
+        "$targetos" != "Darwin" ; then
   roms="pc-bios/optionrom"
 fi
 echo "ROMS=$roms" >> $config_host_mak
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] Re: [PATCH 0/5] optionrom build fixes
  2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
                   ` (4 preceding siblings ...)
  2009-07-21 12:11 ` [Qemu-devel] [PATCH 5/5] Don't build option roms on Mac OS X quintela
@ 2009-07-21 22:51 ` Alexander Graf
  5 siblings, 0 replies; 7+ messages in thread
From: Alexander Graf @ 2009-07-21 22:51 UTC (permalink / raw)
  To: quintela; +Cc: qemu-devel


On 21.07.2009, at 14:11, quintela@redhat.com wrote:

> From: Juan Quintela <quintela@redhat.com>
>
> Hi
>
> This series of patches get optionrom to use rules.mak and use the  
> normal qemu
> build system. As it used its own variant of cc-option, move cc- 
> option definition
> to rules.mak and remove the own implementation in optionrom.
>
> Anthony, this one includes my two previous patches to this zone:
> - put pc-bios/optionrom/multiboot.bin into .gitignore
> - Don't build it in mac os X
>
> cc'd alexander graf, that was the original author.

The patches look good. I haven't compile-tested them though.

Thanks for doing the Makefile magic! :-)

Acked-By: Alexander Graf <agraf@suse.de>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-21 22:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 12:11 [Qemu-devel] [PATCH 0/5] optionrom build fixes quintela
2009-07-21 12:11 ` [Qemu-devel] [PATCH 1/5] move cc-option definition to rules.mak quintela
2009-07-21 12:11 ` [Qemu-devel] [PATCH 2/5] Use quiet-command for building optionrom quintela
2009-07-21 12:11 ` [Qemu-devel] [PATCH 3/5] use cc-option for optionrom quintela
2009-07-21 12:11 ` [Qemu-devel] [PATCH 4/5] multiboot.bin is a generated file quintela
2009-07-21 12:11 ` [Qemu-devel] [PATCH 5/5] Don't build option roms on Mac OS X quintela
2009-07-21 22:51 ` [Qemu-devel] Re: [PATCH 0/5] optionrom build fixes Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.