binary versioning

Dear Members,

Do you know any information about versioning a binary file. That means test.out 1.0.0, 1.0.1, 1.1.0, and so on. Can I manually edit version number (both major and minor) and revision number myself (how?) or any utility to set version number (which one?).

Best Regards,
Francesco

You could put the version information in a header file and use it when you build your app. This information can be used in the following manner eg. ./myapp --version would print out this version info.

You may also want to check man pages of 'ident' as well.

Also, I dont think there are any utilities (atleast I am not aware) which does the versioning for you. Each app and so the component/product owner has their own way of versioning.

It is traditional to put version numbers of shared libraries where the major number refers the interface to the library, the complete version refering to the implementation.

If you look in /usr/lib on an ELF system you will typically see

libNAME.so.major.minor

with a link from

libNAME.so.major to libNAME.so.major.minor

and another link

libNAME.so to libNAME.so.major

This library will have the SONAME attribute set to libNAME.so.major so when an application links against it, it will refer to the correct interface, not the exact implementation.

This allows the implementation to be updated and maintained as long as the interface does not change.

Some other binary systems have equivalents to ELF's SONAME, such as Darwin's 'install_name'.

The SONAME attribute is set at link time.