Commit Graph

18 Commits

Author SHA1 Message Date
Eric Blake
ec81852f46 build: enforce makefile conditional style
Automake has builtin support to prevent botched conditional nesting,
but only if you use:
if FOO
else !FOO
endif !FOO

An example error message when using the wrong name:

daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE

As our makefiles tend to have quite a bit of nested conditionals,
it's better to take advantage of the benefits of the build system
double-checking that our conditionals are well-nested, but that
requires a syntax check to enforce our usage style.

Alas, unlike C preprocessor and spec files, we can't use indentation
to make it easier to see how deeply nesting goes.

* cfg.mk (sc_makefile_conditionals): New rule.
* daemon/Makefile.am: Enforce the style.
* gnulib/tests/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-04 09:40:20 -06:00
Eric Blake
70363ea9ff build: add configure option to disable gnulib tests
The gnulib testsuite is relatively stable - the only times it is
likely to have a test change from pass to fail is on a gnulib
submodule update or a major system change (such as moving from
Fedora 18 to 19, or other large change to libc).  While it is an
important test for end users on arbitrary machines (to make sure
that the portability glue works for their machine), it mostly
wastes time for development testing (as most developers aren't
making any of the major changes that would cause gnulib tests
to alter behavior).  Thus, it pays to make the tests optional
at configure time, defaulting to off for development, on for
tarballs, with autobuilders requesting it to be on.  It also
helps to allow a make-time override, via VIR_TEST_EXPENSIVE=[01]
(much the way automake sets up V=[01] for overriding the configure
time default of how verbose to be).

Automake has some pretty hard-coded magic with regards to the
TESTS variable; I had quite a job figuring out how to keep
'make distcheck' passing regardless of the configure option
setting in use, while still disabling the tests at runtime
when I did not configure them on and did not use the override
variable.  Thankfully, we require GNU make, which lets me
hide some information from Automake's magic handling of TESTS.

* bootstrap.conf (bootstrap_epilogue): Munge gnulib test variable.
* configure.ac (--enable-expensive-tests): Add new enable switch.
(VIR_TEST_EXPENSIVE_DEFAULT, WITH_EXPENSIVE_TESTS): Set new
witnesses.
* gnulib/tests/Makefile.am (TESTS): Make tests conditional on
configure settings and the VIR_TEST_EXPENSIVE variable.
* tests/Makefile.am (TESTS_ENVIRONMENT): Expose VIR_TEST_EXPENSIVE
to all tests.
* autobuild.sh: Enable all tests during autobuilds.
* libvirt.spec.in (%configure): Likewise.
* mingw-libvirt.spec.in (%mingw_configure): Likewise.
* docs/hacking.html.in: Document the option.
* HACKING: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-12 10:02:38 -06:00
Eric Blake
d7f53c7b97 maint: use LGPL correctly
Several files called out COPYING or COPYING.LIB instead of using
the normal boilerplate.  It's especially important that we don't
call out COPYING from an LGPL file, since COPYING is traditionally
used for the GPL.  A few files were lacking copyright altogether.

* src/rpc/gendispatch.pl: Add missing copyright.
* Makefile.nonreentrant: Likewise.
* src/check-symfile.pl: Likewise.
* src/check-symsorting.pl: Likewise.
* src/driver.h: Likewise.
* src/internal.h: Likewise.
* tools/libvirt-guests.sh.in: Likewise.
* tools/virt-pki-validate.in: Mention copyright in comment, not just code.
* tools/virt-sanlock-cleanup.in: Likewise.
* src/rpc/genprotocol.pl: Spell out license terms.
* src/xen/xend_internal.h: Likewise.
* src/xen/xend_internal.c: Likewise.
* Makefile.am: Likewise.
* daemon/Makefile.am: Likewise.
* docs/Makefile.am: Likewise.
* docs/schemas/Makefile.am: Likewise.
* examples/apparmor/Makefile.am: Likewise.
* examples/domain-events/events-c/Makefile.am: Likewise.
* examples/dominfo/Makefile.am: Likewise.
* examples/domsuspend/Makefile.am: Likewise.
* examples/hellolibvirt/Makefile.am: Likewise.
* examples/openauth/Makefile.am: Likewise.
* examples/python/Makefile.am: Likewise.
* examples/systemtap/Makefile.am: Likewise.
* examples/xml/nwfilter/Makefile.am: Likewise.
* gnulib/lib/Makefile.am: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* include/Makefile.am: Likewise.
* include/libvirt/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* python/tests/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
* configure.ac: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-20 14:03:48 -06:00
Matthias Bolte
b590866bdb freebsd: Fix build problem due to picking up the wrong libvirt.h
Gettext annoyingly modifies CPPFLAGS in-place, putting
-I/usr/local/include into the search patch if libintl headers
must be used from that location.  But since we must support
automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used
prior to INCLUDES, this means that the build picks up the _old_
installed libvirt.h in priority to the in-tree version, leading
to all sorts of weird build failures on FreeBSD.

Fix this by teaching configure to undo gettext's actions, but
to keep any changes required by gettext at the end of INCLUDES
after all in-tree locations are used first.  Also requires
adding a wrapper Makefile.am and making gnulib-tool create
just gnulib.mk files during the bootstrap process.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-07-29 07:35:54 -06:00
Jim Meyering
7bb22f58b8 make .gnulib a submodule
This makes it so we record (via a git submodule)
a snapshot of whatever version of gnulib we're using,
and none of gnulib sources are in the libvirt repository.
The result is that we have as much reproducibility as when
we version-controlled imported copies of the gnulib sources,
but without the hassle of the manual process we used when
syncing with upstream.

Note that when you clone libvirt, you get only the libvirt
repository, but when you first run ./bootstrap, it clones
gnulib (at the SHA1 recorded via the submodule), creating
the .gnulib/ hierarchy.  Then, the bootstrap script runs
gnulib-tool to populate gnulib/ with the files that make
up the selected modules.

Put the following in your ~/.gitconfig file.
[alias]
  syncsub = submodule foreach git pull origin master

The update procedure is simple:
  git syncsub
  ...build & test...
  git commit -m 'gnulib: sync submodule to latest' .gnulib

* .gitmodules: New file.
* .gnulib: Initialize.
* bootstrap: Set up to use the new submodule.
Stop using --no-vc-files.
Don't remove .gitignore files.
Don't use or create .cvsignore.
Diagnose an invalid --gnulib-srcdir=DIR argument.
* build-aux/vc-list-files: Delete file, now pulled from gnulib.
* build-aux/useless-if-before-free: Likewise.
* po/POTFILES.in: Remove gnulib/lib/gai_strerror.c, since
it no longer contains translatable strings.
* gnulib/*: Remove gnulib/ hierarchy.
2009-07-08 16:17:51 +02:00
Daniel P. Berrange
89408fd3a0 Refresh GNULIB, also pulling in random_r module 2009-01-20 21:05:33 +00:00
Jim Meyering
55d0a68596 bootstrap: pull in gnulib's ioctl module
* bootstrap: Invoke gnulib-tool with its --no-vc-files
option, since we version-control the files it imports.
This tells it not to mark imported files as cvs-ignored.
(modules): Add ioctl.
* gnulib/lib/ioctl.c: New file.
* gnulib/lib/sys_ioctl.in.h: New file.
* gnulib/tests/sys_ioctl.in.h: Removed.
* gnulib/tests/ioctl.c: Removed.
* gnulib/lib/Makefile.am: Update.
* gnulib/m4/gnulib-cache.m4: Likewise.
* gnulib/m4/gnulib-comp.m4: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* gnulib/lib/.cvsignore: Ignore sys_ioctl.h.
* gnulib/lib/.gitignore: Regenerate.
2009-01-07 17:10:00 +00:00
Jim Meyering
6c996bfc8f update from gnulib; use its time_r module for localtime_r on mingw
* bootstrap (modules): Add time_r.
* gnulib/m4/time_h.m4: New file.
* gnulib/m4/time_r.m4: New file.
* gnulib/lib/time_r.c: New file.
* gnulib/tests/test-time.c: New file.
* gnulib/lib/time.in.h: New file.
* gnulib/lib/Makefile.am: Update.
* gnulib/lib/fseeko.c: Likewise.
* gnulib/lib/lstat.c: Likewise.
* gnulib/lib/netdb.in.h: Likewise.
* gnulib/lib/stdint.in.h: Likewise.
* gnulib/lib/stdlib.in.h: Likewise.
* gnulib/lib/sys_select.in.h: Likewise.
* gnulib/lib/sys_stat.in.h: Likewise.
* gnulib/lib/sys_time.in.h: Likewise.
* gnulib/lib/unistd.in.h: Likewise.
* gnulib/lib/wchar.in.h: Likewise.
* gnulib/m4/codeset.m4: Likewise.
* gnulib/m4/errno_h.m4: Likewise.
* gnulib/m4/extensions.m4: Likewise.
* gnulib/m4/getaddrinfo.m4: Likewise.
* gnulib/m4/gettext.m4: Likewise.
* gnulib/m4/glibc2.m4: Likewise.
* gnulib/m4/glibc21.m4: Likewise.
* gnulib/m4/gnulib-cache.m4: Likewise.
* gnulib/m4/gnulib-comp.m4: Likewise.
* gnulib/m4/iconv.m4: Likewise.
* gnulib/m4/include_next.m4: Likewise.
* gnulib/m4/intdiv0.m4: Likewise.
* gnulib/m4/intlmacosx.m4: Likewise.
* gnulib/m4/intmax.m4: Likewise.
* gnulib/m4/inttypes-pri.m4: Likewise.
* gnulib/m4/inttypes_h.m4: Likewise.
* gnulib/m4/lcmessage.m4: Likewise.
* gnulib/m4/lib-link.m4: Likewise.
* gnulib/m4/lstat.m4: Likewise.
* gnulib/m4/netdb_h.m4: Likewise.
* gnulib/m4/nls.m4: Likewise.
* gnulib/m4/po.m4: Likewise.
* gnulib/m4/printf-posix.m4: Likewise.
* gnulib/m4/printf.m4: Likewise.
* gnulib/m4/progtest.m4: Likewise.
* gnulib/m4/size_max.m4: Likewise.
* gnulib/m4/sockets.m4: Likewise.
* gnulib/m4/stdint.m4: Likewise.
* gnulib/m4/stdint_h.m4: Likewise.
* gnulib/m4/sys_ioctl_h.m4: Likewise.
* gnulib/m4/threadlib.m4: Likewise.
* gnulib/m4/uintmax_t.m4: Likewise.
* gnulib/m4/visibility.m4: Likewise.
* gnulib/m4/wchar.m4: Likewise.
* gnulib/m4/wchar_t.m4: Likewise.
* gnulib/m4/wint_t.m4: Likewise.
* gnulib/m4/xsize.m4: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* gnulib/tests/sockets.h: Likewise.
* gnulib/tests/.cvsignore: Likewise.
* gnulib/tests/.gitignore: Likewise.
* tests/.gitignore: Likewise.
* docs/examples/.gitignore: Likewise.
* gnulib/lib/.cvsignore: Likewise.
* gnulib/lib/.gitignore: Likewise.

remove files associated with obsolete strpbrk module
* gnulib/lib/strpbrk.c: Remove file.
* gnulib/m4/strpbrk.m4: Remove file.
2009-01-06 20:12:50 +00:00
Jim Meyering
75e69df956 updates from gnulib 2008-10-28 17:47:12 +00:00
Jim Meyering
7846f71fb3 add the mkstemp module from gnulib
* bootstrap (modules): Add mkstemp.
The remainder of these changes are the result of running
./bootstrap, adding new files, and committing the result.
* gnulib/lib/gettimeofday.c: New file.
* gnulib/lib/mkstemp.c: New file.
* gnulib/lib/tempname.c: New file.
* gnulib/lib/tempname.h: New file.
* gnulib/m4/gettimeofday.m4: New file.
* gnulib/m4/mkstemp.m4: New file.
* gnulib/m4/tempname.m4: New file.
* gnulib/tests/test-gettimeofday.c: New file.
* gnulib/lib/Makefile.am: Update.
* gnulib/m4/gnulib-cache.m4: Likewise.
* gnulib/m4/gnulib-comp.m4: Likewise.
* gnulib/m4/inet_pton.m4: Likewise.
* gnulib/tests/Makefile.am: Likewise.
2008-08-07 13:02:45 +00:00
Daniel P. Berrange
098ba1a433 Add support for -drive QEMU syntax, and virtio bus / disk type 2008-05-09 16:41:19 +00:00
Jim Meyering
82892f131b Prepare to use gnulib's c-type module.
* bootstrap: Move module list into separate variable w/less syntax.
(modules): Add c-ctype.
Update the following from gnulib:
* build-aux/useless-if-before-free:
* build-aux/vc-list-files:
* gnulib/lib/Makefile.am:
* gnulib/lib/getaddrinfo.h:
* gnulib/m4/gnulib-cache.m4:
* gnulib/m4/gnulib-comp.m4:
* gnulib/m4/inet_ntop.m4:
* gnulib/tests/Makefile.am:
* gnulib/tests/test-getaddrinfo.c:
2008-05-09 13:46:09 +00:00
Jim Meyering
130426c659 update from gnulib
* gnulib/lib/inet_ntop.h: Remove file.
* gnulib/m4/onceonly_2_57.m4: Remove file.
* build-aux/useless-if-before-free: Update.
* build-aux/vc-list-files: Update.
* gnulib/lib/.cvsignore: Update.
* gnulib/lib/Makefile.am: Update.
* gnulib/lib/fseeko.c: Update.
* gnulib/lib/getaddrinfo.c: Update.
* gnulib/lib/getdelim.c: Update.
* gnulib/lib/inet_ntop.c: Update.
* gnulib/lib/inet_ntop.h: Update.
* gnulib/lib/poll.c: Update.
* gnulib/lib/snprintf.c: Update.
* gnulib/lib/stdlib.in.h: Update.
* gnulib/lib/string.in.h: Update.
* gnulib/lib/sys_socket.in.h: Update.
* gnulib/lib/sys_stat.in.h: Update.
* gnulib/lib/vasnprintf.c: Update.
* gnulib/lib/vasprintf.c: Update.
* gnulib/lib/wchar.in.h: Update.
* gnulib/m4/arpa_inet_h.m4: Update.
* gnulib/m4/extensions.m4: Update.
* gnulib/m4/gnulib-common.m4: Update.
* gnulib/m4/gnulib-comp.m4: Update.
* gnulib/m4/include_next.m4: Update.
* gnulib/m4/inet_ntop.m4: Update.
* gnulib/m4/netinet_in_h.m4: Update.
* gnulib/m4/onceonly_2_57.m4: Update.
* gnulib/m4/physmem.m4: Update.
* gnulib/m4/snprintf.m4: Update.
* gnulib/m4/stdint.m4: Update.
* gnulib/m4/stdio_h.m4: Update.
* gnulib/m4/stdlib_h.m4: Update.
* gnulib/m4/string_h.m4: Update.
* gnulib/m4/strndup.m4: Update.
* gnulib/m4/sys_select_h.m4: Update.
* gnulib/m4/sys_socket_h.m4: Update.
* gnulib/m4/sys_stat_h.m4: Update.
* gnulib/m4/vasnprintf.m4: Update.
* gnulib/tests/Makefile.am: Update.
* gnulib/tests/test-fseeko.c: Update.
* gnulib/tests/test-getaddrinfo.c: Update.
* gnulib/tests/test-getdelim.c: Update.
* gnulib/tests/test-getline.c: Update.
* gnulib/tests/test-lseek.c: Update.
* gnulib/tests/test-snprintf.c: Update.
* gnulib/tests/test-sys_stat.c: Update.
* gnulib/tests/test-vasnprintf.c: Update.
* gnulib/tests/test-vasprintf.c: Update.
2008-04-29 19:52:26 +00:00
Jim Meyering
f15efcdf27 Add new testing framework and the first test to use it.
* tests/Makefile.am (test_scripts): Add vcpupin.
(EXTRA_DIST): Add test-lib.sh.
* tests/test-lib.sh: Testing framework, from coreutils.
* tests/vcpupin: New file.
* build-aux/mktempd: New file, from gnulib.
* bootstrap: Add posix-shell and mktempd to the list of imported modules.
* gnulib/m4/posix-shell.m4: New file, from gnulib.
2008-03-24 10:19:36 +00:00
Jim Meyering
32d4aeb162 Update from gnulib. 2008-01-14 14:07:25 +00:00
Jim Meyering
ac6bb7e131 Add gnulib-tool unit tests.
* bootstrap: Re-add --with-tests, now that gnulib-tool
arranges to use separate libraries for lib/ and tests/.
* configure.in (AC_OUTPUT): Add gnulib/tests/Makefile.in.
* Makefile.am (SUBDIRS): Add gnulib/tests.
* gnulib/tests/Makefile.am: New file.
* gnulib/lib/.cvsignore: Sort.
* gnulib/lib/Makefile.am, gnulib/m4/getdelim.m4, gnulib/m4/getline.m4:
* gnulib/m4/gnulib-cache.m4, gnulib/m4/gnulib-comp.m4: Regenerate.
* gnulib/tests/test-alloca-opt.c: New file, from gnulib.
* gnulib/tests/test-arpa_inet.c: Likewise.
* gnulib/tests/test-fseeko.c: Likewise.
* gnulib/tests/test-fseeko.sh: Likewise.
* gnulib/tests/test-getaddrinfo.c: Likewise.
* gnulib/tests/test-getdelim.c: Likewise.
* gnulib/tests/test-getline.c: Likewise.
* gnulib/tests/test-lseek.c: Likewise.
* gnulib/tests/test-lseek.sh: Likewise.
* gnulib/tests/test-netinet_in.c: Likewise.
* gnulib/tests/test-snprintf.c: Likewise.
* gnulib/tests/test-stdbool.c: Likewise.
* gnulib/tests/test-stdint.c: Likewise.
* gnulib/tests/test-stdio.c: Likewise.
* gnulib/tests/test-stdlib.c: Likewise.
* gnulib/tests/test-string.c: Likewise.
* gnulib/tests/test-sys_select.c: Likewise.
* gnulib/tests/test-sys_socket.c: Likewise.
* gnulib/tests/test-sys_stat.c: Likewise.
* gnulib/tests/test-sys_time.c: Likewise.
* gnulib/tests/test-unistd.c: Likewise.
* gnulib/tests/test-vasnprintf.c: Likewise.
* gnulib/tests/test-vasprintf.c: Likewise.
* gnulib/tests/test-wchar.c: Likewise.
* gnulib/tests/dummy.c: Likewise.
* gnulib/tests/intprops.h: Likewise.
* gnulib/tests/verify.h: Likewise.
2007-12-10 18:26:56 +00:00
Richard W.M. Jones
532759a593 Fri Dec 7 14:27:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* bootstrap, Makefile.am, gnulib/*: Import more gnulib
	  modules for use by MinGW Windows port.
2007-12-07 14:32:35 +00:00
Jim Meyering
4c6bef2a6c Add all of the files pulled in by running ./bootstrap.
Adjust .cvsignore files.


Author: Jim Meyering <meyering@redhat.com>
2007-12-05 21:35:32 +00:00