You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Justin Verity <jt...@gmail.com> on 2007/02/27 15:15:41 UTC

Burning svn revision into binaries

I am trying to put the SVN revision # in my binaries

In my Makefile I do this:

SVNDEF := -D'SVN_REV="$(shell svnversion -n .)"'
CFLAGS = @CFLAGS@ -pipe $(SVNDEF)

And in my user code I do this:

cout << "SVN Revision is " << SVN_REV << endl;

But the output I get is:

"SVN Revision is exported"

Can anyone help?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Burning svn revision into binaries

Posted by Phillip Susi <ps...@cfl.rr.com>.
Justin Verity wrote:
> I am trying to put the SVN revision # in my binaries
> 
> In my Makefile I do this:
> 
> SVNDEF := -D'SVN_REV="$(shell svnversion -n .)"'
> CFLAGS = @CFLAGS@ -pipe $(SVNDEF)
> 
> And in my user code I do this:
> 
> cout << "SVN Revision is " << SVN_REV << endl;
> 
> But the output I get is:
> 
> "SVN Revision is exported"
> 
> Can anyone help?


I think you put your backticks in the wrong place, causing the shell to 
see "SVN_REV=####" which results in it setting that variable and 
printing "exported".  Try:

SVNDEF := -DSVN_REV='svnversion -n .'

Or it might have been:

SVNDEF := -DSVN_REV=$(shell svnversion -n .)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Burning svn revision into binaries

Posted by Vineet Kumar <vi...@doorstop.net>.
* Justin Verity (jtverity@gmail.com) [070227 12:52]:
> I am trying to put the SVN revision # in my binaries
> 
> In my Makefile I do this:
> 
> SVNDEF := -D'SVN_REV="$(shell svnversion -n .)"'
> CFLAGS = @CFLAGS@ -pipe $(SVNDEF)
> 
> And in my user code I do this:
> 
> cout << "SVN Revision is " << SVN_REV << endl;
> 
> But the output I get is:
> 
> "SVN Revision is exported"

svnversion gives "exported" if it's run from a non-working-copy
directory.  Are you sure you are running it from a working-copy
directory?  Or does your build process use svn export instead of svn
checkout to fetch the source?  Does "svnversion ." give you a rev number
when you run it manually?  

Vineet

-- 
http://www.doorstop.net/
-- 
"Computer Science is no more about computers
than astronomy is about telescopes."  -- E.W. Dijkstra