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,fe1dc0666af8f6a6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z1g2000yqn.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Creating mixed language static libraries with gpr files? Date: Tue, 3 Mar 2009 04:07:12 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1236082032 10790 127.0.0.1 (3 Mar 2009 12:07:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 3 Mar 2009 12:07:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z1g2000yqn.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4860 Date: 2009-03-03T04:07:12-08:00 List-Id: Markus Schoepflin wrote on comp.lang.ada: > Using gcc 4.3.3, I'm trying to create a static library that contains both > object files created from Ada and C. > > The gpr file to create the library (only using the Ada parts) looks like = this: > > ---%<--- > project foo is > > =A0 =A0for source_dirs use ("src"); > =A0 =A0for object_dir use "obj"; > > =A0 =A0for library_name use "foo"; > =A0 =A0for library_dir use "./lib"; > =A0 =A0for library_kind use "static"; > > end foo; > --->%--- > > Now I have a few object files built from C sources. Is it possibly to use > the gnat project file to create the static library including those object > files? Off the top of my head, this requires that you use gprmake instead of gnatmake. gprmake is part of GPS; if you have GPS on your system, then maybe you have gprmake too. If you don't have it, you can still use a Makefile to complement your project file. You can easily add an object file to an existing static library with "ar rt libLIBRARY.a object_file_produced_from_c.o". -- Ludovic Brenta.