Print the git version used to build from a distribution tarball The git version is omitted when building from a distribution tarball. This will cause 'lttng version' and 'lttng --version' to print the state of the git tree which produced the tarball. git describe is used to produce the description of the tree's state, along with the "dirty" state (whether or not local changes were present in the tree). Note that the 'git version' will not be printed when the distribution tarball was produced at a release tag (a tag starting with v[0-9]). This patch simplifies the generation of the version.h file by generating a file that is merely included by version.h. It also ensures that version.tmpl is no longer installed on the system by the install target. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: git version build system integration (v2) Fix: - Don't overwrite version.h if the previous content matches. - While we are there, if we notice the previous content matches, print a (cached) message to show that we do not overwrite the content. - Introduce LTTNG_TOOLS_BUILD_GIT_SOURCE automake conditional rather than compile-time define to disable the feature. It ensures we do not invoke "git describe" when configure --disable-git-version has been requested. - Use git describe rather than git describe --long --all. Based on the last tag, and adds the first numbers of git revision. Last tag is useful both to the developer and in a bug report, whereas the branch name returned by --long --all is meaningless in a bug report. - We want to ship version.h.tmpl in the tarball (make dist), not version.h which is generated. Someone could very well do a git init on the extracted tarball and want to have git tracking support. - Fix the git prefix " - " that is incorrectly printed in some situations, e.g. when GIT_SOURCE was active, but we are in a non-git tree (or git is not available). - Fix incorrect handling of out of tree build. Invoke git describe from top_srcdir. Changelog since v1: - Add missing comma for lttng usage output. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Add --disable-git-version to configure By default, GIT_SOURCE variable is defined to 1. The disable option makes the configure to NOT define it. This way, anyone not wanting the git version like for instance packager building from the git repository, it can be used to remove it. Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: remove the default GIT_VERSION This is to allow different version control other than git. Tested-by: Alexandre Montplaisir <alexandre.montplaisir@gmail.com> Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com> Signed-off-by: David Goulet <dgoulet@efficios.com>