Author Topic: Buildlevel info  (Read 503 times)

John Poltorak

  • Sr. Member
  • ****
  • Thank You
  • -Given: 20
  • -Receive: 1
  • Posts: 335
    • View Profile
Buildlevel info
« on: August 07, 2017, 10:45:53 pm »
How do you get buildlevel info into a file when compiling?



Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 98
  • Posts: 1168
    • View Profile
Re: Buildlevel info
« Reply #1 on: August 08, 2017, 01:01:23 am »
Simplest is in the description field of a def file. Here's the commit for cups, http://trac.netlabs.org/ports/changeset/2212.
Bitwise has slowly been automating this.

Andreas Schnellbacher

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 16
  • Posts: 236
    • View Profile
Re: Buildlevel info
« Reply #2 on: August 08, 2017, 08:15:23 am »

Lars

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 25
  • Posts: 171
    • View Profile
Re: Buildlevel info
« Reply #3 on: August 08, 2017, 09:55:16 am »
In very seldom cases, it is impossible to add bldlevel information to the DEF file (I tried to add bldlevel information to a PSD in this way which would lead to a hang when the PSD would load on system start).
The workaround in this case is to use the "comment" switch that most compilers have and that allows you to add an arbitrary Version/vendor string to an object file (and some compilers, as in my case, support a #pragma to support this so that you can embed the vendor/Version info directly into one source file).
Obviously you would use this feature only on compilation of one dedicated source file.

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 160
    • View Profile
Re: Buildlevel info
« Reply #4 on: August 08, 2017, 10:34:12 pm »
With the help of a rexx script of course! ;)

Run it and answer the questions.
It write a buildlevel.rc and version.h for you with info you can use.
Provide a file name (existing version.h) and it try to read and use it.

Add the rexx script to your OpenWatcom Pre Compilation options to write a new file at build.
Add buildlevel.rc to the project in OpenWatcom so it can create the .res-file and automatically add the buildlevel info to the executable or dll.

Buildinfo should be added to ALL dll's and executables so one can determine the version info in a consistent way and not only by application and/or version specific commands/calls.
//Jan-Erik Lärka
« Last Edit: August 08, 2017, 11:21:51 pm by Jan-Erik Lärka »

John Poltorak

  • Sr. Member
  • ****
  • Thank You
  • -Given: 20
  • -Receive: 1
  • Posts: 335
    • View Profile
Re: Buildlevel info
« Reply #5 on: August 10, 2017, 03:18:15 pm »
I still don't understand what I need to do to get BLDLEVEL info into an exe...

Suppose I have a  my.def which contains:
Quote
Signature:   @#IBM:9.23#@  IBM OS/2 Kernel
Vendor:      IBM
Revision:    9.23
Description: IBM OS/2 Kernel

What do I need in a Makefile to add this info the exe?  Presumably gcc can add it.

Andreas Kohl

  • Full Member
  • ***
  • Thank You
  • -Given: 4
  • -Receive: 6
  • Posts: 160
    • View Profile
    • warpserver.de
Re: Buildlevel info
« Reply #6 on: August 10, 2017, 03:44:33 pm »
I still don't understand what I need to do to get BLDLEVEL info into an exe...

Suppose I have a  my.def which contains:
Quote
Signature:   @#IBM:9.23#@  IBM OS/2 Kernel
Vendor:      IBM
Revision:    9.23
Description: IBM OS/2 Kernel

What do I need in a Makefile to add this info the exe?  Presumably gcc can add it.

That's not a valid module definition. I don't know which version of gcc or linker you're using. The example in figure 2.3.b from http://www.edm2.com/index.php/Adding_BLDLEVEL_information_to_executables should fit to several tool chains. For more information on using LINK386 you can read the Tools Reference.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 98
  • Posts: 1168
    • View Profile
Re: Buildlevel info
« Reply #7 on: August 10, 2017, 05:05:07 pm »
@John, you just add the def file to the linker ($LD) line, same with a rc file after you create it from a res file.
As Andreas says, that is not a def file. The toolkits tools.inf documents def files under the LINK386 section.