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,4cabfb8e49247533 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Multiple shared libraries with a single spec References: <1131107328.981560.222350@g43g2000cwa.googlegroups.com> <1131119582.929654.323550@f14g2000cwb.googlegroups.com> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:RajvvVh8Or45BiukFzSUaUT2fSs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 05 Nov 2005 05:41:23 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1131187296 66.159.65.1 (Sat, 05 Nov 2005 05:41:36 EST) NNTP-Posting-Date: Sat, 05 Nov 2005 05:41:36 EST Xref: g2news1.google.com comp.lang.ada:6232 Date: 2005-11-05T05:41:23-05:00 List-Id: "Lucretia" writes: > Stephen Leake wrote: > >> > I have just created a test program which creates 2 shared libs (in >> > separate directories with separate makefiles) and then created adalib >> > and adainclude directories in which the lib, ali and ads files were >> > linked to. I then built the test app which linked to the files in >> > adalib and adainclude. I could then use a symlink to change the library >> > used. This works, but I'm not too sure if it's the correct way to do >> > this. >> >> It's one valid way, and has the advantage of being compiler >> independent. But it isn't operating system independent; you can't do >> this on Windows. > > This isn't compiler independent as the library generated won't be able > to be used from another Ada compiler, i.e. the name mangling may not be > the same. What I meant was 'using file system symbolic links' is compiler independent. My option of using GNAT project files is not compiler independent. Hmm. Maybe I misread what you wrote, and you didn't mean 'file system symbolic links'. > But you should be able to do this on Windows, Windows does not support file system symbolic links. >> > Has anyone else done this sort of thing with GNAT? >> >> I use GNAT project files for this; one project file per target. The >> Source_Dirs value specifies what Ada bodies to use, by specifying the >> directory search path. All objects are placed in one build directory; >> one build directory per target. > > Hmmm, haven't used project files yet. They are very nice. For example, they make it easy to specify compiler options on a per-file basis (which I use to work around compiler bugs :). > I ask about this, because I'm generating 2 libs, each have slightly > different ALI's and I was wondering whether this way would cause > problems in the future? Of course it can cause problems. But using per-target build directories, and using project files, can solve those problems. -- -- Stephe