From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be1dcb512cfd9c2b,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!j78g2000hsd.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Linking Ada code stored in a dylib Date: Fri, 11 Jan 2008 19:19:16 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 75.171.118.172 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1200107956 10681 127.0.0.1 (12 Jan 2008 03:19:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Jan 2008 03:19:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j78g2000hsd.googlegroups.com; posting-host=75.171.118.172; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12.2 (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19336 Date: 2008-01-11T19:19:16-08:00 List-Id: 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