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: a07f3367d7,d561cda996d4dac4 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!c3g2000yqd.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Adding a compiler to GPS or a GPR project Date: Wed, 30 Dec 2009 09:46:52 -0800 (PST) Organization: http://groups.google.com Message-ID: <233e1eb3-5aed-4ef1-a805-e1ee741e6175@c3g2000yqd.googlegroups.com> References: <1l5v84b72sizk$.j72gn8d711oq$.dlg@40tude.net> NNTP-Posting-Host: 77.198.58.40 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1262195212 21060 127.0.0.1 (30 Dec 2009 17:46:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 30 Dec 2009 17:46:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c3g2000yqd.googlegroups.com; posting-host=77.198.58.40; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8559 Date: 2009-12-30T09:46:52-08:00 List-Id: On 30 d=E9c, 15:31, "Dmitry A. Kazakov" wrote: > What about: > > http://www.adacore.com/wp-content/files/auto_update/gprbuild-docs/htm... > > which defines the compiler for the given language. (The compilation comma= nd > line is determined by a combination of various project setting, obviously= .) > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de This is a nice link, worth to read. I've tried to do with this. I've noticed two rather stange things : + The suffix provided in the language definition (the xml file) does not seems to be reused by the GPR builder. + The substition given in the latter doc (%f, %u, and so on) does not seems to work at all. Note: things must be done with manual edition of the *.gpr file, as some properties are not accessible with GUI project manager (notably the Driver attribute). Tips: the =93 tool =94 is launched with the object directory as the current working directory. This must be properly handled if the file to compile use relative paths to link to various stuff. For people who wants to know more, here is how I could set up the GPR project so that is automatically (re)compiles any Windows resource files included in the project. First of all, the language definition for the RC language, which must be a valid XML moved to one of the GPS plug-ins directory : Windows Resources .rc // /* */ " True True True Then, the line added in the Compiler nested package of the GPR project file : for Driver ("windows resources") use "windres.bat"; (assuming Windows). This must be manually edited, as the GUI project manager does not provide access to this. The other option, can be edited from GPS. Open the project properties sheet and select the tab named =93 Naming convention =94 and set the implementation suffix of Windows Resource to .rc. Alternatively, you may manually edit the GPR file, to add this line in a Naming nested package : package Naming is for Implementation_Suffix ("windows resources") use ".rc"; end Naming; The last step, is the windres.bat which is as follow : @echo off rem Compiles a Windows resource file (*.rc). It do so running windres from rem the directory where the resource file belong, just for windres to be rem able to resolve relative path the resource file may contains. rem The object file is produced in this same directory. Later, the object rem file is moved to the object directory, which is the one from where rem gnatmake will invok this batch. rem rem This batch script is to be invoked with the file name to compile as rem its first and unique argument. rem rem The argument is retrieved in %1 rem rem %1 is the full file name rem %~n1 is the base file name rem %~dp1 is the parent directory name of the file rem pushd goes to and remember of the actual directory rem popd comes back to the actual directory pushd %~dp1 windres.exe -i %1 -o %~n1.o popd if exist %~n1.o del %~n1.o if exist %~dp1\%~n1.o move %~dp1\%~n1.o . These tips may be reused for any other similar needs.