comp.lang.ada
 help / color / mirror / Atom feed
From: "Gordon Brunton" <gkbrunton@home.com>
Subject: Elaboration of Ada object archive.  Possible/Alternatives?
Date: 2000/11/18
Date: 2000-11-18T00:00:00+00:00	[thread overview]
Message-ID: <ozER5.653999$8u4.9941815@news1.rdc1.bc.home.com> (raw)

Having been fruitless in my search for a solution to my problem I am hoping
someone on this newsgroup can assist.  I am convinced there has to be
someone who has encountered this problem before.

Background:
I'm currently involved in the implementation of a large scale Air Traffic
Control System written primarily written using Ada 83.  The development
environment is Rational Apex on a Solaris platform.  The
integration/delivery platform is HP/UX.

Problem:
There are several components for the current system we intend to reuse from
another system in the product line (These components are written in Ada as
is the rest of the system).  The requirement is that the source code for
these reused components is a non deliverable item.  The source code for the
rest of the system is deliverable however and there is a requirement for the
customer to be able to maintain the system after delivery and thus they need
to be able to compile/link against the components we have not delivered the
source code for.

My intention was to provide an API subsystem housing the components for
which no source code is delivered.  The API subsystem would contain an API
interface and an object archive of the code we are not delivering.

As way of an example, I have an API that looks like (the API is deliverable
code):

foo_api.1.ada:
package foo_api is

  procedure Do_Something;

end foo_api;

foo_api.2.ada:
package body foo_api is

  procedure Do_Something;
  pragma Import (Convention => Ada, Entity => Do_Something);

end foo_api;

Then I have the implementation that looks like (the implementation is the
non deliverable code that will be complied into an object archive):

foo_implementation.1.ada
package foo_implementation is

  procedure Do_Something;
  pragma Export (Convention => Ada, Entity => Do_Something);

end;

foo_implementation.2.ada
package body foo_implementation is

  procedure Do_Something is
  begin
   -- The work is performed here.
  end;

end foo_implementation;

Note that the example above is given only as way of an example.  The actual
API has many interfaces and the implementation is composed of many packages
most of which require some elaboration.

This all works to the extent that I am able to compile all the code and
produce an object archive of the implementation (non deliverable code) with
which to resolve the symbols at link stage.  However, as nothing in the main
program (that calls the API interfaces) includes any of the implementation
directly in it's closure a program error is resultant on execution.

The problem is, is there anything I can do to force the code in the archive
library to be elaborated without doing an explicit pragma elaborate (which
would require me to 'with' the implementation and thereby defeat the whole
purpose of the exercise).

I have encountered the 'pragma Export_Elaboration_Procedure' but can't find
any real examples of its usage (or if it would indeed be able to assist in
my problem).  If anyone has experience using this and feels it may be of use
then please let me know.

I would be grateful if anyone could assist me in providing a resolution to
this problem (or suggest an alternative approach that still meets my needs).
Note that it is preferable not to alter the non deliverable component code.

Thanks in advance.

Gordon Brunton
Senior Software Engineer
Ratheon Systems
(gordon_brunton@raytheon.com)






             reply	other threads:[~2000-11-18  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-18  0:00 Gordon Brunton [this message]
2000-11-19  0:00 ` Elaboration of Ada object archive. Possible/Alternatives? Jeff Creem
2000-11-21  0:00   ` Tom Hargraves
2000-11-19  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox