[openib-general] Re: [RFC] OpenSM: include svn version in build string

Michael S. Tsirkin mst at mellanox.co.il
Tue Nov 22 08:00:47 PST 2005


Quoting r. Hal Rosenstock <halr at voltaire.com>:
> Subject: [RFC] OpenSM: include svn version in build string
> 
> Hi,
> 
> It has been requested (several times now :-) that the svn version be
> included in the OpenSM build string version info (as 1.1.0 isn't nearly
> descriptive enough). This needs to work both in and out of the OpenIB
> svn tree as builds will occur both ways.
> 
> So one way to accomplish this which has additional overhead on each
> checkin is to maintain something like an osm_svnversion file at the osm
> level of the tree and display that in opensm/main.c when OpenSM starts
> up.
> 
> Another way would be to modify include/opensm/osm_base.h OSM_VERSION
> with this info. Again. manual.
> 
> Anyone see how to get away from the manual overhead of this ?
> 
> Anyone have other ideas on how to solve this ? (Are there other examples
> of this out there ?)
> 
> Thanks.
> 
> -- Hal

You also want a url in there to make subversion revision a unique identifier.

For in-tree build, you can have Makefile generate a header from
.svn/entries

something like

version.h: .svn/entries
	grep -e revision= -e url= $^ | head 2> $@

in the makefile should be sufficient.

For an out of tree build, you just stick something into version.h.
after you do svn export.

Its also important to have a default version identifier by
keeping a backup version.h under include directory, have that
picked up after the local version if that doesnt exist.

-- 
MST



More information about the general mailing list