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!v15g2000yqn.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 10:29:42 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 94.108.210.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1236104982 20522 127.0.0.1 (3 Mar 2009 18:29:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 3 Mar 2009 18:29:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000yqn.googlegroups.com; posting-host=94.108.210.8; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020407 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4874 Date: 2009-03-03T10:29:42-08:00 List-Id: Ludovic Brenta wrote on comp.lang.ada: > Markus Schoepflin wrote on comp.lang.ada: > > > Using gcc 4.3.3, I'm trying to create a static library that contains bo= th > > object files created from Ada and C. > > > The gpr file to create the library (only using the Ada parts) looks lik= e 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 u= se > > the gnat project file to create the static library including those obje= ct > > 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". I just checked and, on Debian, the package gnat-4.3 provides /usr/bin/ gprmake :) Enjoy! -- Ludovic Brenta.