public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2] intel-gpu-tools: fix version.h creation in android
@ 2014-07-24 16:38 tim.gore
  2014-07-25 11:33 ` Thomas Wood
  0 siblings, 1 reply; 3+ messages in thread
From: tim.gore @ 2014-07-24 16:38 UTC (permalink / raw)
  To: intel-gfx; +Cc: thomas.wood

From: Tim Gore <tim.gore@intel.com>

commit 743dc7997aa9f5210055896940d87c88983dcda6
breaks the build under Android because version.h
is not created. This happens because the android
make executes from the ANDROID_BUILD_TOP directory
rather than from the directory containing the source
files, so we need to differentiate between Android
and linux builds. This is V2 of this patch based on
Thomas Wood's suggestion.

Signed-off-by: Tim Gore <tim.gore@intel.com>
---
 lib/Android.mk       |  3 ++-
 lib/Makefile.am      |  3 +++
 lib/Makefile.sources | 20 +++++++++++---------
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/lib/Android.mk b/lib/Android.mk
index 6f444a0..5739c80 100644
--- a/lib/Android.mk
+++ b/lib/Android.mk
@@ -1,6 +1,7 @@
 LOCAL_PATH := $(call my-dir)
 
 GPU_TOOLS_PATH := $(LOCAL_PATH)/..
+IGT_LIB_PATH := $(LOCAL_PATH)
 
 # FIXME: autogenerate this info #
 $(GPU_TOOLS_PATH)/config.h:
@@ -13,7 +14,7 @@ include $(LOCAL_PATH)/Makefile.sources
 include $(CLEAR_VARS)
 
 LOCAL_GENERATED_SOURCES :=       \
-	$(GPU_TOOLS_PATH)/lib/version.h  \
+	$(IGT_LIB_PATH)/version.h  \
 	$(GPU_TOOLS_PATH)/config.h
 
 LOCAL_C_INCLUDES +=              \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 4d4efe4..9f6a021 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,3 +1,6 @@
+IGT_LIB_PATH := .
+GPU_TOOLS_PATH := ..
+
 include Makefile.sources
 
 noinst_LTLIBRARIES = libintel_tools.la
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 2d971c5..96786e0 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -48,12 +48,14 @@ libintel_tools_la_SOURCES = 	\
 	$(NULL)
 
 .PHONY: version.h.tmp
-version.h.tmp:
+
+$(IGT_LIB_PATH)/version.h.tmp:
 	@touch $@
-	@if test -d $(top_srcdir)/.git; then \
-		if which git > /dev/null 2>&1; then git log -n 1 --oneline | \
+	@if test -d $(GPU_TOOLS_PATH)/.git; then \
+		if which git > /dev/null 2>&1; then cd $(@D); \
+			git log -n 1 --oneline | \
 			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
-			>> $@ ; \
+			>> $(@F) ; \
 		else \
 			echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
 		fi \
@@ -61,12 +63,12 @@ version.h.tmp:
 		echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
 	fi
 
-version.h: version.h.tmp
-	@if ! cmp -s version.h.tmp version.h; then \
-		echo "updating version.h"; \
-		mv version.h.tmp version.h ;\
+
+$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
+	@if ! cmp -s $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h; then \
+		mv $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h ; \
 	else \
-		rm version.h.tmp ;\
+		rm $(IGT_LIB_PATH)/version.h.tmp ; \
 	fi
 
 BUILT_SOURCES = version.h
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] intel-gpu-tools: fix version.h creation in android
  2014-07-24 16:38 [PATCH v2] intel-gpu-tools: fix version.h creation in android tim.gore
@ 2014-07-25 11:33 ` Thomas Wood
  2014-07-25 13:47   ` Thomas Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Wood @ 2014-07-25 11:33 UTC (permalink / raw)
  To: Tim Gore; +Cc: Intel Graphics Development

On 24 July 2014 17:38,  <tim.gore@intel.com> wrote:
> From: Tim Gore <tim.gore@intel.com>
>
> commit 743dc7997aa9f5210055896940d87c88983dcda6
> breaks the build under Android because version.h
> is not created. This happens because the android
> make executes from the ANDROID_BUILD_TOP directory
> rather than from the directory containing the source
> files, so we need to differentiate between Android
> and linux builds. This is V2 of this patch based on
> Thomas Wood's suggestion.
>
> Signed-off-by: Tim Gore <tim.gore@intel.com>
> ---
>  lib/Android.mk       |  3 ++-
>  lib/Makefile.am      |  3 +++
>  lib/Makefile.sources | 20 +++++++++++---------
>  3 files changed, 16 insertions(+), 10 deletions(-)
>
> diff --git a/lib/Android.mk b/lib/Android.mk
> index 6f444a0..5739c80 100644
> --- a/lib/Android.mk
> +++ b/lib/Android.mk
> @@ -1,6 +1,7 @@
>  LOCAL_PATH := $(call my-dir)
>
>  GPU_TOOLS_PATH := $(LOCAL_PATH)/..
> +IGT_LIB_PATH := $(LOCAL_PATH)
>
>  # FIXME: autogenerate this info #
>  $(GPU_TOOLS_PATH)/config.h:
> @@ -13,7 +14,7 @@ include $(LOCAL_PATH)/Makefile.sources
>  include $(CLEAR_VARS)
>
>  LOCAL_GENERATED_SOURCES :=       \
> -       $(GPU_TOOLS_PATH)/lib/version.h  \
> +       $(IGT_LIB_PATH)/version.h  \
>         $(GPU_TOOLS_PATH)/config.h
>
>  LOCAL_C_INCLUDES +=              \
> diff --git a/lib/Makefile.am b/lib/Makefile.am
> index 4d4efe4..9f6a021 100644
> --- a/lib/Makefile.am
> +++ b/lib/Makefile.am
> @@ -1,3 +1,6 @@
> +IGT_LIB_PATH := .
> +GPU_TOOLS_PATH := ..
> +

Automake supports out-of-tree builds and this is tested during
distcheck, so relative paths don't work. The above two lines need to
be:

IGT_LIB_PATH := $(top_builddir)/lib
GPU_TOOLS_PATH := $(top_srcdir)



>  include Makefile.sources
>
>  noinst_LTLIBRARIES = libintel_tools.la
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 2d971c5..96786e0 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -48,12 +48,14 @@ libintel_tools_la_SOURCES =         \
>         $(NULL)
>
>  .PHONY: version.h.tmp
> -version.h.tmp:
> +
> +$(IGT_LIB_PATH)/version.h.tmp:
>         @touch $@
> -       @if test -d $(top_srcdir)/.git; then \
> -               if which git > /dev/null 2>&1; then git log -n 1 --oneline | \
> +       @if test -d $(GPU_TOOLS_PATH)/.git; then \
> +               if which git > /dev/null 2>&1; then cd $(@D); \
> +                       git log -n 1 --oneline | \
>                         sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
> -                       >> $@ ; \
> +                       >> $(@F) ; \
>                 else \
>                         echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
>                 fi \
> @@ -61,12 +63,12 @@ version.h.tmp:
>                 echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
>         fi
>
> -version.h: version.h.tmp
> -       @if ! cmp -s version.h.tmp version.h; then \
> -               echo "updating version.h"; \
> -               mv version.h.tmp version.h ;\
> +
> +$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
> +       @if ! cmp -s $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h; then \
> +               mv $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h ; \
>         else \
> -               rm version.h.tmp ;\
> +               rm $(IGT_LIB_PATH)/version.h.tmp ; \
>         fi
>
>  BUILT_SOURCES = version.h

This now needs to match the rule above (i.e. $(IGT_LIB_PATH)/version.h).

> --
> 1.9.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] intel-gpu-tools: fix version.h creation in android
  2014-07-25 11:33 ` Thomas Wood
@ 2014-07-25 13:47   ` Thomas Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Wood @ 2014-07-25 13:47 UTC (permalink / raw)
  To: Tim Gore; +Cc: Intel Graphics Development

On 25 July 2014 12:33, Thomas Wood <thomas.wood@intel.com> wrote:
> On 24 July 2014 17:38,  <tim.gore@intel.com> wrote:
>> From: Tim Gore <tim.gore@intel.com>
>>
>> commit 743dc7997aa9f5210055896940d87c88983dcda6
>> breaks the build under Android because version.h
>> is not created. This happens because the android
>> make executes from the ANDROID_BUILD_TOP directory
>> rather than from the directory containing the source
>> files, so we need to differentiate between Android
>> and linux builds. This is V2 of this patch based on
>> Thomas Wood's suggestion.
>>
>> Signed-off-by: Tim Gore <tim.gore@intel.com>
>> ---
>>  lib/Android.mk       |  3 ++-
>>  lib/Makefile.am      |  3 +++
>>  lib/Makefile.sources | 20 +++++++++++---------
>>  3 files changed, 16 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/Android.mk b/lib/Android.mk
>> index 6f444a0..5739c80 100644
>> --- a/lib/Android.mk
>> +++ b/lib/Android.mk
>> @@ -1,6 +1,7 @@
>>  LOCAL_PATH := $(call my-dir)
>>
>>  GPU_TOOLS_PATH := $(LOCAL_PATH)/..
>> +IGT_LIB_PATH := $(LOCAL_PATH)
>>
>>  # FIXME: autogenerate this info #
>>  $(GPU_TOOLS_PATH)/config.h:
>> @@ -13,7 +14,7 @@ include $(LOCAL_PATH)/Makefile.sources
>>  include $(CLEAR_VARS)
>>
>>  LOCAL_GENERATED_SOURCES :=       \
>> -       $(GPU_TOOLS_PATH)/lib/version.h  \
>> +       $(IGT_LIB_PATH)/version.h  \
>>         $(GPU_TOOLS_PATH)/config.h
>>
>>  LOCAL_C_INCLUDES +=              \
>> diff --git a/lib/Makefile.am b/lib/Makefile.am
>> index 4d4efe4..9f6a021 100644
>> --- a/lib/Makefile.am
>> +++ b/lib/Makefile.am
>> @@ -1,3 +1,6 @@
>> +IGT_LIB_PATH := .
>> +GPU_TOOLS_PATH := ..
>> +
>
> Automake supports out-of-tree builds and this is tested during
> distcheck, so relative paths don't work. The above two lines need to
> be:
>
> IGT_LIB_PATH := $(top_builddir)/lib

This can also just be $(builddir). I've pushed the patch with these
changes and also pushed another small distcheck fix for version.h used
from quick_dump.


> GPU_TOOLS_PATH := $(top_srcdir)
>
>
>
>>  include Makefile.sources
>>
>>  noinst_LTLIBRARIES = libintel_tools.la
>> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
>> index 2d971c5..96786e0 100644
>> --- a/lib/Makefile.sources
>> +++ b/lib/Makefile.sources
>> @@ -48,12 +48,14 @@ libintel_tools_la_SOURCES =         \
>>         $(NULL)
>>
>>  .PHONY: version.h.tmp
>> -version.h.tmp:
>> +
>> +$(IGT_LIB_PATH)/version.h.tmp:
>>         @touch $@
>> -       @if test -d $(top_srcdir)/.git; then \
>> -               if which git > /dev/null 2>&1; then git log -n 1 --oneline | \
>> +       @if test -d $(GPU_TOOLS_PATH)/.git; then \
>> +               if which git > /dev/null 2>&1; then cd $(@D); \
>> +                       git log -n 1 --oneline | \
>>                         sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
>> -                       >> $@ ; \
>> +                       >> $(@F) ; \
>>                 else \
>>                         echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
>>                 fi \
>> @@ -61,12 +63,12 @@ version.h.tmp:
>>                 echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
>>         fi
>>
>> -version.h: version.h.tmp
>> -       @if ! cmp -s version.h.tmp version.h; then \
>> -               echo "updating version.h"; \
>> -               mv version.h.tmp version.h ;\
>> +
>> +$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
>> +       @if ! cmp -s $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h; then \
>> +               mv $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h ; \
>>         else \
>> -               rm version.h.tmp ;\
>> +               rm $(IGT_LIB_PATH)/version.h.tmp ; \
>>         fi
>>
>>  BUILT_SOURCES = version.h
>
> This now needs to match the rule above (i.e. $(IGT_LIB_PATH)/version.h).
>
>> --
>> 1.9.2
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-25 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 16:38 [PATCH v2] intel-gpu-tools: fix version.h creation in android tim.gore
2014-07-25 11:33 ` Thomas Wood
2014-07-25 13:47   ` Thomas Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox