This is the mail archive of the ecos-discuss@sources.redhat.com 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: additional compiler options in cdl script


On Wed, 2003-08-13 at 08:33, mohanlal jangir wrote:
> I have some questions with following sample cdl script
> 
> cdl_package CYGPKG_MY_PKG {
>      compile a.c  b.c  c.c
> 
>      cdl_component  CYGPKG_MY_PKG_OPTIONS {
>             cdl_option  CYGPKG_MY_PKG_CFLAGS_ADD {
>                   default_value { "-D_KERNEL "}
>              }
>      }
> 
>      cdl_component CYGPKG_MY_PKG_MODULE {
>            active_if     CYGPKG_MY_PKG
>            compile  x.c  y.c  z.c
>      }
> }
> 
> I am adding new package MY_PKG to eCos. MY_PKG_MODULE is an optional part of
> this package, which is compiled only if user selects MY_PKG_MODULE. I want
> files a.c, b.c and c.c to compile with compiler flag -D_KERNEL, if
> MY_PKG_MODULE is not selected. But I want file a.c, b.c and c.c to compile
> with compiler flags -D_KERNEL and -DMODULE_FLAG both, if user selects
> MY_PKG_MODULE. I did try to put a CYGPKG_MY_PKG_MODULE_OPTIONS (like
> CYGPKG_MY_PKG_OPTIONS) inside CYGPKG_MY_PKG_MODULE block and I was able to
> see flags in configtool also but these flags are not used while compiling.
> Can somebody explain, how to enable additional compiler options, if
> MY_PKG_MODULE is selected.
> 

All you need is to add the appropriate define when
"CYGPKG_MY_PKG_MODULE" is selected.
 
>      cdl_component CYGPKG_MY_PKG_MODULE {
>            active_if     CYGPKG_MY_PKG
>            define MODULE_FLAG
>            compile x.c y.c z.c
>      }
> }

Be sure that your source files include <pkgconf/XYZ.h>, where XYZ is the
name of your CDL package.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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


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