[Mesa-dev] [Bug 52064] build fails with "git_sha1.h.tmp": permission denied

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jul 18 03:14:04 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=52064

--- Comment #2 from Brian Paterni <bpaterni at gmail.com> 2012-07-18 03:14:04 PDT ---
I've managed to come up with a solution to this on my own. I'm no automake
expert and it's a bit of a hack IMO, but it works for me. Let me know what you
think.

[PATCH] automake: build git_sha1.h without BUILT_SOURCES

BUILT_SOURCES are applied to 'all', 'check', and 'install' targets. So
when make install is run as root, git_sha1.h.tmp is generated again as
root for some reason(?) which causes the next build to fail with
'Permission denied' error.
---
 src/mesa/Makefile.am |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 2b023d7..e459ac0 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -35,7 +35,7 @@ main/git_sha1.h.tmp:
         fi \
     fi

-main/git_sha1.h: main/git_sha1.h.tmp
+main/git_sha1.h: Makefile main/git_sha1.h.tmp
     @echo "updating main/git_sha1.h"
     @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \
         mv main/git_sha1.h.tmp main/git_sha1.h ;\
@@ -47,7 +47,6 @@ GLAPI = $(TOP)/src/mapi/glapi/gen
 include $(GLAPI)/glapi_gen.mk

 BUILT_SOURCES = \
-    main/git_sha1.h \
     main/api_exec_es1_dispatch.h \
     main/api_exec_es1_remap_helper.h \
     main/api_exec_es2_dispatch.h \
@@ -59,7 +58,7 @@ BUILT_SOURCES = \
     program/lex.yy.c
 CLEANFILES = \
     $(BUILT_SOURCES) \
-    git_sha1.h.tmp
+    main/git_sha1.h.tmp

 main/api_exec_es1_dispatch.h: $(GLAPI)/gl_and_es_API.xml
$(glapi_gen_dispatch_deps)
     $(call glapi_gen_dispatch,$<,es1)
@@ -115,11 +114,18 @@ if HAVE_SPARC_ASM
 MESA_ASM_FILES_FOR_ARCH += $(SPARC_FILES)
 endif

+nodist_libmesa_la_SOURCES = \
+    main/git_sha1.h
+noinst_libmesa_la_SOURCES = \
+    main/git_sha1.h
+
 libmesa_la_SOURCES = \
     $(MESA_FILES) \
     $(MESA_CXX_FILES) \
         $(MESA_ASM_FILES_FOR_ARCH)

+$(SRCDIR)/main/version.c: main/git_sha1.h
+
 libmesa_la_LIBADD = $(top_builddir)/src/glsl/libglsl.la
 libmesa_la_LDFLAGS =

-- 
1.7.10.4

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list