|
|
9ae3a8 |
From 237c8da272492bbb2c5fdbcb0c96f8d4ace88b72 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 16 Jul 2014 02:20:26 -0500
|
|
|
9ae3a8 |
Subject: [CHANGE 26/29] rules.mak: fix $(obj) to a real relative path
|
|
|
9ae3a8 |
To: rhvirt-patches@redhat.com,
|
|
|
9ae3a8 |
jen@redhat.com
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1405477228-11490-3-git-send-email-famz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 59921
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH 2/4] rules.mak: fix $(obj) to a real relative path
|
|
|
9ae3a8 |
Bugzilla: 1017685
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Upstream: ba1183da9a10b94611cad88c44a5c6df005f9b55
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Makefile.target includes rule.mak and unnested common-obj-y, then prefix
|
|
|
9ae3a8 |
them with '../', this will ignore object specific QEMU_CFLAGS in subdir
|
|
|
9ae3a8 |
Makefile.objs:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
$(obj)/curl.o: QEMU_CFLAGS += $(CURL_CFLAGS)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Because $(obj) here is './block', instead of '../block'. This doesn't
|
|
|
9ae3a8 |
hurt compiling because we basically build all .o from top Makefile,
|
|
|
9ae3a8 |
before entering Makefile.target, but it will affact arriving per-object
|
|
|
9ae3a8 |
libs support.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The starting point of $(obj) is passed in as argument of unnest-vars, as
|
|
|
9ae3a8 |
well as nested variables, so that different Makefiles can pass in a
|
|
|
9ae3a8 |
right value.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
This is manual backport.
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
Makefile | 14 ++++++++++++++
|
|
|
9ae3a8 |
Makefile.objs | 16 +---------------
|
|
|
9ae3a8 |
Makefile.target | 17 +++++++++++++----
|
|
|
9ae3a8 |
configure | 1 +
|
|
|
9ae3a8 |
rules.mak | 14 +++++++++-----
|
|
|
9ae3a8 |
5 files changed, 38 insertions(+), 24 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: jen <jen@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
Makefile | 14 ++++++++++++++
|
|
|
9ae3a8 |
Makefile.objs | 16 +---------------
|
|
|
9ae3a8 |
Makefile.target | 17 +++++++++++++----
|
|
|
9ae3a8 |
configure | 1 +
|
|
|
9ae3a8 |
rules.mak | 14 +++++++++-----
|
|
|
9ae3a8 |
5 files changed, 38 insertions(+), 24 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/Makefile b/Makefile
|
|
|
9ae3a8 |
index 66774de..f504754 100644
|
|
|
9ae3a8 |
--- a/Makefile
|
|
|
9ae3a8 |
+++ b/Makefile
|
|
|
9ae3a8 |
@@ -120,6 +120,16 @@ defconfig:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ifneq ($(wildcard config-host.mak),)
|
|
|
9ae3a8 |
include $(SRC_PATH)/Makefile.objs
|
|
|
9ae3a8 |
+endif
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+dummy := $(call unnest-vars,, \
|
|
|
9ae3a8 |
+ stub-obj-y \
|
|
|
9ae3a8 |
+ util-obj-y \
|
|
|
9ae3a8 |
+ qga-obj-y \
|
|
|
9ae3a8 |
+ block-obj-y \
|
|
|
9ae3a8 |
+ common-obj-y)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ifneq ($(wildcard config-host.mak),)
|
|
|
9ae3a8 |
include $(SRC_PATH)/tests/Makefile
|
|
|
9ae3a8 |
endif
|
|
|
9ae3a8 |
ifeq ($(CONFIG_SMARTCARD_NSS),y)
|
|
|
9ae3a8 |
@@ -128,6 +138,10 @@ endif
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
config-host.h: config-host.h-timestamp
|
|
|
9ae3a8 |
config-host.h-timestamp: config-host.mak
|
|
|
9ae3a8 |
qemu-options.def: $(SRC_PATH)/qemu-options.hx
|
|
|
9ae3a8 |
diff --git a/Makefile.objs b/Makefile.objs
|
|
|
9ae3a8 |
index 67b4a28..f83a5b2 100644
|
|
|
9ae3a8 |
--- a/Makefile.objs
|
|
|
9ae3a8 |
+++ b/Makefile.objs
|
|
|
9ae3a8 |
@@ -40,7 +40,7 @@ libcacard-y += libcacard/vcardt.o
|
|
|
9ae3a8 |
# single QEMU executable should support all CPUs and machines.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ifeq ($(CONFIG_SOFTMMU),y)
|
|
|
9ae3a8 |
-common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
|
|
|
9ae3a8 |
+common-obj-y = blockdev.o blockdev-nbd.o block/
|
|
|
9ae3a8 |
common-obj-y += net/
|
|
|
9ae3a8 |
common-obj-y += readline.o
|
|
|
9ae3a8 |
common-obj-y += qdev-monitor.o device-hotplug.o
|
|
|
9ae3a8 |
@@ -103,17 +103,3 @@ common-obj-y += disas/
|
|
|
9ae3a8 |
# FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed
|
|
|
9ae3a8 |
# by libqemuutil.a. These should be moved to a separate .json schema.
|
|
|
9ae3a8 |
qga-obj-y = qga/ qapi-types.o qapi-visit.o
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-QEMU_CFLAGS+=$(GLIB_CFLAGS)
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-nested-vars += \
|
|
|
9ae3a8 |
- stub-obj-y \
|
|
|
9ae3a8 |
- util-obj-y \
|
|
|
9ae3a8 |
- qga-obj-y \
|
|
|
9ae3a8 |
- block-obj-y \
|
|
|
9ae3a8 |
- common-obj-y
|
|
|
9ae3a8 |
-dummy := $(call unnest-vars)
|
|
|
9ae3a8 |
diff --git a/Makefile.target b/Makefile.target
|
|
|
9ae3a8 |
index 1cafb17..b871dda 100644
|
|
|
9ae3a8 |
--- a/Makefile.target
|
|
|
9ae3a8 |
+++ b/Makefile.target
|
|
|
9ae3a8 |
@@ -135,13 +135,22 @@ endif # CONFIG_SOFTMMU
|
|
|
9ae3a8 |
# Workaround for http://gcc.gnu.org/PR55489, see configure.
|
|
|
9ae3a8 |
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-nested-vars += obj-y
|
|
|
9ae3a8 |
+dummy := $(call unnest-vars,,obj-y)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-# This resolves all nested paths, so it must come last
|
|
|
9ae3a8 |
+# we are making another call to unnest-vars with different vars, protect obj-y,
|
|
|
9ae3a8 |
+# it can be overriden in subdir Makefile.objs
|
|
|
9ae3a8 |
+obj-y-save := $(obj-y)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+block-obj-y :=
|
|
|
9ae3a8 |
+common-obj-y :=
|
|
|
9ae3a8 |
include $(SRC_PATH)/Makefile.objs
|
|
|
9ae3a8 |
+dummy := $(call unnest-vars,..,block-obj-y common-obj-y)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-all-obj-y = $(obj-y)
|
|
|
9ae3a8 |
-all-obj-y += $(addprefix ../, $(common-obj-y))
|
|
|
9ae3a8 |
+# Now restore obj-y
|
|
|
9ae3a8 |
+obj-y := $(obj-y-save)
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+all-obj-y = $(obj-y) $(common-obj-y)
|
|
|
9ae3a8 |
+all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ifndef CONFIG_HAIKU
|
|
|
9ae3a8 |
LIBS+=-lm
|
|
|
9ae3a8 |
diff --git a/configure b/configure
|
|
|
9ae3a8 |
index 0ac437c..8c6f4e5 100755
|
|
|
9ae3a8 |
--- a/configure
|
|
|
9ae3a8 |
+++ b/configure
|
|
|
9ae3a8 |
@@ -2333,6 +2333,7 @@ if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 gmodule-2.0 > /dev/nu
|
|
|
9ae3a8 |
then
|
|
|
9ae3a8 |
glib_cflags=`$pkg_config --cflags gthread-2.0 gmodule-2.0 2>/dev/null`
|
|
|
9ae3a8 |
glib_libs=`$pkg_config --libs gthread-2.0 gmodule-2.0 2>/dev/null`
|
|
|
9ae3a8 |
+ CFLAGS="$glib_cflags $CFLAGS"
|
|
|
9ae3a8 |
LIBS="$glib_libs $LIBS"
|
|
|
9ae3a8 |
libs_qga="$glib_libs $libs_qga"
|
|
|
9ae3a8 |
else
|
|
|
9ae3a8 |
diff --git a/rules.mak b/rules.mak
|
|
|
9ae3a8 |
index 4499745..0c5125d 100644
|
|
|
9ae3a8 |
--- a/rules.mak
|
|
|
9ae3a8 |
+++ b/rules.mak
|
|
|
9ae3a8 |
@@ -103,9 +103,6 @@ clean: clean-timestamp
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# magic to descend into other directories
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-obj := .
|
|
|
9ae3a8 |
-old-nested-dirs :=
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
define push-var
|
|
|
9ae3a8 |
$(eval save-$2-$1 = $(value $1))
|
|
|
9ae3a8 |
$(eval $1 :=)
|
|
|
9ae3a8 |
@@ -119,9 +116,11 @@ endef
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
define unnest-dir
|
|
|
9ae3a8 |
$(foreach var,$(nested-vars),$(call push-var,$(var),$1/))
|
|
|
9ae3a8 |
-$(eval obj := $(obj)/$1)
|
|
|
9ae3a8 |
+$(eval obj-parent-$1 := $(obj))
|
|
|
9ae3a8 |
+$(eval obj := $(if $(obj),$(obj)/$1,$1))
|
|
|
9ae3a8 |
$(eval include $(SRC_PATH)/$1/Makefile.objs)
|
|
|
9ae3a8 |
-$(eval obj := $(patsubst %/$1,%,$(obj)))
|
|
|
9ae3a8 |
+$(eval obj := $(obj-parent-$1))
|
|
|
9ae3a8 |
+$(eval obj-parent-$1 := )
|
|
|
9ae3a8 |
$(foreach var,$(nested-vars),$(call pop-var,$(var),$1/))
|
|
|
9ae3a8 |
endef
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -136,7 +135,12 @@ $(if $(nested-dirs),
|
|
|
9ae3a8 |
endef
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
define unnest-vars
|
|
|
9ae3a8 |
+$(eval obj := $1)
|
|
|
9ae3a8 |
+$(eval nested-vars := $2)
|
|
|
9ae3a8 |
+$(eval old-nested-dirs := )
|
|
|
9ae3a8 |
$(call unnest-vars-1)
|
|
|
9ae3a8 |
+$(if $1,$(foreach v,$(nested-vars),$(eval \
|
|
|
9ae3a8 |
+ $v := $(addprefix $1/,$($v)))))
|
|
|
9ae3a8 |
$(foreach var,$(nested-vars),$(eval $(var) := $(filter-out %/, $($(var)))))
|
|
|
9ae3a8 |
$(shell mkdir -p $(sort $(foreach var,$(nested-vars),$(dir $($(var))))))
|
|
|
9ae3a8 |
$(foreach var,$(nested-vars), $(eval \
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.9.3
|
|
|
9ae3a8 |
|