From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26856 invoked by alias); 30 Jul 2009 11:02:42 -0000 Received: (qmail 26422 invoked by uid 22791); 30 Jul 2009 11:02:41 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f228.google.com (HELO mail-bw0-f228.google.com) (209.85.218.228) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jul 2009 11:02:34 +0000 Received: by bwz28 with SMTP id 28so586382bwz.30 for ; Thu, 30 Jul 2009 04:02:32 -0700 (PDT) Received: by 10.204.59.145 with SMTP id l17mr850626bkh.28.1248951752003; Thu, 30 Jul 2009 04:02:32 -0700 (PDT) Received: from smtp.gmail.com ([86.57.137.251]) by mx.google.com with ESMTPS id z15sm5409708fkz.34.2009.07.30.04.02.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Jul 2009 04:02:31 -0700 (PDT) Date: Thu, 30 Jul 2009 11:02:00 -0000 From: Sergei Gavrikov To: David Fernandez Cc: ecos-discuss@ecos.sourceware.org, Simon Kallweit Message-ID: <20090730110312.GA11789@sg-ubuntu.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS]How to run testprograms for lwip X-SW-Source: 2009-07/txt/msg00270.txt.bz2 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 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 #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