This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to modify CFLAGS within an ECM file?


On 2007-09-11, Mike Arthur <arth2219@gmail.com> wrote:
> Is there a way to adjust CFLAGS within an ECM file?  I want to be able
> to adjust the optimization levels of configurations, without changing
> the rest of the CFLAGS when using ecosconfig.  I don't want to have to
> hand edit the .ecc file.
>
> This is an example of what I want to do:
> $ ecosconfig new pc_rltk8139
> $ ecosconfig import file_that_modifies_optimization_to_O0.ecm
> $ ecosconfig tree
> $ make
>
> Now the 'pc_rltk8139' target would be built with -O0 optimization. I
> don't know what the contents of "file_that_modifies_optimization.ecm"
> would be.
>
> Any suggestions?

The only way I've figured out is to use sed to modify the
ecos.ecc file just before the doing the "tree" command.  I
always use a shellscript to create a new tree.  Here's a sample
where I modify the CFLAGS value:

----------------------------------------------------------------------
#!/bin/bash

[ecosconfig new/add/remove stuff here]

# need to add -G0 option to compiler flags to fix the linker error:
#    Unable to reach __RedBoot_IDLE_TAB_END__ (at 0x08013428) from the global pointer (at 0x0801b$
# hopefully, someday Altera will fix this bug...
sed 's/# user_value "-g -O3/user_value "-g -G0 -O3/g' <ecos.ecc >ecos.ecc.new
mv ecos.ecc ecos.ecc.orig
mv ecos.ecc.new ecos.ecc

ecosconfig tree

[more sed commands to fix problems in Makefile and .ldi files]

----------------------------------------------------------------------


-- 
Grant Edwards                   grante             Yow! Yes, but will I
                                  at               see the EASTER BUNNY in
                               visi.com            skintight leather at an
                                                   IRON MAIDEN concert?


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]