This conditionally sets CONFIG_QEMU_TIMER in configure when something like --enable-trace-backend=simple is set which requires qemu-timer-common.o. Object groups dependent on such code can then simply do:
x-obj-$(CONFIG_QEMU_TIMER) += qemu-timer-common.o This also fixes build issue with qemu-ga due due not linking in qemu-timer-common.o when using --enable-trace-backend=simple Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> --- Makefile.objs | 3 ++- configure | 5 +++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index d1f3e5d..0048650 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -177,6 +177,7 @@ user-obj-y = user-obj-y += envlist.o path.o user-obj-y += tcg-runtime.o host-utils.o user-obj-y += cutils.o cache-utils.o +user-obj-$(CONFIG_QEMU_TIMER) += qemu-timer-common.o ###################################################################### # libhw @@ -380,7 +381,6 @@ else trace-obj-y = trace.o ifeq ($(TRACE_BACKEND),simple) trace-obj-y += simpletrace.o -user-obj-y += qemu-timer-common.o endif endif @@ -404,6 +404,7 @@ qga-obj-y = $(addprefix qga/, $(qga-nested-y)) qga-obj-y += qemu-ga.o qemu-tool.o qemu-error.o qemu-sockets.o module.o qemu-option.o cutils.o osdep.o qga-obj-$(CONFIG_WIN32) += oslib-win32.o qga-obj-$(CONFIG_POSIX) += oslib-posix.o +qga-obj-$(CONFIG_QEMU_TIMER) += qemu-timer-common.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) diff --git a/configure b/configure index 1340c33..64da275 100755 --- a/configure +++ b/configure @@ -183,6 +183,7 @@ usb_redir="" opengl="" zlib="yes" guest_agent="yes" +qemu_timer="no" # parse CC options first for opt do @@ -3071,6 +3072,7 @@ fi # Set the appropriate trace file. if test "$trace_backend" = "simple"; then trace_file="\"$trace_file-\" FMT_pid" + qemu_timer="yes" fi if test "$trace_backend" = "dtrace" -a "$trace_backend_stap" = "yes" ; then echo "CONFIG_SYSTEMTAP_TRACE=y" >> $config_host_mak @@ -3109,6 +3111,9 @@ echo "LIBS+=$LIBS" >> $config_host_mak echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak echo "LIBS_QGA+=$libs_qga" >> $config_host_mak +if test "$qemu_timer" = "yes" ; then + echo "CONFIG_QEMU_TIMER=y" >>$config_host_mak +fi # generate list of library paths for linker script -- 1.7.0.4