Version Info Coded Into ELF Binary
Hello to all,
How to coded version info and other information likes author and company name into the ELF binary ? I prefer the put the version info during build step. Thanks. |
In C, I use a scheme in which a static string is made to contain CVS tags, and which are expanded when the file is committed to the repository:
Code:
static char[] filename_c = "$Id$ $Source$"; I'm lead to believe that the same method is possible with other revision control systems. --- rod. |
Quote:
Below is my code: Code:
void DisplayVersionInfo() Code:
if(argc >= 2) Thanks. |
Please help.
|
Hi -
theNbomr *did* help you! Q: What's wrong with his suggestion, or what don't you understand? PS: If you're unfamiliar with how the CVS keywords "$Id" or "$Source" (among others) might relate to Subversion, this link might help: http://svnbook.red-bean.com/en/1.5/s....keywords.html |
Thanks for that paulsm4. I thought I must have misunderstood the question. Just to expand on my earlier post, I will add some of the details. Regretably, my first example did not use optimal CVS keywords, and do not match the ones I use routinely.
Code:
static char[] filename_c = "\nfilename.c: $Revision$ $Date$\n"; Code:
static char[] filename_c = "\nfilename.c: $Revision: 1.2 $ $Date: 2009/08/20 23:45:03 $\n"; Code:
nm libMyLibrary.so | grep "_c" Hope this clarifies my original post. --- rod. EDIT: You can put a rule in your Makefile to commit all sources to CVS (or whatever versioning tool you use), thus satisfying your build-time requirement. |
All times are GMT -5. The time now is 04:14 AM. |