public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Sergei Gavrikov <sergei.gavrikov@gmail.com>
To: David Fernandez <david.fernandez.work@googlemail.com>
Cc: ecos-discuss@ecos.sourceware.org,
		Simon Kallweit <simon.kallweit@intefo.ch>
Subject: Re: [ECOS]How to run testprograms for lwip
Date: Thu, 30 Jul 2009 11:02:00 -0000	[thread overview]
Message-ID: <20090730110312.GA11789@sg-ubuntu.local> (raw)
In-Reply-To: <ea104e1b0907300210of7ab77at6ac11777000dd8da@mail.gmail.com>

On Thu, Jul 30, 2009 at 10:10:53AM +0100, David Fernandez wrote:
> May be I'm wrong, but I think that the macro CYG_FUN_LWIP_IP_FORWARD
> is not only defined, but defined as 1 if the option is enabled. May be
> that what you want is to use the macro directly instead of the
> preprocessor operator applied to it.

As fae as I remember, that depends on CDL flavor type. The value can be
either not defined at all, or it can be defined as 

#define CYG_FOO 1

or it can be defined as

#define CYG_FOO 1
#define CYG_FOO_1

> That is simpler than defining another macro, and if the option is
> disabled, the macro would be defined, but its value would be 0.

Sure. But goal is do not tweak the ported sources, so there are the same
odd wrappers.

> You might want to check it this way though, in case the lwip is
> included, but those CDL options are not active for some reason...
> which may be impossible, but here you are.
> 
> #ifndef CYG_FUN_LWIP_IP_FORWARD
> #define IP_FORWARD 0
> #else
> #define IP_FORWARD CYG_FUN_LWIP_IP_FORWARD
> #endif

It's resonable. And I would prefer yet another way (CDL way):

cdl_package CYGPKG_BAR {
    ...
    cdl_option CYGOPT_HAVE_FOO {
        display         "Foo feature"
        flavor          bool
        default_value   1
        # Original bar sources want it:
        define          HAVE_FOO
        description     "
            Enable this option to use foo feature."
    }
    ...
}

Then in <pkgconf/bar.h>

will apear or won't

#define CYGOPT_HAVE_FOO 1
#define HAVE_FOO 1

In our case we would include at the end of lwipopts.h an inclusion

#ifdef __ECOS__
# include <pkgconf/net_lwip.h>
#endif

and it will be contain, e.g.

#define CYGFUN_IP_FORWARD 1
#define IP_FORWARD 1

or nothing. Etc.

May be I wrong too. So, it seems for me it's a time to re-read CDL guide
:-)

Sergei

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

  reply	other threads:[~2009-07-30 11:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  9:11 David Fernandez
2009-07-30 11:02 ` Sergei Gavrikov [this message]
2009-07-30 11:11   ` Simon Kallweit
  -- strict thread matches above, loose matches on Subject: below --
2009-07-23  9:50 Robert Brusa
2009-07-23 10:02 ` Simon Kallweit
2009-07-23 12:19   ` Robert Brusa
2009-07-23 12:25     ` Simon Kallweit
2009-07-24 15:51       ` Robert Brusa
2009-07-29 12:25       ` Sergei Gavrikov
2009-07-29 12:32         ` Simon Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090730110312.GA11789@sg-ubuntu.local \
    --to=sergei.gavrikov@gmail.com \
    --cc=david.fernandez.work@googlemail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=simon.kallweit@intefo.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).