This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: $Revision$ in version string?


Hi,

Uros Bizjak wrote:
> Is there a way to add automatically updated SVN revision number to gcc
> version string? Something similar to $Revision$ in RCS?

Well, the problem with $Revision$ is that it only refects the revision
of that single file.

> I think it would be quite informative if during development phase[...]
> gcc --version
> gcc (GCC) 4.3.0 20070621 (experimental) Revision XXXXX

I would like this as well. Maybe something along the following would work:

STRING=""
if [ -d "$CONFIGURE/.svn" -a -n "`svn 2>&1`" ]; then
   REV="`svn info "$CONFIGURE"|grep Revi|awk '{print $2}'`"
   BRANCH=`svn info "$CONFIGURE"|grep URL|sed -e 's#.*/##'`
   STRING=" Revision $REV ($BRANCH)"
end if

Where $CONFIGURE is the directory where "./configure" is. The Revision
should be determined when running make.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]