comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Linking Ada code stored in a dylib
Date: Fri, 11 Jan 2008 19:19:16 -0800 (PST)
Date: 2008-01-11T19:19:16-08:00	[thread overview]
Message-ID: <afd86ef6-98cb-4b5f-b346-ec20e57c2f76@j78g2000hsd.googlegroups.com> (raw)

Several months ago, I contributed Ada bindings to the PLplot plotting
library. The PLplot developers quickly incorporated my work into their
project, including making the Ada part into a .dylib. The compiler is
GNAT.

On my end, I eventually noticed that whenever I used the bindings as
(now) downloaded from the PLplot project site, I would get new .o
and .ali files, a re-compilation of the bindings, in the directory
where my main program was. I assumed that it was something that I had
done wrong since I'm not a wizard at compiler and linker switches and
didn't worry much about it since things worked just fine. However,
when I finally bothered to tell the linker to link this .dylib, I
still saw the re-compiled .o and .ali files appearing.

I am now trying to get to the bottom of this. I re-studied the GNAT
User's Guide and its description of the compilation model and various
switches and options. I see that gnatmake checks for (time-stamp)
consistency between sources (at least .ads) and compiled files (.o
and .ali) and recompiles as necessary. The description for the -aL
switch tells how an "Ada library" consisting of a directory
containing .o and .ali files can be specified to bypass recompilation
(but subject to the consistency check), or something like that.

So now I'm inclined to believe that it is a bad or even unworkable
idea to combine compiled object files into a .dylib, and that this
method can't be used with GNAT--GNAT can't see inside the .dylib to
discover when its parts were compiled.

The PLplot developers will adapt to whatever is needed to get the job
done, I'm sure, but I want to be sure that I'm telling them the right
thing. I doubt that there is a compelling reason to use a .dylib as
opposed to a directory of relevant .o and .ali files.

Can GNAT access compiled Ada code that is stored in a .dylib? If so,
what gnatmake options would I use?

Thanks,

Jerry



             reply	other threads:[~2008-01-12  3:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  3:19 Jerry [this message]
2008-01-12 10:56 ` Linking Ada code stored in a dylib Simon Wright
2008-01-12 18:43 ` Jeffrey R. Carter
2008-01-14 21:15 ` Jerry
replies disabled

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