intel-gpu-tools: fix version.h creation in android
PATCH v2 1/1 intel-gpu-tools: fix version.h creation in android
From: Tim Gore <[email protected]>
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.
--- lib/Android.mk | 3 ++- lib/Makefile.am | 3 +++ lib/Makefile.sources | 20 +++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-)
lib/Android.mk +2 -1
@@ -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 += \
lib/Makefile.am +3 -0
@@ -1,3 +1,6 @@ +IGT_LIB_PATH := . +GPU_TOOLS_PATH := .. + include Makefile.sources noinst_LTLIBRARIES = libintel_tools.la
lib/Makefile.sources +11 -9
@@ -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
Signature · 1 line
1.9.2
Quoted 44 lines · On 24 July 2014 17:38, <[email protected]> wrote:
From: Tim Gore <[email protected]>
commit
743dc7997aa9f5210055896940d87c88983dcda6breaks the build under Android becauseversion.his not created. This happens because the android make executes from theANDROID_BUILD_TOPdirectory 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 <[email protected]>--- lib/Android.mk | 3 ++- lib/Makefile.am | 3 +++ lib/Makefile.sources | 20 +++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-)lib/Android.mk +2
-1@@ -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 += \lib/Makefile.am +0
-0
lib/Makefile.am line 3
Quoted 3 lines
lib/Makefile.am +3
-0@@ -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)/libGPU_TOOLS_PATH := $(top_srcdir)
Quoted 34 lines
lib/Makefile.am +0
-0include Makefile.sources noinst_LTLIBRARIES = libintel_tools.lalib/Makefile.sources +6
-8@@ -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 ;\
lib/Makefile.sources version.h.tmp: · line 74
Quoted 10 lines
lib/Makefile.sources +5
-1+ +$(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).
Quoted 3 lines
--
1.9.2
Quoted 53 lines · Thomas Wood
Quoted 44 lines · On 24 July 2014 17:38, <[email protected]> wrote:
From: Tim Gore <[email protected]>
commit
743dc7997aa9f5210055896940d87c88983dcda6breaks the build under Android becauseversion.his not created. This happens because the android make executes from theANDROID_BUILD_TOPdirectory 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 <[email protected]>--- lib/Android.mk | 3 ++- lib/Makefile.am | 3 +++ lib/Makefile.sources | 20 +++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-)lib/Android.mk +2
-1@@ -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 += \lib/Makefile.am +0
-0lib/Makefile.am line 3
Quoted 3 lines
lib/Makefile.am +3
-0@@ -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:
Quoted 1 line
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.
Quoted 54 lines
GPU_TOOLS_PATH:= $(top_srcdir)Quoted 34 lines
lib/Makefile.am +0
-0include Makefile.sources noinst_LTLIBRARIES = libintel_tools.lalib/Makefile.sources +6
-8@@ -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 ;\lib/Makefile.sources version.h.tmp: · line 74
Quoted 10 lines
lib/Makefile.sources +5
-1+ +$(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.hThis now needs to match the rule above (i.e. $(IGT_LIB_PATH)/version.h).
Quoted 3 lines
--
1.9.2