]> xenbits.xensource.com Git - libvirt.git/commit
examples: Avoid gnulib, have standalone examples
authorEric Blake <eblake@redhat.com>
Tue, 8 Jan 2019 04:15:48 +0000 (22:15 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 8 Jan 2019 15:26:51 +0000 (09:26 -0600)
commitacf522e85a9747457e6d81a6cae9eef1cf677ff0
tree98f4f9c6a0c771b8d31ee8b1e84fdde99c6c4107
parent6933ebc497f5b432c0dc8c89450a2723c45371bd
examples: Avoid gnulib, have standalone examples

Commit 0c6ad476 updated gnulib, which rearranged some of the
conditions in gnulib wrapper headers such that compilation
started failing on BSD systems when the normal system <unistd.h>
tried to include another system header but instead got a
gnulib wrapper header in an incomplete state; this is because
gnulib headers only work if <config.h> is included first.

Commit b6f78259 papered over the symptoms of that by including
<config.h> in all the examples.  But this logic is backwards -
if our examples are truly meant to be stand-alone, they should
NOT depend on how libvirt was configured, and should NOT
depend on the gnulib fixes for system quirks.  In particular,
if an example does not need to link against libgnulib.la,
then it also does not need to use -Ignulib in its compile
flags, and likewise does not need to include <config.h> since
none of the gnulib wrapper headers should be interfering.

So, revert (most of) b6f78259 (except for the bogus pre-patch
use of "config.h" in admin/logging.c: if config.h is included,
it should be via <> rather than "", and must be before any
system headers); then additionally nuke all mention of
<config.h>, -Ignulib, and -llibgnu.la, making all of the
examples truly standalone.

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 files changed:
examples/Makefile.am
examples/admin/client_close.c
examples/admin/client_info.c
examples/admin/client_limits.c
examples/admin/list_clients.c
examples/admin/list_servers.c
examples/admin/logging.c
examples/admin/threadpool_params.c
examples/dommigrate/dommigrate.c
examples/domsuspend/suspend.c
examples/domtop/domtop.c
examples/hellolibvirt/hellolibvirt.c
examples/object-events/event-test.c
examples/openauth/openauth.c
examples/rename/rename.c