]> xenbits.xensource.com Git - xen.git/commitdiff
make: Normalize config options for external trees
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Mon, 14 Jul 2014 16:15:23 +0000 (17:15 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jul 2014 10:20:56 +0000 (11:20 +0100)
We have four different external trees, and four different naming
conventions for specifying the URL, where they live, and what revision
to check out.

Normalize config options on the following bases:
 - QEMU_UPSTREAM
 - QEMU_TRADITIONAL
 - SEABIOS_UPSTREAM
 - OVMF_UPSTREAM

The following suffixes for all trees:
 - _URL : A remote repository to clone from
 - _REVISION : The revision to check out

And the following suffixes for the qemu trees:
 - _INTREE : The location of an inlined tree (for tarball releases)
 - _LOC : Where to actually look (either a directory or a URL)

The following parameters are still supported for backwards
compatibility:
 - CONFIG_QEMU          (=> QEMU_TRADITIONAL_LOC)
 - QEMU_REMOTE          (=> QEMU_TRADITIONAL_URL)
 - QEMU_TAG             (=> QEMU_TRADITIONAL_REVISION)
 - SEABIOS_UPSTREAM_TAG (=> SEABIOS_UPSTREAM_REVISION)

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Config.mk
tools/Makefile
tools/firmware/Makefile

index a9b3468a554465e9bc05e888be357aec6de9233d..5370e23b626ca418c31b81c9124fbefd8f0cabcf 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -218,49 +218,60 @@ XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # the internet.  The original download URL is preserved as a comment
 # near the place in the Xen Makefiles where the file is used.
 
-ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-unstable.git
-else
-QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-unstable.git
-endif
-
 # Where to look for inlined subtrees (for example, from a tarball)
 QEMU_UPSTREAM_INTREE ?= $(XEN_ROOT)/tools/qemu-xen
 QEMU_TRADITIONAL_INTREE ?= $(XEN_ROOT)/tools/qemu-xen-traditional
 
 
-# Specify which qemu-dm to use. This may be `ioemu' to use the old
-# Mercurial in-tree version, or a local directory, or a git URL.
-# CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
-CONFIG_QEMU ?= $(or $(wildcard $(QEMU_TRADITIONAL_INTREE)),\
-                    $(QEMU_REMOTE))
-
-ifneq (,$(wildcard $(QEMU_UPSTREAM_INTREE)))
-QEMU_UPSTREAM_URL ?= $(QEMU_UPSTREAM_INTREE)
+# Handle legacy options
+ifneq (,$(SEABIOS_UPSTREAM_TAG))
+SEABIOS_UPSTREAM_REVISION ?= $(SEABIOS_UPSTREAM_TAG)
+endif
+ifneq (,$(QEMU_REMOTE))
+QEMU_TRADITIONAL_URL ?= $(QEMU_REMOTE)
+endif
+ifneq (,$(CONFIG_QEMU))
+QEMU_TRADITIONAL_LOC ?= $(CONFIG_QEMU)
+endif
+ifneq (,$(QEMU_TAG))
+QEMU_TRADITIONAL_REVISION ?= $(QEMU_TAG)
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= rel-1.7.5
+SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TAG ?= d0395cc49b2ec6d1723c01f1daf2394b9264ca29
+QEMU_TRADITIONAL_REVISION ?= d0395cc49b2ec6d1723c01f1daf2394b9264ca29
 # Tue Apr 8 16:50:06 2014 +0000
 # qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
 
+# Specify which qemu-dm to use. This may be `ioemu' to use the old
+# Mercurial in-tree version, or a local directory, or a git URL.
+# QEMU_UPSTREAM_LOC ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
+
+# Defaults for subtree locations
+QEMU_TRADITIONAL_LOC ?= $(or $(wildcard $(QEMU_TRADITIONAL_INTREE)),\
+                        $(QEMU_TRADITIONAL_URL))
+
+QEMU_UPSTREAM_LOC ?= $(or $(wildcard $(QEMU_UPSTREAM_INTREE)),\
+                        $(QEMU_UPSTREAM_URL))
+
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
index e558e6e8cf6c8878fa622530d67e3e5fc949aac8..0c4e49c1d3851c06a8a2ce94305942a42706800f 100644 (file)
@@ -111,35 +111,35 @@ IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
                         --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
-QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
+QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo "$(QEMU_TRADITIONAL_LOC)"; else echo .; fi)
 ifneq ($(QEMU_ROOT),.)
 export QEMU_ROOT
 endif
 
 qemu-xen-traditional-dir-find:
        set -ex; \
-       if test -d $(CONFIG_QEMU); then \
+       if test -d $(QEMU_TRADITIONAL_LOC); then \
                mkdir -p qemu-xen-traditional-dir; \
        else \
                export GIT=$(GIT); \
-               $(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
+               $(XEN_ROOT)/scripts/git-checkout.sh $(QEMU_TRADITIONAL_LOC) $(QEMU_TRADITIONAL_REVISION) qemu-xen-traditional-dir; \
        fi
 
 qemu-xen-dir-find:
-       if test -d $(QEMU_UPSTREAM_URL) ; then \
+       if test -d $(QEMU_UPSTREAM_LOC) ; then \
                mkdir -p qemu-xen-dir; \
        else \
                export GIT=$(GIT); \
-               $(XEN_ROOT)/scripts/git-checkout.sh $(QEMU_UPSTREAM_URL) $(QEMU_UPSTREAM_REVISION) qemu-xen-dir ; \
+               $(XEN_ROOT)/scripts/git-checkout.sh $(QEMU_UPSTREAM_LOC) $(QEMU_UPSTREAM_REVISION) qemu-xen-dir ; \
        fi
 
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
        set -ex; \
-       if [ "$(QEMU_TAG)" ]; then \
+       if [ "$(QEMU_TRADITIONAL_REVISION)" ]; then \
                cd qemu-xen-traditional-dir-remote; \
                $(GIT) fetch origin; \
-               $(GIT) reset --hard $(QEMU_TAG); \
+               $(GIT) reset --hard $(QEMU_TRADITIONAL_REVISION); \
        fi
 
 subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -179,8 +179,8 @@ QEMU_XEN_ENABLE_DEBUG :=
 endif
 
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
-       if test -d $(QEMU_UPSTREAM_URL) ; then \
-               source=$(QEMU_UPSTREAM_URL); \
+       if test -d $(QEMU_UPSTREAM_LOC) ; then \
+               source=$(QEMU_UPSTREAM_LOC); \
        else \
                source=.; \
        fi; \
index 2f1d10ddd2434783473bb7fb4d46a8c0f1ec04ea..2c2ed34e2f52a659007ff2f94edad1fc3083c0e7 100644 (file)
@@ -24,7 +24,7 @@ ovmf-dir:
        cp ovmf-makefile ovmf-dir/Makefile;
 
 seabios-dir:
-       GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
+       GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir
        $(MAKE) -C seabios-dir defconfig
 
 .PHONY: all
@@ -78,10 +78,10 @@ subdir-clean-ovmf:
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
        set -ex; \
-       if [ "$(SEABIOS_UPSTREAM_TAG)" ]; then \
+       if [ "$(SEABIOS_UPSTREAM_REVISION)" ]; then \
                cd seabios-dir-remote; \
                $(GIT) fetch origin; \
-               $(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
+               $(GIT) reset --hard $(SEABIOS_UPSTREAM_REVISION); \
        fi
 
 subdir-clean-seabios-dir: