]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix vgversion.h generation for builddir != srcdir.
authorMark Wielaard <mark@klomp.org>
Wed, 17 May 2017 20:38:18 +0000 (20:38 +0000)
committerMark Wielaard <mark@klomp.org>
Wed, 17 May 2017 20:38:18 +0000 (20:38 +0000)
Make sure to include the builddir include directory to find the
generated vgversion.h. Make include/vgversion.h a .PHONY target
so it always gets regenerated even if the file is already there.
Make sure to run svnversion in the srcdir.

Patch by Matthias Schwarzott <zzam@gentoo.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16397

Makefile.all.am
Makefile.am
auxprogs/make_or_upd_vgversion_h

index b6d004796feaca3a10174945d0572e4941e51e63..1859a510fdbf2f529f9303ee99b2a969910b32cb 100644 (file)
@@ -150,6 +150,7 @@ endif
 AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/include \
+       -I$(top_builddir)/include \
        -I$(top_srcdir)/VEX/pub \
        -I$(top_builddir)/VEX/pub \
        -DVGA_@VGCONF_ARCH_PRI@=1 \
@@ -160,6 +161,7 @@ if VGCONF_HAVE_PLATFORM_SEC
 AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/include \
+       -I$(top_builddir)/include \
        -I$(top_srcdir)/VEX/pub \
        -I$(top_builddir)/VEX/pub \
        -DVGA_@VGCONF_ARCH_SEC@=1 \
index 2cc9d55a52803c616efdcb333ab98fcd1d84e4ec..ea87cc1870b667a4ff75add5e1beb3ac49b43f3a 100644 (file)
@@ -62,7 +62,7 @@ vglib_DATA = default.supp
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = valgrind.pc
 
-BUILT_SOURCES  = default.supp vgversion.h valgrind.pc
+BUILT_SOURCES  = default.supp include/vgversion.h valgrind.pc
 CLEANFILES     = default.supp
 
 default.supp: $(DEFAULT_SUPP_FILES)
@@ -116,13 +116,13 @@ EXTRA_DIST = \
        valgrind.spec \
        autogen.sh
 
-dist-hook: vgversion.h
+dist-hook: include/vgversion.h
        cp -p include/vgversion.h $(distdir)/include/vgversion.h
 
 dist_noinst_SCRIPTS = \
        vg-in-place
 
-all-local: default.supp vgversion.h
+all-local: default.supp include/vgversion.h
        mkdir -p $(inplacedir)
        rm -f $(inplacedir)/default.supp
        ln -s ../default.supp $(inplacedir)
@@ -134,5 +134,8 @@ clean-local:
 pkginclude_HEADERS = config.h
 
 # vgversion.h defines accurate versions to report with -v --version
-vgversion.h:
-       $(top_srcdir)/auxprogs/make_or_upd_vgversion_h
+include/vgversion.h:
+       $(top_srcdir)/auxprogs/make_or_upd_vgversion_h $(top_srcdir)
+
+.PHONY: include/vgversion.h
+
index 2059f0e21736182e34111580cfce7d4659a226b4..6bfe6799dd04244e011cd6720777fa63ddff3114 100755 (executable)
@@ -14,20 +14,22 @@ extract_svn_version()
     fi    
 }
 
+srcdir=${1:-.}
+
 cat > include/vgversion.h.tmp <<EOF
 /* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
    This file defines VGSVN and VEXSVN, used to report SVN revision
    when using command line options:  -v --version 
 */
-#define VGSVN "$(extract_svn_version .)"
-#define VEXSVN "$(extract_svn_version VEX)"
+#define VGSVN "$(extract_svn_version $srcdir/.)"
+#define VEXSVN "$(extract_svn_version $srcdir/VEX)"
 EOF
 
 if [ -f include/vgversion.h ]
 then
     # There is already a vgversion.h.
     # Update it only if we found a different and real svn version
-    if grep unknown include/vgversion.h.tmp ||
+    if grep -q unknown include/vgversion.h.tmp ||
        cmp -s include/vgversion.h include/vgversion.h.tmp
     then
         rm include/vgversion.h.tmp