summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
456b8d4)
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>
+AC_ARG_ENABLE([git-version],
+ [AC_HELP_STRING([--disable-git-version],
+ [Do not use the git version for the build])],
+ [disable_git_version=yes], [disable_git_version=no]
+)
+if test "x${disable_git_version:-no}" = xno; then
+ AC_DEFINE_UNQUOTED([GIT_SOURCE], 1, [Disable git version.])
+fi
+
# For Python
# SWIG version needed or newer:
swig_version=2.0.0
# For Python
# SWIG version needed or newer:
swig_version=2.0.0
## as the one currently in the file (if there is one), as we
## don't want to update the file if it is already up to date
##
## as the one currently in the file (if there is one), as we
## don't want to update the file if it is already up to date
##
- if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \
- sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \
+ if [ $$(grep -cE "^#define GIT_VERSION_SED \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \
+ sed -i "s'^#define GIT_VERSION_SED.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \
#ifndef VERSION_H
#define VERSION_H
#ifndef VERSION_H
#define VERSION_H
+#ifdef GIT_SOURCE
+#define GIT_VERSION_PREFIX " - "
+#define GIT_VERSION_SED ""
+#else
+#define GIT_VERSION_PREFIX ""
if (lttng_opt_mi) {
ret = print_mi();
} else {
if (lttng_opt_mi) {
ret = print_mi();
} else {
- MSG("lttng version " VERSION " - " VERSION_NAME " - " GIT_VERSION);
+ MSG("lttng version " VERSION " - " VERSION_NAME GIT_VERSION_PREFIX GIT_VERSION);
MSG("\n" VERSION_DESCRIPTION "\n");
MSG("Web site: http://lttng.org");
MSG("\n%s", lttng_license);
MSG("\n" VERSION_DESCRIPTION "\n");
MSG("Web site: http://lttng.org");
MSG("\n%s", lttng_license);