More source reorganization and build system TLC
Subsystems (3)
cover More source reorganization and build system TLC
Here is a light version of the source reorganization I proposed last September. While working on it I noticed that a useful part to start from was the utility routines, because this helps identifying missing unit tests and modularity problems. Also, this file are relatively rarely changed. Hence, moving them will not complicate backports to stable branches, and will make the "action" more visible to anyone casually observing the tree.
Hence, this is where this series starts from. After this series, the top directory has about 80 *.c and *.h files, down from over 250 in 1.3.0, which is already a fine improvement.
Patch 1 makes qemu-config.c more modular: there is no need for tools to host the description of QEMU's command-line options.
Patch 2 finishes the transition to libqemustub.a, removing qemu-tool.c and qemu-user.c.
Patches 3 to 13 are a longish digression in libcacard, improving support for libtool in the build system and simplifying the integration between libcacard's build rules and the rest of the Makefiles. Also, vscclient is now linked to the dynamic library so that missing symbols (like the one fixed in patch 7) are caught early. (QEMU still duplicates the code; I'd fear for my physical integrity if I forced people to write "libtool --mode=execute gdb" instead of just "gdb").
Patches 14 to 22 create a new static library libqemuutil.a, whose component files all come from subdirectories of the top tree directory:
qobject, util, qapi. Using a static library helps putting the number of *-obj-y variables on a diet, and limits the duplication in the Makefile rules.
Patches 23 and 24 further limit the number and nesting of *-obj-y variables.
Finally, patches 25 to 27 affect tracing, which is also moved to libqemuutil.a. Patch 25 is Lluis's already posted patch to introduce trace/Makefile.objs.
Alon Levy (1):
libcacard: fix missing symbol in libcacard.so
Lluís Vilanova (1):
build: Use separate makefile for "trace/"
Paolo Bonzini (25):
qemu-option: move standard option definitions out of qemu-config.c
stubs: fully replace qemu-tool.c and qemu-user.c
build: make libtool verbose when making with V=1
build: support linking with libtool objects/libraries
build: move dtrace rules to rules.mak
build: remove CONFIG_SMARTCARD
libcacard: require libtool to build it
libcacard: prepare to use -y trick in the Makefile
libcacard: use per-target variable definitions
libcacard: add list of exported symbols
libcacard: rewrite Makefile in non-recursive style
libcacard: link vscclient to dynamic library
libcacard: list oslib-obj-y file explicitly
build: rename oslib-obj-y to util-obj-y
build: move util-obj-y to libqemuutil.a
build: move files away from tools-obj-y, common-obj-y, user-obj-y
build: move libqemuutil.a components to util/
build: move qobject files to qobject/ and libqemuutil.a
build: consolidate multiple variables into universal-obj-y
build: move QAPI definitions for QEMU out of qapi-obj-y
build: move base QAPI files to libqemuutil.a
build: move version-obj-y to the generic LINK rule
build: remove coroutine-obj-y
build: fold trace-obj-y into libqemuutil.a
build: improve quiet output for .stp rules
.gitignore | 8 +- Makefile | 71 +- Makefile.objs | 172 +---- Makefile.target | 17 +- block/iscsi.c | 27 + blockdev.c | 118 +++ configure | 85 +-- exec.c | 2 +- fsdev/Makefile.objs | 1 + fsdev/qemu-fsdev-dummy.c | 7 - fsdev/qemu-fsdev-opts.c | 85 ++ fsdev/qemu-fsdev.c | 8 - hw/Makefile.objs | 2 +- hw/qdev-monitor.c | 51 ++ hw/usb/Makefile.objs | 2 +- include/qemu/config-file.h | 5 - include/sysemu/sysemu.h | 8 + include/trace.h | 6 + libcacard/Makefile | 62 +- libcacard/libcacard.syms | 77 ++ monitor.c | 22 + net/net.c | 26 + qapi/Makefile.objs | 8 +- qemu-char.c | 72 ++ qemu-config.c | 894 -------------------- qemu-tool.c | 115 --- qemu-user.c | 37 - qobject/Makefile.objs | 3 + json-lexer.c => qobject/json-lexer.c | 0 json-parser.c => qobject/json-parser.c | 0 json-streamer.c => qobject/json-streamer.c | 0 qbool.c => qobject/qbool.c | 0 qdict.c => qobject/qdict.c | 0 qerror.c => qobject/qerror.c | 0 qfloat.c => qobject/qfloat.c | 0 qint.c => qobject/qint.c | 0 qjson.c => qobject/qjson.c | 0 qlist.c => qobject/qlist.c | 0 qstring.c => qobject/qstring.c | 0 qom/Makefile.objs | 6 +- rules.mak | 20 +- scripts/tracetool/backend/dtrace.py | 2 +- scripts/tracetool/format/h.py | 6 +- stubs/Makefile.objs | 13 + stubs/clock-warp.c | 7 + stubs/cpu-get-clock.c | 7 + stubs/cpu-get-icount.c | 9 + stubs/get-vm-name.c | 7 + stubs/iothread-lock.c | 10 + stubs/migr-blocker.c | 10 + stubs/mon-is-qmp.c | 7 + stubs/mon-print-filename.c | 6 + stubs/mon-printf.c | 10 + stubs/mon-protocol-event.c | 6 + stubs/mon-set-error.c | 8 + stubs/slirp.c | 17 + stubs/vm-stop.c | 7 + tests/Makefile | 48 +- trace/Makefile.objs | 58 ++ ui/spice-core.c | 84 ++ util/Makefile.objs | 10 + acl.c => util/acl.c | 0 aes.c => util/aes.c | 0 bitmap.c => util/bitmap.c | 0 bitops.c => util/bitops.c | 0 cache-utils.c => util/cache-utils.c | 0 compatfd.c => util/compatfd.c | 0 cutils.c => util/cutils.c | 0 envlist.c => util/envlist.c | 0 error.c => util/error.c | 0 .../event_notifier-posix.c | 0 .../event_notifier-win32.c | 0 host-utils.c => util/host-utils.c | 0 iov.c => util/iov.c | 0 module.c => util/module.c | 0 notify.c => util/notify.c | 0 osdep.c => util/osdep.c | 0 oslib-posix.c => util/oslib-posix.c | 0 oslib-win32.c => util/oslib-win32.c | 0 path.c => util/path.c | 0 util/qemu-config.c | 215 +++++ qemu-error.c => util/qemu-error.c | 0 qemu-option.c => util/qemu-option.c | 0 qemu-progress.c => util/qemu-progress.c | 0 qemu-sockets.c => util/qemu-sockets.c | 0 qemu-thread-posix.c => util/qemu-thread-posix.c | 0 qemu-thread-win32.c => util/qemu-thread-win32.c | 0 qemu-timer-common.c => util/qemu-timer-common.c | 0 uri.c => util/uri.c | 0 vl.c | 205 +++++ 90 files changed, 1368 insertions(+), 1401 deletions(-) create mode 100644 fsdev/qemu-fsdev-opts.c create mode 100644 include/trace.h create mode 100644 libcacard/libcacard.syms delete mode 100644 qemu-config.c delete mode 100644 qemu-tool.c delete mode 100644 qemu-user.c create mode 100644 qobject/Makefile.objs rename json-lexer.c => qobject/json-lexer.c (100%) rename json-parser.c => qobject/json-parser.c (100%) rename json-streamer.c => qobject/json-streamer.c (100%) rename qbool.c => qobject/qbool.c (100%) rename qdict.c => qobject/qdict.c (100%) rename qerror.c => qobject/qerror.c (100%) rename qfloat.c => qobject/qfloat.c (100%) rename qint.c => qobject/qint.c (100%) rename qjson.c => qobject/qjson.c (100%) rename qlist.c => qobject/qlist.c (100%) rename qstring.c => qobject/qstring.c (100%) create mode 100644 stubs/clock-warp.c create mode 100644 stubs/cpu-get-clock.c create mode 100644 stubs/cpu-get-icount.c create mode 100644 stubs/get-vm-name.c create mode 100644 stubs/iothread-lock.c create mode 100644 stubs/migr-blocker.c create mode 100644 stubs/mon-is-qmp.c create mode 100644 stubs/mon-print-filename.c create mode 100644 stubs/mon-printf.c create mode 100644 stubs/mon-protocol-event.c create mode 100644 stubs/mon-set-error.c create mode 100644 stubs/slirp.c create mode 100644 stubs/vm-stop.c create mode 100644 trace/Makefile.objs create mode 100644 util/Makefile.objs rename acl.c => util/acl.c (100%) rename aes.c => util/aes.c (100%) rename bitmap.c => util/bitmap.c (100%) rename bitops.c => util/bitops.c (100%) rename cache-utils.c => util/cache-utils.c (100%) rename compatfd.c => util/compatfd.c (100%) rename cutils.c => util/cutils.c (100%) rename envlist.c => util/envlist.c (100%) rename error.c => util/error.c (100%) rename event_notifier-posix.c => util/event_notifier-posix.c (100%) rename event_notifier-win32.c => util/event_notifier-win32.c (100%) rename host-utils.c => util/host-utils.c (100%) rename iov.c => util/iov.c (100%) rename module.c => util/module.c (100%) rename notify.c => util/notify.c (100%) rename osdep.c => util/osdep.c (100%) rename oslib-posix.c => util/oslib-posix.c (100%) rename oslib-win32.c => util/oslib-win32.c (100%) rename path.c => util/path.c (100%) create mode 100644 util/qemu-config.c rename qemu-error.c => util/qemu-error.c (100%) rename qemu-option.c => util/qemu-option.c (100%) rename qemu-progress.c => util/qemu-progress.c (100%) rename qemu-sockets.c => util/qemu-sockets.c (100%) rename qemu-thread-posix.c => util/qemu-thread-posix.c (100%) rename qemu-thread-win32.c => util/qemu-thread-win32.c (100%) rename qemu-timer-common.c => util/qemu-timer-common.c (100%) rename uri.c => util/uri.c (100%)
PATCH 1/27 qemu-option: move standard option definitions out of qemu-config.c
--- block/iscsi.c | 27 ++ blockdev.c | 118 ++++++++ fsdev/Makefile.objs | 1 + fsdev/qemu-fsdev-dummy.c | 7 - fsdev/qemu-fsdev-opts.c | 85 ++++++ fsdev/qemu-fsdev.c | 8 - hw/qdev-monitor.c | 51 ++++ include/qemu/config-file.h | 5 - include/sysemu/sysemu.h | 8 + monitor.c | 22 ++ net/net.c | 26 ++ qemu-char.c | 72 +++++ qemu-config.c | 681 +------------------------------------------- ui/spice-core.c | 84 ++++++ vl.c | 205 +++++++++++++ 15 files changed, 700 insertions(+), 700 deletions(-) create mode 100644 fsdev/qemu-fsdev-opts.c
block/iscsi.c +27 -0
@@ -980,9 +980,36 @@ static BlockDriver bdrv_iscsi = {#endif }; +static QemuOptsList qemu_iscsi_opts = { + .name ="iscsi" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_iscsi_opts.head), + .desc = { + { + .name ="user" , + .type =QEMU_OPT_STRING , + .help ="username for CHAP authentication to target" , + },{ + .name ="password" , + .type =QEMU_OPT_STRING , + .help ="password for CHAP authentication to target" , + },{ + .name ="header-digest" , + .type =QEMU_OPT_STRING , + .help ="HeaderDigest setting. " +"{CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}" , + },{ + .name ="initiator-name" , + .type =QEMU_OPT_STRING , + .help ="Initiator iqn name to use when connecting" , + }, + {/* end of list */ } + }, +}; +static void iscsi_block_init (void ) {bdrv_register (&bdrv_iscsi); +qemu_add_opts (&qemu_iscsi_opts); }block_init (iscsi_block_init);
blockdev.c +118 -0
121 lines not on this page · raw message
fsdev/Makefile.objs +1 -0
@@ -7,3 +7,4 @@ extra-obj-y = qemu-fsdev-dummy.o else common-obj-y = qemu-fsdev-dummy.o endif +common-obj-y += qemu-fsdev-opts.o
fsdev/qemu-fsdev-dummy.c +0 -7
@@ -20,10 +20,3 @@ int qemu_fsdev_add(QemuOpts *opts) {return 0 ; } - -static void fsdev_register_config (void ) -{ -qemu_add_opts (&qemu_fsdev_opts); -qemu_add_opts (&qemu_virtfs_opts); -} -machine_init (fsdev_register_config);
fsdev/qemu-fsdev-opts.c new file +85 -0
85 lines not on this page · raw message
fsdev/qemu-fsdev.c +0 -8
@@ -97,11 +97,3 @@ FsDriverEntry *get_fsdev_fsentry(char *id) }return NULL ; } - -static void fsdev_register_config (void ) -{ -qemu_add_opts (&qemu_fsdev_opts); -qemu_add_opts (&qemu_virtfs_opts); -} -machine_init (fsdev_register_config); -
hw/qdev-monitor.c +51 -0
54 lines not on this page · raw message
include/qemu/config-file.h +0 -5
@@ -6,11 +6,6 @@#include "qapi/error.h" #include "qemu/option.h" -extern QemuOptsList qemu_fsdev_opts; -extern QemuOptsList qemu_virtfs_opts; -extern QemuOptsList qemu_spice_opts; -extern QemuOptsList qemu_sandbox_opts; -QemuOptsList *qemu_find_opts (const char *group);QemuOptsList *qemu_find_opts_err (const char *group,Error **errp);void qemu_add_opts (QemuOptsList *list);
include/sysemu/sysemu.h +8 -0
@@ -182,4 +182,12 @@ char *get_boot_devices_list(uint32_t *size);bool usb_enabled (bool default_usb); +extern QemuOptsList qemu_drive_opts; +extern QemuOptsList qemu_chardev_opts; +extern QemuOptsList qemu_device_opts; +extern QemuOptsList qemu_netdev_opts; +extern QemuOptsList qemu_net_opts; +extern QemuOptsList qemu_global_opts; +extern QemuOptsList qemu_mon_opts; +#endif
monitor.c +22 -0
@@ -4790,3 +4790,25 @@ int monitor_read_block_device_key(Monitor *mon, const char *device,return monitor_read_bdrv_key_start (mon, bs, completion_cb, opaque); } + +QemuOptsList qemu_mon_opts = { + .name ="mon" , + .implied_opt_name ="chardev" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_mon_opts.head), + .desc = { + { + .name ="mode" , + .type =QEMU_OPT_STRING , + },{ + .name ="chardev" , + .type =QEMU_OPT_STRING , + },{ + .name ="default" , + .type =QEMU_OPT_BOOL , + },{ + .name ="pretty" , + .type =QEMU_OPT_BOOL , + }, + {/* end of list */ } + }, +};
net/net.c +26 -0
@@ -1054,3 +1054,29 @@ unsigned compute_mcast_idx(const uint8_t *ep) }return crc >>26 ; } + +QemuOptsList qemu_netdev_opts = { + .name ="netdev" , + .implied_opt_name ="type" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_netdev_opts.head), + .desc = { +/* +* no elements => accept any params +* validation will happen later +*/ + {/* end of list */ } + }, +}; + +QemuOptsList qemu_net_opts = { + .name ="net" , + .implied_opt_name ="type" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_net_opts.head), + .desc = { +/* +* no elements => accept any params +* validation will happen later +*/ + {/* end of list */ } + }, +};
qemu-char.c +72 -0
75 lines not on this page · raw message
qemu-config.c +1 -680
693 lines not on this page · raw message
ui/spice-core.c +84 -0
90 lines not on this page · raw message
vl.c +205 -0
217 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/27 stubs: fully replace qemu-tool.c and qemu-user.c
In reply to Paolo Bonzini--- Makefile | 2 +- Makefile.objs | 3 +- exec.c | 2 +- qemu-tool.c | 115 -------------------------------------------- qemu-user.c | 37 -------------- stubs/Makefile.objs | 13 +++++ stubs/clock-warp.c | 7 +++ stubs/cpu-get-clock.c | 7 +++ stubs/cpu-get-icount.c | 9 ++++ stubs/get-vm-name.c | 7 +++ stubs/iothread-lock.c | 10 ++++ stubs/migr-blocker.c | 10 ++++ stubs/mon-is-qmp.c | 7 +++ stubs/mon-print-filename.c | 6 ++ stubs/mon-printf.c | 10 ++++ stubs/mon-protocol-event.c | 6 ++ stubs/mon-set-error.c | 8 +++ stubs/slirp.c | 17 +++++++ stubs/vm-stop.c | 7 +++ tests/Makefile | 18 ++++---- 20 files changed, 136 insertions(+), 165 deletions(-) delete mode 100644 qemu-tool.c delete mode 100644 qemu-user.c create mode 100644 stubs/clock-warp.c create mode 100644 stubs/cpu-get-clock.c create mode 100644 stubs/cpu-get-icount.c create mode 100644 stubs/get-vm-name.c create mode 100644 stubs/iothread-lock.c create mode 100644 stubs/migr-blocker.c create mode 100644 stubs/mon-is-qmp.c create mode 100644 stubs/mon-print-filename.c create mode 100644 stubs/mon-printf.c create mode 100644 stubs/mon-protocol-event.c create mode 100644 stubs/mon-set-error.c create mode 100644 stubs/slirp.c create mode 100644 stubs/vm-stop.c
Makefile +1 -1
@@ -168,7 +168,7 @@ install-libcacard: libcacard.la qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \ +tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o
Makefile.objs +1 -2
@@ -120,7 +120,6 @@ user-obj-y += envlist.o path.o user-obj-y += tcg-runtime.o host-utils.o user-obj-y += cache-utils.o user-obj-y += module.o -user-obj-y += qemu-user.o user-obj-y += qom/ ######################################################################
@@ -220,7 +219,7 @@ universal-obj-y += $(qapi-obj-y) ###################################################################### # guest agent -qga-obj-y = qga/ module.o qemu-tool.o +qga-obj-y = qga/ module.o qga-obj-$(CONFIG_POSIX) += qemu-sockets.o qemu-option.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
exec.c +1 -1
@@ -77,7 +77,7 @@ DEFINE_TLS(CPUArchState *,cpu_single_env);/* 0 = Do not count executed instructions. 1 = Precise instruction counting. 2 = Adaptive rate instruction counting. */ -int use_icount =0 ; +int use_icount;#if !defined(CONFIG_USER_ONLY )
qemu-tool.c deleted +0 -115
115 lines not on this page · raw message
qemu-user.c deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Stubs for QEMU user emulation -* -* Copyright (c) 2012 SUSE LINUX Products GmbH -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, see -* <http://www.gnu.org/licenses/gpl-2.0.html> -*/ - -#include "qemu-common.h" -#include "monitor/monitor.h" - -Monitor *cur_mon; - -int monitor_cur_is_qmp (void ) -{ -return 0 ; -} - -void monitor_vprintf (Monitor *mon,const char *fmt,va_list ap) -{ -} - -void monitor_set_error (Monitor *mon,QError *qerror) -{ -}
stubs/Makefile.objs +13 -0
@@ -1,8 +1,21 @@ stub-obj-y += arch-query-cpu-def.o +stub-obj-y += clock-warp.o +stub-obj-y += cpu-get-clock.o +stub-obj-y += cpu-get-icount.o stub-obj-y += fdset-add-fd.o stub-obj-y += fdset-find-fd.o stub-obj-y += fdset-get-fd.o stub-obj-y += fdset-remove-fd.o stub-obj-y += get-fd.o +stub-obj-y += get-vm-name.o +stub-obj-y += iothread-lock.o +stub-obj-y += migr-blocker.o +stub-obj-y += mon-is-qmp.o +stub-obj-y += mon-printf.o +stub-obj-y += mon-print-filename.o +stub-obj-y += mon-protocol-event.o +stub-obj-y += mon-set-error.o stub-obj-y += set-fd-handler.o +stub-obj-y += slirp.o +stub-obj-y += vm-stop.o stub-obj-$(CONFIG_WIN32) += fd-register.o
stubs/clock-warp.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +void qemu_clock_warp (QEMUClock *clock) +{ +} +
stubs/cpu-get-clock.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +int64_t cpu_get_clock (void ) +{ +return get_clock_realtime (); +}
stubs/cpu-get-icount.c new file +9 -0
@@ -0,0 +1,9 @@ +#include "qemu-common.h" +#include "qemu/timer.h" + +int use_icount; + +int64_t cpu_get_icount (void ) +{ +abort (); +}
stubs/get-vm-name.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu-common.h" + +const char *qemu_get_vm_name (void ) +{ +return NULL ; +} +
stubs/iothread-lock.c new file +10 -0
@@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "qemu/main-loop.h" + +void qemu_mutex_lock_iothread (void ) +{ +} + +void qemu_mutex_unlock_iothread (void ) +{ +}
stubs/migr-blocker.c new file +10 -0
@@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "migration/migration.h" + +void migrate_add_blocker (Error *reason) +{ +} + +void migrate_del_blocker (Error *reason) +{ +}
stubs/mon-is-qmp.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +int monitor_cur_is_qmp (void ) +{ +return 0 ; +}
stubs/mon-print-filename.c new file +6 -0
@@ -0,0 +1,6 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_print_filename (Monitor *mon,const char *filename) +{ +}
stubs/mon-printf.c new file +10 -0
@@ -0,0 +1,10 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_printf (Monitor *mon,const char *fmt, ...) +{ +} + +void monitor_vprintf (Monitor *mon,const char *fmt,va_list ap) +{ +}
stubs/mon-protocol-event.c new file +6 -0
@@ -0,0 +1,6 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +void monitor_protocol_event (MonitorEvent event,QObject *data) +{ +}
stubs/mon-set-error.c new file +8 -0
@@ -0,0 +1,8 @@ +#include "qemu-common.h" +#include "monitor/monitor.h" + +Monitor *cur_mon; + +void monitor_set_error (Monitor *mon,QError *qerror) +{ +}
stubs/slirp.c new file +17 -0
@@ -0,0 +1,17 @@ +#include "qemu-common.h" +#include "slirp/slirp.h" + +void slirp_update_timeout (uint32_t *timeout) +{ +} + +void slirp_select_fill (int *pnfds,fd_set *readfds, +fd_set *writefds,fd_set *xfds) +{ +} + +void slirp_select_poll (fd_set *readfds,fd_set *writefds, +fd_set *xfds,int select_error) +{ +} +
stubs/vm-stop.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "sysemu/sysemu.h" + +void vm_stop (RunState state) +{ +abort (); +}
tests/Makefile +9 -9
@@ -38,7 +38,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) qemu-tool.o +test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o test-qapi-obj-y += module.o
@@ -49,7 +49,7 @@ tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o +tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemustub.a tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
@@ -66,13 +66,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@") -tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) -tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) -tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) -tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) +tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a +tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
Signature · 1 line
1.7.1
PATCH 3/27 build: make libtool verbose when making with V=1
In reply to Paolo Bonzini--- libcacard/Makefile | 2 +- rules.mak | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
libcacard/Makefile +1 -1
@@ -36,7 +36,7 @@ install-libcacard: @echo "libtool is missing, please install and rerun configure"; exit 1 else libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) - $(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") + $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") libcacard_srcpath=$(SRC_PATH)/libcacard libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
rules.mak +2 -1
@@ -24,8 +24,9 @@ ifeq ($(LIBTOOL),) %.lo: %.c @echo "missing libtool. please install and rerun configure"; exit 1 else +LIBTOOL += $(if $(V),,--quiet) %.lo: %.c - $(call quiet-command,$(LIBTOOL) --mode=compile --quiet --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") endif %.o: %.S
Signature · 1 line
1.7.1
PATCH 4/27 build: support linking with libtool objects/libraries
In reply to Paolo BonziniThis patch moves the complication of using libtool to the generic rules.mak file.
--- configure | 8 +++++++- libcacard/Makefile | 11 +++++++---- rules.mak | 10 ++++++++-- 3 files changed, 22 insertions(+), 7 deletions(-)
configure +7 -1
@@ -3651,7 +3651,13 @@ echo "MAKE=$make" >> $config_host_mak echo "INSTALL=$install" >> $config_host_mak echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak -echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak +if test -n "$libtool"; then + echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak + echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak +else + echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak + echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak +fi echo "PYTHON=$python" >> $config_host_mak echo "CC=$cc" >> $config_host_mak echo "CC_I386=$cc_i386" >> $config_host_mak
libcacard/Makefile +7 -4
@@ -10,6 +10,9 @@ $(call set-vpath, $(SRC_PATH)) QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(stub-obj-y) QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) +# libtool will build the .o files, too +$(libcacard-obj-y): | $(libcacard-lobj-y) + QEMU_CFLAGS+=-I../ libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
@@ -54,10 +57,10 @@ install-libcacard: libcacard.pc libcacard.la vscclient $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" $(INSTALL_DIR) "$(DESTDIR)$(bindir)" - $(LIBTOOL) --mode=install $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" - $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.la "$(DESTDIR)$(libdir)" - $(LIBTOOL) --mode=install $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" + $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" + $(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)" + $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" for inc in *.h; do \ - $(LIBTOOL) --mode=install $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ + $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done endif
rules.mak +8 -2
@@ -23,10 +23,18 @@ QEMU_CFLAGS += -I$(<D) -I$(@D) ifeq ($(LIBTOOL),) %.lo: %.c @echo "missing libtool. please install and rerun configure"; exit 1 +LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ + $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ + $(LIBS)," LINK $(TARGET_DIR)$@") else LIBTOOL += $(if $(V),,--quiet) %.lo: %.c $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") +LINK = $(call quiet-command,\ + $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \ + )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ + $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ + $(LIBS),$(if $(filter %.lo %.la,$^),"lt LINK ", " LINK ")"$(TARGET_DIR)$@") endif %.o: %.S
@@ -35,8 +43,6 @@ endif %.o: %.m $(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") -LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(LIBS)," LINK $(TARGET_DIR)$@") - %$(EXESUF): %.o $(call LINK,$^)
Signature · 1 line
1.7.1
PATCH 5/27 build: move dtrace rules to rules.mak
In reply to Paolo Bonzini--- Makefile.objs | 8 -------- rules.mak | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-)
Makefile.objs +0 -8
@@ -169,14 +169,6 @@ trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS) $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o") -ifeq ($(LIBTOOL),) -trace-dtrace.lo: trace-dtrace.dtrace - @echo "missing libtool. please install and rerun configure."; exit 1 -else -trace-dtrace.lo: trace-dtrace.dtrace - $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, " lt GEN trace-dtrace.o") -endif - trace/simple.o: trace/simple.c $(GENERATED_HEADERS) trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
rules.mak +9 -0
@@ -23,6 +23,9 @@ QEMU_CFLAGS += -I$(<D) -I$(@D) ifeq ($(LIBTOOL),) %.lo: %.c @echo "missing libtool. please install and rerun configure"; exit 1 +%.lo: %.dtrace + @echo "missing libtool. please install and rerun configure."; exit 1 + LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ $(LIBS)," LINK $(TARGET_DIR)$@")
@@ -30,6 +33,9 @@ else LIBTOOL += $(if $(V),,--quiet) %.lo: %.c $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") +%.lo: %.dtrace + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, " lt GEN $(TARGET_DIR)$@") + LINK = $(call quiet-command,\ $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \ )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
@@ -43,6 +49,9 @@ endif %.o: %.m $(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") +%.o: %.dtrace + $(call quiet-command,dtrace -o $@ -G -s $<, " GEN $(TARGET_DIR)$@") + %$(EXESUF): %.o $(call LINK,$^)
Signature · 1 line
1.7.1
PATCH 6/27 build: remove CONFIG_SMARTCARD
In reply to Paolo BonziniThe passthru smartcard does not have the shared library dependency, build it unconditionally.
--- configure | 67 ++++++++++++++++++------------------------------- hw/Makefile.objs | 2 +- hw/usb/Makefile.objs | 2 +- 3 files changed, 27 insertions(+), 44 deletions(-)
configure +25 -42
@@ -212,7 +212,6 @@ trace_backend="nop" trace_file="trace" spice="" rbd="" -smartcard="" smartcard_nss="" usb_redir="" opengl=""
@@ -850,10 +849,6 @@ for opt do ;; --enable-xfsctl) xfs="yes" ;; - --disable-smartcard) smartcard="no" - ;; - --enable-smartcard) smartcard="yes" - ;; --disable-smartcard-nss) smartcard_nss="no" ;; --enable-smartcard-nss) smartcard_nss="yes"
@@ -1114,8 +1109,6 @@ echo " --enable-spice enable spice" echo " --enable-rbd enable building the rados block device (rbd)" echo " --disable-libiscsi disable iscsi support" echo " --enable-libiscsi enable iscsi support" -echo " --disable-smartcard disable smartcard support" -echo " --enable-smartcard enable smartcard support" echo " --disable-smartcard-nss disable smartcard nss support" echo " --enable-smartcard-nss enable smartcard nss support" echo " --disable-usb-redir disable usb network redirection support"
@@ -2771,43 +2764,37 @@ EOF fi # check for libcacard for smartcard support -if test "$smartcard" != "no" ; then - smartcard="yes" - smartcard_cflags="" - # TODO - what's the minimal nss version we support? - if test "$smartcard_nss" != "no"; then - cat > $TMPC << EOF +smartcard_cflags="" +# TODO - what's the minimal nss version we support? +if test "$smartcard_nss" != "no"; then + cat > $TMPC << EOF #include <pk11pub.h> int main(void) { PK11_FreeSlot(0); return 0; } EOF - smartcard_includes="-I\$(SRC_PATH)/libcacard" - libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" - libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" - test_cflags="$libcacard_cflags" - # The header files in nss < 3.13.3 have a bug which causes them to - # emit a warning. If we're going to compile QEMU with -Werror, then - # test that the headers don't have this bug. Otherwise we would pass - # the configure test but fail to compile QEMU later. - if test "$werror" = "yes"; then - test_cflags="-Werror $test_cflags" - fi - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ - compile_prog "$test_cflags" "$libcacard_libs"; then - smartcard_nss="yes" - QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" - QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" - libs_softmmu="$libcacard_libs $libs_softmmu" - else - if test "$smartcard_nss" = "yes"; then - feature_not_found "nss" - fi - smartcard_nss="no" + smartcard_includes="-I\$(SRC_PATH)/libcacard" + libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" + libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" + test_cflags="$libcacard_cflags" + # The header files in nss < 3.13.3 have a bug which causes them to + # emit a warning. If we're going to compile QEMU with -Werror, then + # test that the headers don't have this bug. Otherwise we would pass + # the configure test but fail to compile QEMU later. + if test "$werror" = "yes"; then + test_cflags="-Werror $test_cflags" + fi + if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + compile_prog "$test_cflags" "$libcacard_libs"; then + smartcard_nss="yes" + QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" + QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" + libs_softmmu="$libcacard_libs $libs_softmmu" + else + if test "$smartcard_nss" = "yes"; then + feature_not_found "nss" fi + smartcard_nss="no" fi fi -if test "$smartcard" = "no" ; then - smartcard_nss="no" -fi # check for usbredirparser for usb network redirection support if test "$usb_redir" != "no" ; then
@@ -3532,10 +3519,6 @@ if test "$spice" = "yes" ; then echo "CONFIG_SPICE=y" >> $config_host_mak fi -if test "$smartcard" = "yes" ; then - echo "CONFIG_SMARTCARD=y" >> $config_host_mak -fi - if test "$smartcard_nss" = "yes" ; then echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
hw/Makefile.objs +1 -1
@@ -31,7 +31,7 @@ common-obj-$(CONFIG_DMA) += dma.o common-obj-$(CONFIG_I82374) += i82374.o common-obj-$(CONFIG_HPET) += hpet.o common-obj-$(CONFIG_APPLESMC) += applesmc.o -common-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o +common-obj-y += ccid-card-passthru.o common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o common-obj-y += fifo.o
hw/usb/Makefile.objs +1 -1
@@ -4,11 +4,11 @@ common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o hcd-ehci-pci.o hcd-ehci-sysbus.o common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o common-obj-y += libhw.o -common-obj-$(CONFIG_SMARTCARD) += dev-smartcard-reader.o common-obj-$(CONFIG_USB_REDIR) += redirect.o common-obj-y += core.o combined-packet.o bus.o desc.o dev-hub.o common-obj-y += host-$(HOST_USB).o dev-bluetooth.o common-obj-y += dev-hid.o dev-storage.o dev-wacom.o common-obj-y += dev-serial.o dev-network.o dev-audio.o +common-obj-y += dev-smartcard-reader.o common-obj-y += dev-uas.o
Signature · 1 line
1.7.1
PATCH 7/27 libcacard: fix missing symbol in libcacard.so
In reply to Paolo BonziniFrom: Alon Levy <[email protected]>
Before patch:
$ make libcacard.la
$ nm ./libcacard/.libs/libcacard.so.0.0.0 | grep " U " | \
egrep -v "(g_)|(GLIBC)|(SECMOD)|(PK11)|(CERT)|(NSS)|(PORT)|(PR)"
U error_set--- libcacard/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
libcacard/Makefile +1 -1
@@ -7,7 +7,7 @@ libcacard_includedir=$(includedir)/cacard $(call set-vpath, $(SRC_PATH)) # objects linked into a shared library, built with libtool with -fPIC if required -QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(stub-obj-y) +QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o error.o $(trace-obj-y) $(stub-obj-y) QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) # libtool will build the .o files, too
Signature · 1 line
1.7.1
PATCH 8/27 libcacard: require libtool to build it
In reply to Paolo BonziniDo not fail at build time, instead just disable the library if libtool is not present.
--- Makefile | 2 ++ configure | 3 ++- libcacard/Makefile | 8 -------- rules.mak | 6 +----- 4 files changed, 5 insertions(+), 14 deletions(-)
Makefile +2 -0
@@ -157,12 +157,14 @@ libqemustub.a: $(stub-obj-y) ###################################################################### # Support building shared library libcacard +ifeq ($(CONFIG_SMARTCARD_NSS),y) .PHONY: libcacard.la install-libcacard libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) install-libcacard: libcacard.la $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,) +endif ######################################################################
configure +2 -1
@@ -2782,7 +2782,8 @@ EOF if test "$werror" = "yes"; then test_cflags="-Werror $test_cflags" fi - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + if test -n "$libtool" && + $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ compile_prog "$test_cflags" "$libcacard_libs"; then smartcard_nss="yes" QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags"
libcacard/Makefile +0 -8
@@ -31,13 +31,6 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -ifeq ($(LIBTOOL),) -libcacard.la: - @echo "libtool is missing, please install and rerun configure"; exit 1 - -install-libcacard: - @echo "libtool is missing, please install and rerun configure"; exit 1 -else libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")
@@ -63,4 +56,3 @@ install-libcacard: libcacard.pc libcacard.la vscclient for inc in *.h; do \ $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done -endif
rules.mak +1 -5
@@ -21,11 +21,7 @@ QEMU_CFLAGS += -I$(<D) -I$(@D) $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") ifeq ($(LIBTOOL),) -%.lo: %.c - @echo "missing libtool. please install and rerun configure"; exit 1 -%.lo: %.dtrace - @echo "missing libtool. please install and rerun configure."; exit 1 - +LIBTOOL = /bin/false LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ $(LIBS)," LINK $(TARGET_DIR)$@")
Signature · 1 line
1.7.1
PATCH 9/27 libcacard: prepare to use -y trick in the Makefile
In reply to Paolo BonziniRename variables to follow the conventions of the rest of the build systems.
--- libcacard/Makefile | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
libcacard/Makefile +4 -6
@@ -7,17 +7,15 @@ libcacard_includedir=$(includedir)/cacard $(call set-vpath, $(SRC_PATH)) # objects linked into a shared library, built with libtool with -fPIC if required -QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o error.o $(trace-obj-y) $(stub-obj-y) -QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS)) +libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too $(libcacard-obj-y): | $(libcacard-lobj-y) QEMU_CFLAGS+=-I../ -libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y)) - -vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o cutils.o +vscclient: vscclient.o $(libcacard-obj-y) $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") clean:
@@ -31,7 +29,7 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB) +libcacard.la: $(libcacard-lobj-y) $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") libcacard_srcpath=$(SRC_PATH)/libcacard
Signature · 1 line
1.7.1
PATCH 10/27 libcacard: use per-target variable definitions
In reply to Paolo BonziniThis lets the libcacard Makefile use more rules.mak magic.
--- libcacard/Makefile | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
libcacard/Makefile +5 -2
@@ -15,8 +15,9 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) QEMU_CFLAGS+=-I../ +vscclient: LIBS += $(libcacard_libs) vscclient: vscclient.o $(libcacard-obj-y) - $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") + $(call LINK,$^) clean: rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc
@@ -29,8 +30,10 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library +libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined +libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) - $(call quiet-command,$(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@") + $(call LINK,$^) libcacard_srcpath=$(SRC_PATH)/libcacard libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
Signature · 1 line
1.7.1
PATCH 11/27 libcacard: add list of exported symbols
In reply to Paolo BonziniDo not export internal QEMU symbols.
--- libcacard/Makefile | 3 +- libcacard/libcacard.syms | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletions(-) create mode 100644 libcacard/libcacard.syms
libcacard/Makefile +2 -1
@@ -30,7 +30,8 @@ all: libcacard.la libcacard.pc ######################################################################### # Rules for building libcacard standalone library -libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined +libcacard.la: LDFLAGS += -rpath $(libdir) -no-undefined \ + -export-syms $(SRC_PATH)/libcacard/libcacard.syms libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^)
libcacard/libcacard.syms new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 12/27 libcacard: rewrite Makefile in non-recursive style
In reply to Paolo Bonzini--- Makefile | 35 +++++++++-------------------------- configure | 9 +-------- libcacard/Makefile | 33 +++++++++------------------------ 3 files changed, 19 insertions(+), 58 deletions(-)
Makefile +9 -26
@@ -101,6 +101,14 @@ defconfig: -include config-all-devices.mak -include config-all-disas.mak +ifneq ($(wildcard config-host.mak),) +include $(SRC_PATH)/Makefile.objs +include $(SRC_PATH)/tests/Makefile +endif +ifeq ($(CONFIG_SMARTCARD_NSS),y) +include $(SRC_PATH)/libcacard/Makefile +endif + all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all config-host.h: config-host.h-timestamp
@@ -113,12 +121,6 @@ SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) subdir-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) -ifneq ($(wildcard config-host.mak),) -include $(SRC_PATH)/Makefile.objs -endif - -subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o - subdir-pixman: pixman/Makefile $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
@@ -155,18 +157,6 @@ version-obj-$(CONFIG_WIN32) += version.o libqemustub.a: $(stub-obj-y) ###################################################################### -# Support building shared library libcacard - -ifeq ($(CONFIG_SMARTCARD_NSS),y) -.PHONY: libcacard.la install-libcacard -libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(trace-obj-y) - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) - -install-libcacard: libcacard.la - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,) -endif - -###################################################################### qemu-img.o: qemu-img-cmds.h
@@ -180,10 +170,6 @@ qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -vscclient$(EXESUF): LIBS += $(libcacard_libs) -vscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) $(trace-obj-y) libcacard/vscclient.o libqemustub.a - $(call LINK, $^) - fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y) fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
@@ -195,10 +181,6 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated gen-out-type = $(subst .,-,$(suffix $@)) -ifneq ($(wildcard config-host.mak),) -include $(SRC_PATH)/tests/Makefile -endif - qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
@@ -233,6 +215,7 @@ clean: rm -f qemu-options.def find . -name '*.[od]' -exec rm -f {} + rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ + rm -f *.la rm -Rf .libs rm -f qemu-img-cmds.h rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
configure +1 -8
@@ -3130,9 +3130,6 @@ if test "$softmmu" = yes ; then tools="qemu-ga\$(EXESUF) $tools" fi fi - if test "$smartcard_nss" = "yes" ; then - tools="vscclient\$(EXESUF) $tools" - fi fi # Mac OS X ships with a broken assembler
@@ -3963,9 +3960,6 @@ fi if test "$target_softmmu" = "yes" ; then echo "CONFIG_SOFTMMU=y" >> $config_target_mak echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak - if test "$smartcard_nss" = "yes" ; then - echo "subdir-$target: subdir-libcacard" >> $config_host_mak - fi case "$target_arch2" in i386|x86_64) echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak
@@ -4166,10 +4160,9 @@ DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas" DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS qapi-generated" -DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace" FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" -FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile" +FILES="$FILES tests/tcg/lm32/Makefile" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
libcacard/Makefile +9 -24
@@ -1,10 +1,6 @@ --include ../config-host.mak --include $(SRC_PATH)/rules.mak --include $(SRC_PATH)/Makefile.objs - libcacard_includedir=$(includedir)/cacard -$(call set-vpath, $(SRC_PATH)) +TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y)
@@ -13,20 +9,12 @@ libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too $(libcacard-obj-y): | $(libcacard-lobj-y) -QEMU_CFLAGS+=-I../ +all: libcacard.la libcacard.pc -vscclient: LIBS += $(libcacard_libs) -vscclient: vscclient.o $(libcacard-obj-y) +vscclient$(EXESUF): LIBS += $(libcacard_libs) +vscclient$(EXESUF): libcacard/vscclient.o $(libcacard-obj-y) $(call LINK,$^) -clean: - rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc - rm -Rf .libs */.libs - -all: libcacard.la libcacard.pc -# Dummy command so that make thinks it has done something - @true - ######################################################################### # Rules for building libcacard standalone library
@@ -36,25 +24,22 @@ libcacard.la: LIBS += $(libcacard_libs) libcacard.la: $(libcacard-lobj-y) $(call LINK,$^) -libcacard_srcpath=$(SRC_PATH)/libcacard -libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in +libcacard.pc: $(SRC_PATH)/libcacard/libcacard.pc.in $(call quiet-command,sed -e 's|@LIBDIR@|$(libdir)|' \ -e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \ -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \ - -e 's|@PREFIX@|$(prefix)|' \ - < $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc,\ + -e 's|@PREFIX@|$(prefix)|' $< > libcacard.pc,\ " GEN $@") .PHONY: install-libcacard -install-libcacard: libcacard.pc libcacard.la vscclient +install: install-libcacard +install-libcacard: libcacard.pc libcacard.la $(INSTALL_DIR) "$(DESTDIR)$(libdir)" $(INSTALL_DIR) "$(DESTDIR)$(libdir)/pkgconfig" $(INSTALL_DIR) "$(DESTDIR)$(libcacard_includedir)" - $(INSTALL_DIR) "$(DESTDIR)$(bindir)" - $(INSTALL_PROG) vscclient "$(DESTDIR)$(bindir)" $(INSTALL_LIB) libcacard.la "$(DESTDIR)$(libdir)" $(INSTALL_DATA) libcacard.pc "$(DESTDIR)$(libdir)/pkgconfig" for inc in *.h; do \ - $(INSTALL_DATA) $(libcacard_srcpath)/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ + $(INSTALL_DATA) $(SRC_PATH)/libcacard/$$inc "$(DESTDIR)$(libcacard_includedir)"; \ done
Signature · 1 line
1.7.1
PATCH 13/27 libcacard: link vscclient to dynamic library
In reply to Paolo BonziniThere is no reason for vscclient to duplicate the code. rules.mak takes care of invoking libtool to do the link.
--- libcacard/Makefile | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
libcacard/Makefile +1 -2
@@ -11,8 +11,7 @@ $(libcacard-obj-y): | $(libcacard-lobj-y) all: libcacard.la libcacard.pc -vscclient$(EXESUF): LIBS += $(libcacard_libs) -vscclient$(EXESUF): libcacard/vscclient.o $(libcacard-obj-y) +vscclient$(EXESUF): libcacard/vscclient.o libcacard.la $(call LINK,$^) #########################################################################
Signature · 1 line
1.7.1
PATCH 14/27 libcacard: list oslib-obj-y file explicitly
In reply to Paolo BonziniWe will grow the list of files in the next patches, but libcacard should remain slim.
--- libcacard/Makefile | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
libcacard/Makefile +5 -1
@@ -3,7 +3,11 @@ libcacard_includedir=$(includedir)/cacard TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required -libcacard-obj-y=$(oslib-obj-y) error.o $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y += osdep.o cutils.o qemu-timer-common.o error.o +libcacard-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o +libcacard-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o + libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y)) # libtool will build the .o files, too
Signature · 1 line
1.7.1
PATCH 15/27 build: rename oslib-obj-y to util-obj-y
In reply to Paolo BonziniThis prepares the creation of libqemuutil.a in the next patch.
--- Makefile | 4 ++-- Makefile.objs | 10 +++++----- Makefile.target | 4 ++-- tests/Makefile | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-)
Makefile +2 -2
@@ -160,7 +160,7 @@ libqemustub.a: $(stub-obj-y) qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \ +tools-obj-y = $(util-obj-y) $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o
@@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(oslib-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(util-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a $(call LINK, $^) clean:
Makefile.objs +5 -5
@@ -22,10 +22,10 @@ qom-obj-y = qom/ universal-obj-y += $(qom-obj-y) ####################################################################### -# oslib-obj-y is code depending on the OS (win32 vs posix) -oslib-obj-y = osdep.o cutils.o qemu-timer-common.o -oslib-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -oslib-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +# util-obj-y is code depending on the OS (win32 vs posix) +util-obj-y = osdep.o cutils.o qemu-timer-common.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o ####################################################################### # coroutines
@@ -69,7 +69,7 @@ common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ common-obj-y += qom/ common-obj-y += readline.o -common-obj-y += $(oslib-obj-y) +common-obj-y += $(util-obj-y) common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o
Makefile.target +2 -2
@@ -84,7 +84,7 @@ ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user obj-y += linux-user/ -obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y) +obj-y += gdbstub.o thunk.o user-exec.o $(util-obj-y) endif #CONFIG_LINUX_USER
@@ -96,7 +96,7 @@ ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) obj-y += bsd-user/ -obj-y += gdbstub.o user-exec.o $(oslib-obj-y) +obj-y += gdbstub.o user-exec.o $(util-obj-y) endif #CONFIG_BSD_USER
tests/Makefile +1 -1
@@ -85,7 +85,7 @@ TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) -qtest-obj-y = tests/libqtest.o $(oslib-obj-y) libqemustub.a +qtest-obj-y = tests/libqtest.o $(util-obj-y) libqemustub.a $(check-qtest-y): $(qtest-obj-y) .PHONY: check-help
Signature · 1 line
1.7.1
PATCH 16/27 build: move util-obj-y to libqemuutil.a
In reply to Paolo BonziniUse a static library to eliminate repetition in the linking rules.
--- Makefile | 17 +++++++++-------- Makefile.objs | 1 - Makefile.target | 8 ++++---- tests/Makefile | 17 ++++++++--------- 4 files changed, 21 insertions(+), 22 deletions(-)
Makefile +9 -8
@@ -130,7 +130,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure $(SRC_PATH)/pixman/configure: (cd $(SRC_PATH)/pixman; autoreconf -v --install) -$(SUBDIR_RULES): libqemustub.a +$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y)
@@ -152,25 +152,26 @@ version.o: $(SRC_PATH)/version.rc config-host.h version-obj-$(CONFIG_WIN32) += version.o ###################################################################### -# Build library with stubs +# Build libraries libqemustub.a: $(stub-obj-y) +libqemuutil.a: $(util-obj-y) ###################################################################### qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(util-obj-y) $(trace-obj-y) qemu-timer.o \ +tools-obj-y = $(trace-obj-y) qemu-timer.o \ main-loop.o iohandler.o error.o tools-obj-$(CONFIG_POSIX) += compatfd.o -qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y) +fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o $(trace-obj-y) libqemuutil.a libqemustub.a fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
@@ -206,7 +207,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(util-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean:
Makefile.objs +0 -1
@@ -69,7 +69,6 @@ common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ common-obj-y += qom/ common-obj-y += readline.o -common-obj-y += $(util-obj-y) common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o
Makefile.target +4 -4
@@ -84,7 +84,7 @@ ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user obj-y += linux-user/ -obj-y += gdbstub.o thunk.o user-exec.o $(util-obj-y) +obj-y += gdbstub.o thunk.o user-exec.o endif #CONFIG_LINUX_USER
@@ -96,7 +96,7 @@ ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) obj-y += bsd-user/ -obj-y += gdbstub.o user-exec.o $(util-obj-y) +obj-y += gdbstub.o user-exec.o endif #CONFIG_BSD_USER
@@ -161,12 +161,12 @@ endif #CONFIG_LINUX_USER ifdef QEMU_PROGW # The linker builds a windows executable. Make also a console executable. -$(QEMU_PROGW): $(all-obj-y) ../libqemustub.a +$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK,$^) $(QEMU_PROG): $(QEMU_PROGW) $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") else -$(QEMU_PROG): $(all-obj-y) ../libqemustub.a +$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK,$^) endif
tests/Makefile +8 -9
@@ -40,7 +40,6 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o -test-qapi-obj-y += module.o $(test-obj-y): QEMU_INCLUDES += -Itests
@@ -66,13 +65,13 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@") -tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemustub.a -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemustub.a -tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemustub.a +tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
@@ -85,7 +84,7 @@ TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) -qtest-obj-y = tests/libqtest.o $(util-obj-y) libqemustub.a +qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a $(check-qtest-y): $(qtest-obj-y) .PHONY: check-help
Signature · 1 line
1.7.1
PATCH 17/27 build: move files away from tools-obj-y, common-obj-y, user-obj-y
In reply to Paolo BonziniSplit them between libqemuutil.a and, for those used by qemu-img/io/nbd, block-obj-y.
Static libraries ensure that binaries such as qemu-ga do not include unused modules.
--- Makefile | 10 +++------- Makefile.objs | 39 +++++++++++++++++++-------------------- tests/Makefile | 10 +++++----- 3 files changed, 27 insertions(+), 32 deletions(-)
Makefile +3 -7
@@ -161,13 +161,9 @@ libqemuutil.a: $(util-obj-y) qemu-img.o: qemu-img-cmds.h -tools-obj-y = $(trace-obj-y) qemu-timer.o \ - main-loop.o iohandler.o error.o -tools-obj-$(CONFIG_POSIX) += compatfd.o - -qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
Makefile.objs +19 -20
@@ -11,7 +11,7 @@ universal-obj-y += qemu-log.o # QObject qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o -qobject-obj-y += qerror.o error.o qemu-error.o +qobject-obj-y += qerror.o universal-obj-y += $(qobject-obj-y)
@@ -24,8 +24,15 @@ universal-obj-y += $(qom-obj-y) ####################################################################### # util-obj-y is code depending on the OS (win32 vs posix) util-obj-y = osdep.o cutils.o qemu-timer-common.o -util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o +util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o +util-obj-y += bitmap.o bitops.o +util-obj-y += acl.o +util-obj-y += error.o qemu-error.o +util-obj-$(CONFIG_POSIX) += compatfd.o +util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o +util-obj-y += qemu-option.o qemu-progress.o ####################################################################### # coroutines
@@ -45,12 +52,12 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img -block-obj-y = iov.o cache-utils.o qemu-option.o module.o async.o -block-obj-y += nbd.o block.o blockjob.o aes.o qemu-config.o -block-obj-y += thread-pool.o qemu-progress.o qemu-sockets.o uri.o notify.o +block-obj-y = async.o thread-pool.o +block-obj-y += nbd.o block.o blockjob.o block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y) -block-obj-$(CONFIG_POSIX) += event_notifier-posix.o aio-posix.o -block-obj-$(CONFIG_WIN32) += event_notifier-win32.o aio-win32.o +block-obj-y += main-loop.o iohandler.o qemu-timer.o +block-obj-$(CONFIG_POSIX) += aio-posix.o +block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ block-obj-y += $(qapi-obj-y) qapi-types.o qapi-visit.o
@@ -75,11 +82,10 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ extra-obj-$(CONFIG_LINUX) += fsdev/ -common-obj-y += tcg-runtime.o host-utils.o main-loop.o +common-obj-y += tcg-runtime.o common-obj-y += buffered_file.o migration.o migration-tcp.o common-obj-y += qemu-char.o #aio.o -common-obj-y += block-migration.o iohandler.o -common-obj-y += bitmap.o bitops.o +common-obj-y += block-migration.o common-obj-y += page_cache.o common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
@@ -95,9 +101,6 @@ common-obj-y += ui/ common-obj-y += bt-host.o bt-vhci.o common-obj-y += dma-helpers.o -common-obj-y += acl.o -common-obj-$(CONFIG_POSIX) += compatfd.o -common-obj-y += qemu-timer.o qemu-timer-common.o common-obj-y += qtest.o common-obj-y += vl.o
@@ -115,10 +118,7 @@ endif # libuser user-obj-y = -user-obj-y += envlist.o path.o -user-obj-y += tcg-runtime.o host-utils.o -user-obj-y += cache-utils.o -user-obj-y += module.o +user-obj-y += tcg-runtime.o user-obj-y += qom/ ######################################################################
@@ -210,8 +210,7 @@ universal-obj-y += $(qapi-obj-y) ###################################################################### # guest agent -qga-obj-y = qga/ module.o -qga-obj-$(CONFIG_POSIX) += qemu-sockets.o qemu-option.o +qga-obj-y = qga/ vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
tests/Makefile +5 -5
@@ -48,11 +48,11 @@ tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemustub.a -tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a -tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a -tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a -tests/test-iov$(EXESUF): tests/test-iov.o iov.o +tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemuutil.a libqemustub.a +tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a +tests/test-iov$(EXESUF): tests/test-iov.o libqemuutil.a tests/test-qapi-types.c tests/test-qapi-types.h :\ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
Signature · 1 line
1.7.1
PATCH 18/27 build: move libqemuutil.a components to util/
In reply to Paolo Bonzini--- Makefile.objs | 12 ++---------- libcacard/Makefile | 6 +++--- util/Makefile.objs | 10 ++++++++++ acl.c => util/acl.c | 0 aes.c => util/aes.c | 0 bitmap.c => util/bitmap.c | 0 bitops.c => util/bitops.c | 0 cache-utils.c => util/cache-utils.c | 0 compatfd.c => util/compatfd.c | 0 cutils.c => util/cutils.c | 0 envlist.c => util/envlist.c | 0 error.c => util/error.c | 0 .../event_notifier-posix.c | 0 .../event_notifier-win32.c | 0 host-utils.c => util/host-utils.c | 0 iov.c => util/iov.c | 0 module.c => util/module.c | 0 notify.c => util/notify.c | 0 osdep.c => util/osdep.c | 0 oslib-posix.c => util/oslib-posix.c | 0 oslib-win32.c => util/oslib-win32.c | 0 path.c => util/path.c | 0 qemu-config.c => util/qemu-config.c | 0 qemu-error.c => util/qemu-error.c | 0 qemu-option.c => util/qemu-option.c | 0 qemu-progress.c => util/qemu-progress.c | 0 qemu-sockets.c => util/qemu-sockets.c | 0 qemu-thread-posix.c => util/qemu-thread-posix.c | 0 qemu-thread-win32.c => util/qemu-thread-win32.c | 0 qemu-timer-common.c => util/qemu-timer-common.c | 0 uri.c => util/uri.c | 0 31 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 util/Makefile.objs rename acl.c => util/acl.c (100%) rename aes.c => util/aes.c (100%) rename bitmap.c => util/bitmap.c (100%) rename bitops.c => util/bitops.c (100%) rename cache-utils.c => util/cache-utils.c (100%) rename compatfd.c => util/compatfd.c (100%) rename cutils.c => util/cutils.c (100%) rename envlist.c => util/envlist.c (100%) rename error.c => util/error.c (100%) rename event_notifier-posix.c => util/event_notifier-posix.c (100%) rename event_notifier-win32.c => util/event_notifier-win32.c (100%) rename host-utils.c => util/host-utils.c (100%) rename iov.c => util/iov.c (100%) rename module.c => util/module.c (100%) rename notify.c => util/notify.c (100%) rename osdep.c => util/osdep.c (100%) rename oslib-posix.c => util/oslib-posix.c (100%) rename oslib-win32.c => util/oslib-win32.c (100%) rename path.c => util/path.c (100%) rename qemu-config.c => util/qemu-config.c (100%) rename qemu-error.c => util/qemu-error.c (100%) rename qemu-option.c => util/qemu-option.c (100%) rename qemu-progress.c => util/qemu-progress.c (100%) rename qemu-sockets.c => util/qemu-sockets.c (100%) rename qemu-thread-posix.c => util/qemu-thread-posix.c (100%) rename qemu-thread-win32.c => util/qemu-thread-win32.c (100%) rename qemu-timer-common.c => util/qemu-timer-common.c (100%) rename uri.c => util/uri.c (100%)
Makefile.objs +2 -10
@@ -23,16 +23,7 @@ universal-obj-y += $(qom-obj-y) ####################################################################### # util-obj-y is code depending on the OS (win32 vs posix) -util-obj-y = osdep.o cutils.o qemu-timer-common.o -util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o -util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o -util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o -util-obj-y += bitmap.o bitops.o -util-obj-y += acl.o -util-obj-y += error.o qemu-error.o -util-obj-$(CONFIG_POSIX) += compatfd.o -util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o -util-obj-y += qemu-option.o qemu-progress.o +util-obj-y += util/ ####################################################################### # coroutines
@@ -220,6 +211,7 @@ QEMU_CFLAGS+=$(GLIB_CFLAGS) nested-vars += \ stub-obj-y \ + util-obj-y \ qga-obj-y \ qom-obj-y \ qapi-obj-y \
libcacard/Makefile +3 -3
@@ -4,9 +4,9 @@ TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) -libcacard-obj-y += osdep.o cutils.o qemu-timer-common.o error.o -libcacard-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o -libcacard-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o +libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o util/error.o +libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o +libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y))
util/Makefile.objs new file +10 -0
@@ -0,0 +1,10 @@ +util-obj-y = osdep.o cutils.o qemu-timer-common.o +util-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o event_notifier-win32.o +util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o event_notifier-posix.o +util-obj-y += envlist.o path.o host-utils.o cache-utils.o module.o +util-obj-y += bitmap.o bitops.o +util-obj-y += acl.o +util-obj-y += error.o qemu-error.o +util-obj-$(CONFIG_POSIX) += compatfd.o +util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o +util-obj-y += qemu-option.o qemu-progress.o
util/acl.c renamed from acl.c +0 -0
util/aes.c renamed from aes.c +0 -0
util/bitmap.c renamed from bitmap.c +0 -0
util/bitops.c renamed from bitops.c +0 -0
util/cache-utils.c renamed from cache-utils.c +0 -0
util/compatfd.c renamed from compatfd.c +0 -0
util/cutils.c renamed from cutils.c +0 -0
util/envlist.c renamed from envlist.c +0 -0
util/error.c renamed from error.c +0 -0
util/event_notifier-posix.c renamed from event_notifier-posix.c +0 -0
util/event_notifier-win32.c renamed from event_notifier-win32.c +0 -0
util/host-utils.c renamed from host-utils.c +0 -0
util/iov.c renamed from iov.c +0 -0
util/module.c renamed from module.c +0 -0
util/notify.c renamed from notify.c +0 -0
util/osdep.c renamed from osdep.c +0 -0
util/oslib-posix.c renamed from oslib-posix.c +0 -0
util/oslib-win32.c renamed from oslib-win32.c +0 -0
util/path.c renamed from path.c +0 -0
util/qemu-config.c renamed from qemu-config.c +0 -0
util/qemu-error.c renamed from qemu-error.c +0 -0
util/qemu-option.c renamed from qemu-option.c +0 -0
util/qemu-progress.c renamed from qemu-progress.c +0 -0
util/qemu-sockets.c renamed from qemu-sockets.c +0 -0
util/qemu-thread-posix.c renamed from qemu-thread-posix.c +0 -0
util/qemu-thread-win32.c renamed from qemu-thread-win32.c +0 -0
util/qemu-timer-common.c renamed from qemu-timer-common.c +0 -0
util/uri.c renamed from uri.c +0 -0
Signature · 1 line
1.7.1
PATCH 19/27 build: move qobject files to qobject/ and libqemuutil.a
In reply to Paolo Bonzini--- Makefile | 2 +- Makefile.objs | 17 +++-------------- qobject/Makefile.objs | 3 +++ json-lexer.c => qobject/json-lexer.c | 0 json-parser.c => qobject/json-parser.c | 0 json-streamer.c => qobject/json-streamer.c | 0 qbool.c => qobject/qbool.c | 0 qdict.c => qobject/qdict.c | 0 qerror.c => qobject/qerror.c | 0 qfloat.c => qobject/qfloat.c | 0 qint.c => qobject/qint.c | 0 qjson.c => qobject/qjson.c | 0 qlist.c => qobject/qlist.c | 0 qstring.c => qobject/qstring.c | 0 tests/Makefile | 14 +++++++------- 15 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 qobject/Makefile.objs rename json-lexer.c => qobject/json-lexer.c (100%) rename json-parser.c => qobject/json-parser.c (100%) rename json-streamer.c => qobject/json-streamer.c (100%) rename qbool.c => qobject/qbool.c (100%) rename qdict.c => qobject/qdict.c (100%) rename qerror.c => qobject/qerror.c (100%) rename qfloat.c => qobject/qfloat.c (100%) rename qint.c => qobject/qint.c (100%) rename qjson.c => qobject/qjson.c (100%) rename qlist.c => qobject/qlist.c (100%) rename qstring.c => qobject/qstring.c (100%)
Makefile +1 -1
@@ -203,7 +203,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean:
Makefile.objs +3 -14
@@ -1,6 +1,7 @@ ####################################################################### -# Stub library, linked in tools +# Common libraries for tools and emulators stub-obj-y = stubs/ +util-obj-y = util/ qobject/ ####################################################################### # Target-independent parts used in system and user emulation
@@ -8,24 +9,12 @@ universal-obj-y = universal-obj-y += qemu-log.o ####################################################################### -# QObject -qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o -qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o -qobject-obj-y += qerror.o - -universal-obj-y += $(qobject-obj-y) - -####################################################################### # QOM qom-obj-y = qom/ universal-obj-y += $(qom-obj-y) ####################################################################### -# util-obj-y is code depending on the OS (win32 vs posix) -util-obj-y += util/ - -####################################################################### # coroutines coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o coroutine-obj-y += qemu-coroutine-sleep.o
@@ -45,7 +34,7 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y) +block-obj-y += $(coroutine-obj-y) $(version-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o
qobject/Makefile.objs new file +3 -0
@@ -0,0 +1,3 @@ +util-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o +util-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o +util-obj-y += qerror.o
qobject/json-lexer.c renamed from json-lexer.c +0 -0
qobject/json-parser.c renamed from json-parser.c +0 -0
qobject/json-streamer.c renamed from json-streamer.c +0 -0
qobject/qbool.c renamed from qbool.c +0 -0
qobject/qdict.c renamed from qdict.c +0 -0
qobject/qerror.c renamed from qerror.c +0 -0
qobject/qfloat.c renamed from qfloat.c +0 -0
qobject/qint.c renamed from qint.c +0 -0
qobject/qjson.c renamed from qjson.c +0 -0
qobject/qlist.c renamed from qlist.c +0 -0
qobject/qstring.c renamed from qstring.c +0 -0
tests/Makefile +7 -7
@@ -38,17 +38,17 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) +test-qapi-obj-y = $(qapi-obj-y) test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o $(test-obj-y): QEMU_INCLUDES += -Itests -tests/check-qint$(EXESUF): tests/check-qint.o qint.o -tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o -tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o -tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o -tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o -tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) libqemuutil.a libqemustub.a +tests/check-qint$(EXESUF): tests/check-qint.o libqemuutil.a +tests/check-qstring$(EXESUF): tests/check-qstring.o libqemuutil.a +tests/check-qdict$(EXESUF): tests/check-qdict.o libqemuutil.a +tests/check-qlist$(EXESUF): tests/check-qlist.o libqemuutil.a +tests/check-qfloat$(EXESUF): tests/check-qfloat.o libqemuutil.a +tests/check-qjson$(EXESUF): tests/check-qjson.o libqemuutil.a libqemustub.a tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(block-obj-y) libqemuutil.a libqemustub.a
Signature · 1 line
1.7.1
PATCH 20/27 build: consolidate multiple variables into universal-obj-y
In reply to Paolo BonziniThe directory descent mechanism, and a less-flat tree both helped in making some *-obj-y definitions very short. Many of these often end up in universal-obj-y, and used to be separate only because of libuser (which is now part of history...).
Consolidate these variables in a single one.
--- Makefile.objs | 38 ++++++++------------------------------ Makefile.target | 7 +------ qom/Makefile.objs | 6 ++---- 3 files changed, 11 insertions(+), 40 deletions(-)
Makefile.objs +8 -30
@@ -4,17 +4,6 @@ stub-obj-y = stubs/ util-obj-y = util/ qobject/ ####################################################################### -# Target-independent parts used in system and user emulation -universal-obj-y = -universal-obj-y += qemu-log.o - -####################################################################### -# QOM -qom-obj-y = qom/ - -universal-obj-y += $(qom-obj-y) - -####################################################################### # coroutines coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o coroutine-obj-y += qemu-coroutine-sleep.o
@@ -54,7 +43,6 @@ endif common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/ common-obj-y += net/ -common-obj-y += qom/ common-obj-y += readline.o common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o
@@ -62,7 +50,6 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ extra-obj-$(CONFIG_LINUX) += fsdev/ -common-obj-y += tcg-runtime.o common-obj-y += buffered_file.o migration.o migration-tcp.o common-obj-y += qemu-char.o #aio.o common-obj-y += block-migration.o
@@ -95,19 +82,6 @@ common-obj-y += qemu-seccomp.o endif ###################################################################### -# libuser - -user-obj-y = -user-obj-y += tcg-runtime.o -user-obj-y += qom/ - -###################################################################### -# disassemblers -# NOTE: the disassembler code is only needed for debugging - -universal-obj-y += disas/ - -###################################################################### # trace ifeq ($(TRACE_BACKEND),dtrace)
@@ -163,8 +137,6 @@ trace-obj-y += trace/control.o $(trace-obj-y): $(GENERATED_HEADERS) -universal-obj-y += $(trace-obj-y) - ###################################################################### # smartcard
@@ -185,6 +157,14 @@ qapi-obj-y += qapi-types.o qapi-visit.o common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o +####################################################################### +# Target-independent parts used in system and user emulation +universal-obj-y = +universal-obj-y += qemu-log.o +universal-obj-y += tcg-runtime.o +universal-obj-y += qom/ +universal-obj-y += disas/ +universal-obj-y += $(trace-obj-y) universal-obj-y += $(qapi-obj-y) ######################################################################
@@ -202,10 +182,8 @@ nested-vars += \ stub-obj-y \ util-obj-y \ qga-obj-y \ - qom-obj-y \ qapi-obj-y \ block-obj-y \ - user-obj-y \ common-obj-y \ universal-obj-y \ extra-obj-y
Makefile.target +1 -6
@@ -152,12 +152,7 @@ include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(universal-obj-y)) - -ifdef CONFIG_SOFTMMU -all-obj-y += $(addprefix ../, $(common-obj-y)) -else -all-obj-y += $(addprefix ../, $(user-obj-y)) -endif #CONFIG_LINUX_USER +all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y)) ifdef QEMU_PROGW # The linker builds a windows executable. Make also a console executable.
qom/Makefile.objs +2 -4
@@ -1,4 +1,2 @@ -qom-obj-y = object.o container.o qom-qobject.o -qom-obj-twice-y = cpu.o -common-obj-y = $(qom-obj-twice-y) -user-obj-y = $(qom-obj-twice-y) +universal-obj-y = object.o container.o qom-qobject.o +universal-obj-y += cpu.o
Signature · 1 line
1.7.1
PATCH 21/27 build: move QAPI definitions for QEMU out of qapi-obj-y
In reply to Paolo BonziniThere is no reason why for example qemu-ga should include all the definitions for the QEMU monitor. However, there are a few that are needed (qapi_free_SocketAddress, qapi_free_InetSocketAddress, ErrorClass_lookup). These should be moved to a separate "core" .json schema that goes into libqemuutil.a.
For now, make this clearer by moving the qapi-*.o definitions out of libqemuutil.a. Once the above refactoring is done, qga-obj-y should not include anymore qapi-types.o and qapi-visit.o.
--- Makefile.objs | 6 ++++-- tests/Makefile | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +4 -2
@@ -152,7 +152,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) # qapi qapi-obj-y = qapi/ -qapi-obj-y += qapi-types.o qapi-visit.o common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o
@@ -166,11 +165,14 @@ universal-obj-y += qom/ universal-obj-y += disas/ universal-obj-y += $(trace-obj-y) universal-obj-y += $(qapi-obj-y) +universal-obj-y += qapi-types.o qapi-visit.o ###################################################################### # guest agent -qga-obj-y = qga/ +# FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed +# by libqemuutil.a. These should be moved to a separate .json schema. +qga-obj-y = qga/ qapi-types.o qapi-visit.o vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
tests/Makefile +1 -1
@@ -70,7 +70,7 @@ tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(te tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a -tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a +tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
Signature · 1 line
1.7.1
PATCH 22/27 build: move base QAPI files to libqemuutil.a
In reply to Paolo Bonzini--- Makefile | 2 +- Makefile.objs | 9 ++------- qapi/Makefile.objs | 8 ++++---- tests/Makefile | 3 +-- 4 files changed, 8 insertions(+), 14 deletions(-)
Makefile +1 -1
@@ -203,7 +203,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(qapi-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean:
Makefile.objs +2 -7
@@ -1,7 +1,7 @@ ####################################################################### # Common libraries for tools and emulators stub-obj-y = stubs/ -util-obj-y = util/ qobject/ +util-obj-y = util/ qobject/ qapi/ ####################################################################### # coroutines
@@ -28,7 +28,7 @@ block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ -block-obj-y += $(qapi-obj-y) qapi-types.o qapi-visit.o +block-obj-y += qapi-types.o qapi-visit.o ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
@@ -151,8 +151,6 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y) ###################################################################### # qapi -qapi-obj-y = qapi/ - common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o
@@ -164,8 +162,6 @@ universal-obj-y += tcg-runtime.o universal-obj-y += qom/ universal-obj-y += disas/ universal-obj-y += $(trace-obj-y) -universal-obj-y += $(qapi-obj-y) -universal-obj-y += qapi-types.o qapi-visit.o ###################################################################### # guest agent
@@ -184,7 +180,6 @@ nested-vars += \ stub-obj-y \ util-obj-y \ qga-obj-y \ - qapi-obj-y \ block-obj-y \ common-obj-y \ universal-obj-y \
qapi/Makefile.objs +4 -4
@@ -1,5 +1,5 @@ -qapi-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o -qapi-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o -qapi-obj-y += string-input-visitor.o string-output-visitor.o +util-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o +util-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o +util-obj-y += string-input-visitor.o string-output-visitor.o -common-obj-y += opts-visitor.o +util-obj-y += opts-visitor.o
tests/Makefile +1 -2
@@ -38,8 +38,7 @@ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ tests/test-qmp-commands.o tests/test-visitor-serialization.o -test-qapi-obj-y = $(qapi-obj-y) -test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o +test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o $(test-obj-y): QEMU_INCLUDES += -Itests
Signature · 1 line
1.7.1
PATCH 23/27 build: move version-obj-y to the generic LINK rule
In reply to Paolo BonziniThere is no reason for it to be in block-obj-y, in particular.
--- Makefile | 2 +- Makefile.objs | 3 +-- rules.mak | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-)
Makefile +1 -1
@@ -203,7 +203,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) $(version-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean:
Makefile.objs +1 -2
@@ -23,7 +23,7 @@ coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) $(version-obj-y) +block-obj-y += $(coroutine-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o
@@ -56,7 +56,6 @@ common-obj-y += block-migration.o common-obj-y += page_cache.o common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o -common-obj-$(CONFIG_WIN32) += version.o common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
rules.mak +2 -2
@@ -23,7 +23,7 @@ QEMU_CFLAGS += -I$(<D) -I$(@D) ifeq ($(LIBTOOL),) LIBTOOL = /bin/false LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ - $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ + $(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(version-obj-y) \ $(LIBS)," LINK $(TARGET_DIR)$@") else LIBTOOL += $(if $(V),,--quiet)
@@ -35,7 +35,7 @@ LIBTOOL += $(if $(V),,--quiet) LINK = $(call quiet-command,\ $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \ )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ - $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \ + $(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(version-obj-y) \ $(LIBS),$(if $(filter %.lo %.la,$^),"lt LINK ", " LINK ")"$(TARGET_DIR)$@") endif
Signature · 1 line
1.7.1
PATCH 24/27 build: remove coroutine-obj-y
In reply to Paolo BonziniJust fold it into block-obj-y.
--- Makefile.objs | 29 +++++++++++++---------------- 1 files changed, 13 insertions(+), 16 deletions(-)
Makefile.objs +13 -16
@@ -4,32 +4,29 @@ stub-obj-y = stubs/ util-obj-y = util/ qobject/ qapi/ ####################################################################### -# coroutines -coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o -coroutine-obj-y += qemu-coroutine-sleep.o -ifeq ($(CONFIG_UCONTEXT_COROUTINE),y) -coroutine-obj-$(CONFIG_POSIX) += coroutine-ucontext.o -else -ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y) -coroutine-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o -else -coroutine-obj-$(CONFIG_POSIX) += coroutine-gthread.o -endif -endif -coroutine-obj-$(CONFIG_WIN32) += coroutine-win32.o - -####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img block-obj-y = async.o thread-pool.o block-obj-y += nbd.o block.o blockjob.o -block-obj-y += $(coroutine-obj-y) block-obj-y += main-loop.o iohandler.o qemu-timer.o block-obj-$(CONFIG_POSIX) += aio-posix.o block-obj-$(CONFIG_WIN32) += aio-win32.o block-obj-y += block/ block-obj-y += qapi-types.o qapi-visit.o +block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o +block-obj-y += qemu-coroutine-sleep.o +ifeq ($(CONFIG_UCONTEXT_COROUTINE),y) +block-obj-$(CONFIG_POSIX) += coroutine-ucontext.o +else +ifeq ($(CONFIG_SIGALTSTACK_COROUTINE),y) +block-obj-$(CONFIG_POSIX) += coroutine-sigaltstack.o +else +block-obj-$(CONFIG_POSIX) += coroutine-gthread.o +endif +endif +block-obj-$(CONFIG_WIN32) += coroutine-win32.o + ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add. # only pull in the actual virtio-9p device if we also enabled virtio.
Signature · 1 line
1.7.1
PATCH 25/27 build: Use separate makefile for "trace/"
In reply to Paolo BonziniFrom: Lluís Vilanova <[email protected]>
--- .gitignore | 8 ++-- Makefile | 15 +++++--- Makefile.objs | 57 ++-------------------------------- Makefile.target | 1 + include/trace.h | 6 +++ scripts/tracetool/backend/dtrace.py | 2 +- scripts/tracetool/format/h.py | 6 ++-- trace/Makefile.objs | 58 +++++++++++++++++++++++++++++++++++ 8 files changed, 85 insertions(+), 68 deletions(-) create mode 100644 include/trace.h create mode 100644 trace/Makefile.objs
.gitignore +4 -4
@@ -3,10 +3,10 @@ config-all-devices.* config-all-disas.* config-host.* config-target.* -trace.h -trace.c -trace-dtrace.h -trace-dtrace.dtrace +trace/generated-tracers.h +trace/generated-tracers.c +trace/generated-tracers-dtrace.h +trace/generated-tracers-dtrace.dtrace *-timestamp *-softmmu *-darwin-user
Makefile +9 -6
@@ -31,12 +31,15 @@ ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) endif endif -GENERATED_HEADERS = config-host.h trace.h qemu-options.def +GENERATED_HEADERS = config-host.h qemu-options.def +GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h +GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c + +GENERATED_HEADERS += trace/generated-tracers.h ifeq ($(TRACE_BACKEND),dtrace) -GENERATED_HEADERS += trace-dtrace.h +GENERATED_HEADERS += trace/generated-tracers-dtrace.h endif -GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h -GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c +GENERATED_SOURCES += trace/generated-tracers.c # Don't try to regenerate Makefile or configure # We don't generate any of them
@@ -215,9 +218,9 @@ clean: rm -f *.la rm -Rf .libs rm -f qemu-img-cmds.h - rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp @# May not be present in GENERATED_HEADERS - rm -f trace-dtrace.h trace-dtrace.h-timestamp + rm -f trace/generated-tracers-dtrace.dtrace* + rm -f trace/generated-tracers-dtrace.h* rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp) rm -rf qapi-generated
Makefile.objs +3 -54
73 lines not on this page · raw message
Makefile.target +1 -0
@@ -152,6 +152,7 @@ include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(universal-obj-y)) +all-obj-y += $(addprefix ../, $(trace-obj-y)) all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y)) ifdef QEMU_PROGW
include/trace.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef TRACE_H +#define TRACE_H + +#include "trace/generated-tracers.h" + +#endif /* TRACE_H */
scripts/tracetool/backend/dtrace.py +1 -1
@@ -37,7 +37,7 @@ def c(events): def h(events): - out('#include "trace-dtrace.h"', + out('#include "trace/generated-tracers-dtrace.h"', '') for e in events:
scripts/tracetool/format/h.py +3 -3
@@ -19,8 +19,8 @@ from tracetool import out def begin(events): out('/* This file is autogenerated by tracetool, do not edit. */', '', - '#ifndef TRACE_H', - '#define TRACE_H', + '#ifndef TRACE__GENERATED_TRACERS_H', + '#define TRACE__GENERATED_TRACERS_H', '', '#include "qemu-common.h"')
@@ -32,7 +32,7 @@ def end(events): enabled = 1 out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled)) out('', - '#endif /* TRACE_H */') + '#endif /* TRACE__GENERATED_TRACERS_H */') def nop(events): for e in events:
trace/Makefile.objs new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 26/27 build: fold trace-obj-y into libqemuutil.a
In reply to Paolo Bonzini--- Makefile | 14 +++++++------- Makefile.objs | 10 ++-------- Makefile.target | 1 - libcacard/Makefile | 3 ++- tests/Makefile | 8 ++++---- trace/Makefile.objs | 10 +++++----- 6 files changed, 20 insertions(+), 26 deletions(-)
Makefile +7 -7
@@ -135,9 +135,9 @@ $(SRC_PATH)/pixman/configure: $(SUBDIR_RULES): libqemuutil.a libqemustub.a -$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) +$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(common-obj-y) $(extra-obj-y) -$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(user-obj-y) +$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(user-obj-y) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) romsubdir-%:
@@ -164,13 +164,13 @@ libqemuutil.a: $(util-obj-y) qemu-img.o: qemu-img-cmds.h -qemu-img$(EXESUF): qemu-img.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-nbd$(EXESUF): qemu-nbd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a -qemu-io$(EXESUF): qemu-io.o cmd.o $(trace-obj-y) $(block-obj-y) libqemuutil.a libqemustub.a +qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a +qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a +qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o -fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o $(trace-obj-y) libqemuutil.a libqemustub.a +fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
@@ -206,7 +206,7 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) -qemu-ga$(EXESUF): $(qga-obj-y) $(trace-obj-y) libqemuutil.a libqemustub.a +qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a $(call LINK, $^) clean:
Makefile.objs +2 -8
@@ -1,7 +1,7 @@ ####################################################################### # Common libraries for tools and emulators stub-obj-y = stubs/ -util-obj-y = util/ qobject/ qapi/ +util-obj-y = util/ qobject/ qapi/ trace/ ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img
@@ -78,11 +78,6 @@ common-obj-y += qemu-seccomp.o endif ###################################################################### -# trace - -trace-obj-y += trace/ - -###################################################################### # smartcard libcacard-y += libcacard/cac.o libcacard/event.o
@@ -127,6 +122,5 @@ nested-vars += \ block-obj-y \ common-obj-y \ universal-obj-y \ - extra-obj-y \ - trace-obj-y + extra-obj-y dummy := $(call unnest-vars)
Makefile.target +0 -1
@@ -152,7 +152,6 @@ include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(universal-obj-y)) -all-obj-y += $(addprefix ../, $(trace-obj-y)) all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y)) ifdef QEMU_PROGW
libcacard/Makefile +2 -1
@@ -3,10 +3,11 @@ libcacard_includedir=$(includedir)/cacard TOOLS += vscclient$(EXESUF) # objects linked into a shared library, built with libtool with -fPIC if required -libcacard-obj-y = $(trace-obj-y) $(stub-obj-y) $(libcacard-y) +libcacard-obj-y = $(stub-obj-y) $(libcacard-y) libcacard-obj-y += util/osdep.o util/cutils.o util/qemu-timer-common.o util/error.o libcacard-obj-$(CONFIG_WIN32) += util/oslib-win32.o util/qemu-thread-win32.o libcacard-obj-$(CONFIG_POSIX) += util/oslib-posix.o util/qemu-thread-posix.o +libcacard-obj-y += $(filter trace/%, $(util-obj-y)) libcacard-lobj-y=$(patsubst %.o,%.lo,$(libcacard-obj-y))
tests/Makefile +4 -4
@@ -72,10 +72,10 @@ tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi- tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y) qapi-types.o qapi-visit.o libqemuutil.a libqemustub.a tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) libqemuutil.a libqemustub.a -tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y) -tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y) -tests/fdc-test$(EXESUF): tests/fdc-test.o tests/libqtest.o $(trace-obj-y) -tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/libqtest.o $(trace-obj-y) +tests/rtc-test$(EXESUF): tests/rtc-test.o +tests/m48t59-test$(EXESUF): tests/m48t59-test.o +tests/fdc-test$(EXESUF): tests/fdc-test.o +tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o # QTest rules
trace/Makefile.objs +5 -5
@@ -51,8 +51,8 @@ endif ###################################################################### # Backend code -trace-obj-$(CONFIG_TRACE_DEFAULT) += default.o -trace-obj-$(CONFIG_TRACE_SIMPLE) += simple.o -trace-obj-$(CONFIG_TRACE_STDERR) += stderr.o -trace-obj-y += control.o -trace-obj-y += generated-tracers.o +util-obj-$(CONFIG_TRACE_DEFAULT) += default.o +util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o +util-obj-$(CONFIG_TRACE_STDERR) += stderr.o +util-obj-y += control.o +util-obj-y += generated-tracers.o
Signature · 1 line
1.7.1
PATCH 27/27 build: improve quiet output for .stp rules
In reply to Paolo BonziniMention the directory in which the .stp file is being generated.
--- Makefile.target | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
@@ -54,7 +54,7 @@ $(QEMU_PROG).stp: $(SRC_PATH)/trace-events --binary=$(bindir)/$(QEMU_PROG) \ --target-arch=$(TARGET_ARCH) \ --target-type=$(TARGET_TYPE) \ - < $< > $@," GEN $(QEMU_PROG).stp") + < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp") else stap: endif
Signature · 1 line
1.7.1
Paolo Bonzini writes:
[...]
Quoted 3 lines
Finally, patches 25 to 27 affect tracing, which is also moved to libqemuutil.a. Patch 25 is Lluis's already posted patch to introduce trace/Makefile.objs.
I just skimmed through the patches, but is there a clean way to have files included only in binaries that are/aren't target system emulators? And what about files that contain conditionally compiled code according to that same condition?
I'm asking because in the trace instrumentation patches (which I'll update next week rebased on latest master) I had to add build code to do it.
Thanks,
Lluis
Signature · 4 lines
"And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth
Il 21/12/2012 21:14, Lluís Vilanova ha scritto:
Quoted 6 lines
Paolo Bonzini writes:
[...]Quoted 3 lines
Finally, patches 25 to 27 affect tracing, which is also moved to libqemuutil.a. Patch 25 is Lluis's already posted patch to introduce trace/Makefile.objs.
Quoted 7 lines
I just skimmed through the patches, but is there a clean way to have files included only in binaries that are/aren't target system emulators? And what about files that contain conditionally compiled code according to that same condition?
I'm asking because in the trace instrumentation patches (which I'll update next week rebased on latest master) I had to add build code to do it.
Yes, this is what libqemustub does.
Paolo