[ECOS] Re: How to tell if a file is being compiled as part o f eCos?

Jay Foster jay@systech.com
Fri Aug 1 16:40:00 GMT 2008


Yes, I saw that too, but that sys/param.h file is only included if you are
using the BSD TCP/IP network stack (package), which I didn't know if you
were (or would always be) with your application.

Jay
-----Original Message-----
From: Grant Edwards [mailto:grante@visi.com]
Sent: Friday, August 01, 2008 9:33 AM
To: ecos-discuss@sources.redhat.com
Subject: [ECOS] Re: How to tell if a file is being compiled as part of
eCos?


On 2008-08-01, Sergei Gavrikov <sergei.gavrikov@gmail.com> wrote:
> On Thu, Jul 31, 2008 at 04:19:26PM +0000, Grant Edwards wrote:
>> On 2008-07-31, Jay Foster <jay@systech.com> wrote:
>> 
>> > I've seen many eCos packages use "__ECOS" (or sometimes
>> > "__ECOS__") for this purpose.  __ECOS is usually defined by
>> > the associated package CDL file in a ...CFLAGS_ADD option.
>> 
>> I guess that's what I'll do.  I thought maybe eCos provided
>> something in the default CFLAGS so that it didn't have to be
>> done at the package level.
>
> The place exists where CFLAGS definition starts, there is CFLAGS :=
> $(subst -finit-priority,,$(CFLAGS)) in packages/pkgconf/rules.mak. So,
> it seems for me that build the same as the below can be used as well
>
> ecosconfig new <target>
> ecosconfig tree
> make CFLAGS=-D__ECOS__
>
> But, it seems, you are right, it is better to fix main definitions in
> the rules.mak.

I just found out that <sys/param.h> does define __ECOS.  So
rather than adding a -D__ECOS to the CFLAGS, I'm including
<sys/param.h> in my source file.  It also seems to include a
bunch of extraneous stuff that's in different include files on
other systems, but once __ECOS is defined I can deal with the
other differences.

-- 
Grant Edwards                   grante             Yow! There's enough money
                                  at               here to buy 5000 cans of
                               visi.com            Noodle-Roni!


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

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



More information about the Ecos-discuss mailing list