]
)
+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
## 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}"; \
fi; \
fi; \
fi)
#ifndef VERSION_H
#define VERSION_H
+#ifdef GIT_SOURCE
+#define GIT_VERSION_PREFIX " - "
+#define GIT_VERSION_SED ""
+#else
+#define GIT_VERSION_PREFIX ""
#define GIT_VERSION ""
+#endif
#endif /* VERSION_H */
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);