firmware/seabios: fix build on systems with non GNU toolchains
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 2 Jul 2018 08:28:23 +0000 (10:28 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 10 Jul 2018 07:41:53 +0000 (08:41 +0100)
SeaBIOS requires gcc and GNU ld in order to build, so allow setting
SEABIOSCC and SEABIOSLD by the caller when building in order to pass
the path to the compiler and linker that should be used when building
SeaBIOS.

Note that the LD32BIT-y variable was used by FreeBSD builds and is no
longer needed due to the ability to select the LD to use for SeaBIOS
builds, so remove it.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/firmware/Makefile

index 5a7cf7766d491e5517f4e65eb14f3f836be3d6e9..842b48c3d3ea51f2d38373a456e269007e831b9d 100644 (file)
@@ -19,7 +19,8 @@ SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-$(CONFIG_PV_SHIM) += xen-dir
 SUBDIRS-y += hvmloader
 
-LD32BIT-$(CONFIG_FreeBSD) := LD32BIT_FLAG=-melf_i386_fbsd
+SEABIOSCC ?= $(CC)
+SEABIOSLD ?= $(LD)
 
 ovmf-dir:
        GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf-dir
@@ -28,7 +29,7 @@ ovmf-dir:
 seabios-dir:
        GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
        cp seabios-config seabios-dir/.config;
-       $(MAKE) -C seabios-dir olddefconfig
+       $(MAKE) -C seabios-dir olddefconfig CC=$(SEABIOSCC) LD=$(SEABIOSLD)
 
 .PHONY: all
 all: $(SUBDIRS-y)
@@ -41,8 +42,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
        false ; \
        fi
 endif
-       $(MAKE) $(LD32BIT-y) CC=$(CC) PYTHON=$(PYTHON) subdirs-$@
-
+       $(MAKE) CC=$(CC) PYTHON=$(PYTHON) subdirs-$@
 
 .PHONY: install
 install: all
@@ -114,7 +114,7 @@ seabios-dir-force-update: seabios-dir
 
 subdir-clean-seabios-dir:
        set -e; if test -d seabios-dir/.; then \
-               $(MAKE) -C seabios-dir clean; \
+               $(MAKE) -C seabios-dir CC=$(SEABIOSCC) LD=$(SEABIOSLD) clean; \
        fi
 
 subtree-force-update:
@@ -128,3 +128,6 @@ endif
 subtree-force-update-all:
        $(MAKE) seabios-dir-force-update
        $(MAKE) ovmf-dir-force-update
+
+subdir-all-seabios-dir: seabios-dir
+       $(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) all;