HP3000-L Archives

September 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Duane Percox <[log in to unmask]>
Reply To:
Duane Percox <[log in to unmask]>
Date:
Sat, 22 Sep 2001 11:01:25 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Lars writes:

[snip..]
> While on the subject of $VERSION compiler directives... When using
> the GNU gcc compiler, you won't have that luxury. However, you can
> use a related trick by placing static string declarations into the
> source code that use a character sequence like "$Id: blah blah $".
>
> The resulting strings end up inside the object code and can then be
> viewed with the /bin/ident utility that comes with the Posix Shell.
> I used this approach with the Samba 2.0.10/iX programs, for example.

We still do this (since $version was a recent feature in cobol and
we have been working on this box since 1979.

Here is our working storage layout:

01  VERSION-DISPLAY.
    03  PROG-NAME                    PIC X(8) VALUE "PAY002".
    03  FILLER                       PIC X(2) VALUE SPACES.
    03  PROG-VERSION                 PIC X(7) VALUE "H.00.05".
    03  FILLER                       PIC X(10) VALUE
        " compiled ".
    03  PROG-COMPILED                PIC X(15) VALUE "99/99/99".


First thing in our code is to move the compile time register
information to 'PROG-COMPILED' (we display this info when
program runs for version verification).

This causes the compiler to store a compile date/time string
in the OBJ module that is generated. We have a utility program
called 'GETVER' which can read an nmobj/prog/nmprg file and find
this version area and also the compiler generated date/time string.

By doing careful analysis of output from the compiler for various
programs we have figured out how to find the compile date/time string.
It is slightly different for cobol-74 vs 85 and our utility can find
both. Its an interesting excercise trying to find the date/time info.
Just think of closing your eyes and groping around with your hands
outstretched...

Duane Percox

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2