Under the influence of libxml2 and considering that actual "patch"
information in fact, if significant, ends up encoded in QB_VER_REST,
shift away from convention codified, e.g., by semver.org (not adored
by libqb, anyway) and rename designated PATCH component of the version
to MICRO accordingly.
Note that at this point, after a release without any header-based
versioning present and just a few commits after it was tentatively
introduced, it's a painless change. Once this PATCH nomenclature
is leaked into a full release, there's no way to get rid of it
reasonably...
Recent "v1.0" discovered this discrepancy propagated all around
and also this is not very compatible with the logic of commit 26d3911.
Treat missing "patch" component of the version as an implicit zero
to make such oddity go away.
Adjust spec file generation accordingly.
Mainly as a light-weight alternative to full-blown autoconf/pkg-config
machineries, whereby one can:
* workaround functionality not present in libqb up to 1.0 (inclusive)
- note that this versioning schema is being introduced *after*
1.0.0 release so one cannot tell that version from any older,
but will be able to safely identify any later one (1.0.1+)
and act accordingly
- example:
#if !defined(QB_VER_MAJOR) || ((QB_VER_MAJOR == 1) && (QB_VER_MINOR < 1))
#warning "Feature X not supported"
int do_foo(int arg) { };
#else
int
do_foo(int arg)
{
/* use feature X of libqb */
}
#endif
* make its program report libqb API version it was built with by
emitting QB_VER_STR symbolic string (see tests/print_ver.c for example)
Also added is a print_ver test program to:
* emit how original unparsed version is parsed to particular components
defined in qbconfig.h (QB_VER_{MAJOR,MINOR,PATCH} symbolic integer
constants and QB_VER_REST symbolic string) when being compiled
* emit mentioned QB_VER_STR symbolic string joining the components
back to a single string, plus the components themselves
Resolves: https://github.com/ClusterLabs/libqb/issues/186
* configure.ac: Define QB_GNU.
Add a check for a working clock_getres for the CLOCK_MONOTONIC
option defining HAVE_CLOCK_GETRES_MONOTONIC.
* lib/log_thread.c: Replace second argument of
qb_log_thread_priority_set(): logt_sched_param.sched_priority by 0
when not supported by the OS.
* lib/util.c: Use the CLOCK_REALTIME option in clock_getres() if
HAVE_CLOCK_GETRES_MONOTONIC os not defined.
Previously, "make" in the top-level dir resulted in:
> doxygen man.dox
> warning: Tag `XML_SCHEMA' at line 1787 of file `man.dox' has become
> obsolete.
> To avoid this warning please remove this line from your
> configuration file or upgrade it using "doxygen -u"
> warning: Tag `XML_DTD' at line 1793 of file `man.dox' has become
> obsolete.
Reference doxygen version: doxygen-1.8.10-6.fc22.x86_64.
This is to serve as a reference full-blown versions only to be
subsequently compacted...
Although this is not as rigorously correct as the previous arrangement
(introduced with 80834ea), i.e., from the perspective of
$(abs_top_builddir)/tests/Makefile (generated from from
$(top_srcdir)/tests/Makefile.am), for which $(top_builddir)
is literally "..":
- qbconfig.h is generated from $(top_srcdir)/include/qb/qbconfig.h.in
into $(top_builddir)/include/qb directory, and consumed from here
- rest of these header files are consumed directly from
$(top_srcdir)/include/qb directory
this new simplified variant:
- avoids code duplication (DRY)
- works thanks to VPATH in $(abs_top_builddir)/tests/Makefile
pointing to $(top_srcdir)/tests, which means that unsatisfied
dependencies on "$(top_builddir)/include/qb/%.h" (resolved to
"../include/qb/%.h") will be subsequently sought as
"$(top_srcdir)/tests/../include/qb/%.h", which has the same effect
as previous explicit "$(top_srcdir)/include/qb/%.h" specification
(note that such automatic VPATH provision is supported by automake
"since beginning" so no backward incompatibility is expected)
This is to prevent issues like the one being fixed with ebcff54
(https://github.com/ClusterLabs/libqb/pull/197).
Also, plain "make" invocation is dropped as it is an integral part
of "make rpm" (%build phase in libqb.spec).