[lttng-dev] [PATCH lttng-tool] Fix: mi: Make sure GIT_VERSION symbol always exist

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Jul 31 17:17:17 EDT 2014


Just to make sure: I guess this patch is not needed
after the changes I did ?

----- Original Message -----
> From: "Jonathan Rajotte Julien" <jonathan.r.julien at gmail.com>
> To: lttng-dev at lists.lttng.org
> Sent: Monday, July 28, 2014 5:54:36 PM
> Subject: [lttng-dev] [PATCH lttng-tool] Fix: mi: Make sure GIT_VERSION	symbol always exist
> 
> The use of GIT_VERSION symbol in mi to express the position in git tree
> force the need to have it defined for each type of build.
> 
> This make sure that a build from source file only (git scm not present) is
> possible.
> 
> Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien at gmail.com>
> ---
>  include/Makefile.am    | 15 ++-------------
>  include/version.h.tmpl |  6 +++++-
>  2 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/include/Makefile.am b/include/Makefile.am
> index d40cb4a..ca515da 100644
> --- a/include/Makefile.am
> +++ b/include/Makefile.am
> @@ -47,19 +47,8 @@ version.h:
>  			## 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 \
> -				if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \
> -					##
> -					## If there is already a GIT_VERSION defined,
> -					## we just replace it by the new version
> -					##
> -					sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION
> \"$${git_version}\"'" "$${version_h}"; \
> -				else \
> -					##
> -					## Else, we add a GIT_VERSION define
> -					## containing our new version.
> -					##
> -					sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION
> \"$${git_version}\"'" "$${version_h}"; \
> -				fi; \
> +				sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION
> \"$${git_version}\"'" "$${version_h}"; \
> +				sed -i "s'^#define GIT_SOURCE.*$$'#define GIT_SOURCE 1'"
> "$${version_h}"; \
>  			fi; \
>  		fi; \
>  	fi)
> diff --git a/include/version.h.tmpl b/include/version.h.tmpl
> index 2cab733..3ef6905 100644
> --- a/include/version.h.tmpl
> +++ b/include/version.h.tmpl
> @@ -20,10 +20,14 @@
>  #ifndef VERSION_H
>  #define VERSION_H
>  
> +
> +#define GIT_SOURCE 0
> +#define GIT_VERSION ""
> +
>  /*
>   * Define the macro containing the FULL version
>   */
> -#ifdef GIT_VERSION
> +#if GIT_SOURCE
>  #define FULL_VERSION "" GIT_VERSION
>  #else /* GIT_VERSION */
>  #define FULL_VERSION "" VERSION
> --
> 2.0.0
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list