From: ltest AT rte9-sun_5 DOT 5 DOT 1 (news_check.py) Newsgroups: gnu.gcc.help,comp.os.msdos.djgpp Subject: Re: Specs file format Date: Wed, 10 Sep 1997 14:07:15 GMT Organization: AT&T WorldNet Load Test Lines: 66 Message-ID: <5v69r8$885@lztnsc06.att.com> NNTP-Posting-Host: 192.168.60.249 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article Ivo Janssen wrote: > On Mon, 1 Sep 1997, Robert Hoehne wrote: > > > Now I looked also in gcc.c and found, that you can overwrite in On Mon, 1 Sep 1997, Robert Hoehne wrote: > Now I looked also in gcc.c and found, that you can overwrite in > the specs file, any builtin "default compiler spec" by adding > some lines to the specs file. For instance: > > .c: ..... > > Will execute what ever stands for the ..... > But please do not ask me now what the exact syntax is > (probably the same like in gcc.c but the best would be > to look in gcc.c and try to understand how 'read_specs()' > work. First of all, it seems that you don't need to include the whole specs-file as dumped by gcc -dumpspecs. Only additional info has to be specified. So I did: ------ .c: @my_compiler @my_compiler: ------ Notice that you need to have exactly 1 blank line. Any other number will result in a fatal error. Hmmmm. So now, when I do "gcc foo.c -o foo", it processes the . One thing left: In the built in specs (gcc.c: static struct compiler default_compilers[]), an identifier (here: @my_compiler) can have several specs. (struct compiler { char* suffix; char *spec[4]; } ). But read_specs can only read 1 spec from file and store it in compiler.spec[0]. The default spec for ".c" files (@c) has spec[0], which does the cpp-stage, and spec[1], which does the cc1 and as stage. In main(), it seems that these two specs are just catted in one new char*, named p. Then main() does do_spec (p). So I just put them after eachother in the specs-file, thus putting both spec[0] (cpp) and spec[1] (cc1/as) in one new spec[0]. And: everything WORKS!!!!! So the bottom-line in my struggle is: - No need to include all other specs, only new specs need to be in the file. - Watch your newlines. Exactly 1 blank line between rules. - You can cat specs, which internally are in seperate char*'s, into one. - There definitily needs to be some documentation in the "Using and Porting GCC" info file!!!!!!! And it needs to be a lot clearer then the comments in "gcc.c". GNU people: do something! Greetings, a very happy Ivo! --------------------+--------------------------------+-+ +---+ | IVO JANSSEN | ivo AT ricardis DOT tudelft DOT nl | | | | | Ricardishof 1/428 | janssen AT cardit DOT et DOT tudelft DOT nl | | |-+ | | 2614 JE Delft | http://www.et.tudelft.nl/~ivo/ | +->-| (|) | the Netherlands | Dept of Electrical Engineering | |-+ | | +31-15-2855973 | Delft University of Technology | | | +-------------------+--------------------------------+ --- ---