summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2008-10-21 17:19:03 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2008-10-21 17:19:03 +0000
commit11be2332a141ee7ddde1054dfa5555bbd299dae1 (patch)
tree1edea9cb7e9c39388afa85e539277c40d5614e4f /SConstruct
parent6405e51c856c9094507b7da20511b907bc41f9f7 (diff)
Backported automatic svn revision handling from 3.0
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3991 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct20
1 files changed, 13 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 7bf8d61aff..6e8b16e41e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -262,16 +262,16 @@ def create_stored_revision (target = None, source = None, env = None):
if os.path.exists('.svn'):
rev = fetch_svn_revision ('.');
try:
- text = "#ifndef __ardour_svn_revision_h__\n"
- text += "#define __ardour_svn_revision_h__\n"
- text += "static const char* ardour_svn_revision = \"" + rev + "\";\n";
- text += "#endif\n"
- print '============> writing svn revision info to svn_revision.h\n'
- o = file ('svn_revision.h', 'w')
+ text = "#include <ardour/svn_revision.h>\n"
+ text += "namespace ARDOUR {\n";
+ text += "extern const char* svn_revision = \"" + rev + "\";\n";
+ text += "}\n";
+ print '============> writing svn revision info to libs/ardour/svn_revision.cc\n'
+ o = file ('libs/ardour/svn_revision.cc', 'w')
o.write (text)
o.close ()
except IOError:
- print "Could not open svn_revision.h for writing\n"
+ print "Could not open libs/ardour/svn_revision.cc for writing\n"
sys.exit (-1)
else:
print "You cannot use \"scons revision\" on without using a checked out"
@@ -1373,6 +1373,12 @@ env.AddPreAction (env['DISTTREE'], Action ('rm -rf ' + str (File (env['DISTTREE'
env.AddPostAction (srcdist, Action ('rm -rf ' + str (File (env['DISTTREE']))))
#
+# Update revision info before going into subdirs
+#
+
+create_stored_revision()
+
+#
# the subdirs
#