Displaying the version numbers of the source used in an exec


I’m trying to find the way to know version numbers of the source used to genarate an executable in QNX6. We’ve been lately uploading our code to a CVS server so this would be a great deal for us.

We are doing this right now with our QNX4 projects using RCS IDENT and CVS keywords. Basically, we declare a variable containing the information we want to read afterwards:
[static char rcsid[]="$Id$"] [CVS replaces $Id$ with the info]
And then, we get to know revision numbers using the IDENT utility.

But, in QNX6 ther is no RCS or IDENT (correct me if I am wrong). Does anybody know the way to do the same we are doing in QNX4??

I’ve been trying some alternatives but none of them has worked:

  • I’ve tried de #ident directive which the preprocessor ignores.
  • I’ve tried the “use -s” but I am always getting “No info available in …” So, clearly I am putting the information in the wrong place.

BTW, I’m using IDE 3.0 under QNX Momentics 6.3.0 SP2

You can use something like strings | grep ID

Or you can get the info from the cvs update command and stuff the output in the executable using usemsg -I… Then to access the data you via use -i

May I suggest you look at using svn instead of cvs. Much more powerful and flexible. One main advantage is that a single version number identy the whole source tree, so no need to keep track of the version number for each file. I stuff that number using usemsg, which means that with a simple number in 5 years from now I can rebuild the executable.

OK, strings it’s ok for *.c and *.h. But I’ve realised that I cannot use the same method for other files like *.wgtd.
So, then the “usemsg -i” way is the best for me. But I have some questions:

The usemsg manual says that I can also use the option -f to load all the id=value pairs stored in a file. Has anybody tested that? It isn’t working for me.

Also, the manual for USE says that “use -s” should “display the version numbers of the source used in the executable”. Does anybody know where deoes “use -s” look for them?

About SVN, we aren’t using it because of the server box and because we also have clients running QNX4.

QNX4 has a svn client.