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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ca5e4a3e79e64cb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Including C source in GNAT project for building library Date: Thu, 24 Jan 2008 08:33:32 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1201163612 8382 62.49.19.209 (24 Jan 2008 08:33:32 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 24 Jan 2008 08:33:32 +0000 (UTC) Cancel-Lock: sha1:KWGNP4CcAgiXue78vAz8G50SmoA= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) Xref: g2news1.google.com comp.lang.ada:19576 Date: 2008-01-24T08:33:32+00:00 List-Id: Per Sandberg writes: > The project file looks ok to me but gnatmake only accepts Ada so you > need to use gprmake to use other languages. Got it, thanks. The next problem (may only be a Darwin thing) is that I was trying to construct a static standalone library. It looks as though a client gnatmake may manage to work out the required elaboration but may not compute the library dependencies right: eg, if the main program doesn't use tasking and neither do the used parts of the library, things appear to work; but if the used parts of the library use tasking, the binder leaves out libgnarl (I only have .a, didn't build .dynlib). I'm not even sure that elaboration is OK, because when I added -largs -lgnarl it linked but I got a segv at runtime. Workround: don't try to build a standalone static library! (ie, leave out the Library_Interface attribute). This does mean copying the source files to an include directory (can be the same as the object directory). Good to see the -p switch for {gnat,gpr}make (create required output directories if needed).