|
From: <sv...@va...> - 2017-05-17 20:38:25
|
Author: mjw
Date: Wed May 17 21:38:18 2017
New Revision: 16397
Log:
Fix vgversion.h generation for builddir != srcdir.
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 <zz...@ge...>
Modified:
trunk/Makefile.all.am
trunk/Makefile.am
trunk/auxprogs/make_or_upd_vgversion_h
Modified: trunk/Makefile.all.am
==============================================================================
--- trunk/Makefile.all.am (original)
+++ trunk/Makefile.all.am Wed May 17 21:38:18 2017
@@ -150,6 +150,7 @@
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 @@
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 \
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Wed May 17 21:38:18 2017
@@ -62,7 +62,7 @@
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 @@
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 @@
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
+
Modified: trunk/auxprogs/make_or_upd_vgversion_h
==============================================================================
--- trunk/auxprogs/make_or_upd_vgversion_h (original)
+++ trunk/auxprogs/make_or_upd_vgversion_h Wed May 17 21:38:18 2017
@@ -14,20 +14,22 @@
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
|