[yocto] Add new compiler macro

luciosantinell at libero.it luciosantinell at libero.it
Wed Feb 20 00:42:20 PST 2019


Hi,

i tried to add CFLAGS += "-MMC_WRITE"
(i dont know if -DMMC_WRITE was a typo or not and tryed both) 

i dont get any error but in my recipes the code wrapped in
#ifdef MMC_WRITE
#endif

is not compiled... i even tried to add a sintax error between the ifdef so, if compiler see MMC_WRITE macro, i should get a compiler error but i don't. 

Im still missing something?

code example :

#ifdef MMC_WRITE
        dev_info(host->parent , "retune_now MMC !!! \n\r"); asdasdasd  //asdasdasdasd is a syntax error that should came out

#elif SD_WRITE

Thanks

> 
>     Il 18 febbraio 2019 alle 16.45 Khem Raj <raj.khem at gmail.com> ha scritto:
> 
>     On Mon, Feb 18, 2019 at 7:43 AM <luciosantinell at libero.it> wrote:
>     >
> 
>         > > 
> >         Hi, i wanted to add a compiler macro (NEW_MACRO) in order to compile all the code hidden beetween
> > 
> >         #ifdef NEW_MACRO
> > 
> >         #endif
> >         in all my recipes. I think that the right place to do that is in bitbake.conf file present under poky/meta/conf but when i try to do:
> > 
> >         TARGET_CPPFLAGS += "-MMC_WRITE"
> > 
> >     > 
>     it depends on recipes respecting compiler flags from environment but
>     most of them do.
> 
>     CFLAGS += "-DMMC_WRITE" could do it.
> 
>     >
> 
>         > > 
> >         I get the error :
> >         configure: error: cannot compute suffix of object files: cannot compile
> > 
> >         How can i send the macro to the compiler in the correct way?
> > 
> >         Thanks
> > 
> >         --
> > 
> >         _______________________________________________
> >         yocto mailing list
> >         yocto at yoctoproject.org
> >         https://lists.yoctoproject.org/listinfo/yocto
> > 
> >     > 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190220/07924243/attachment.html>


More information about the yocto mailing list