[ECOS] CDL and makefile output

Bart Veer bartv@ecoscentric.com
Thu Nov 13 01:06:00 GMT 2008

>>>>> "Jesper" == Jesper Skov <jskov@zoftcorp.dk> writes:

    Jesper> I am looking for a way to replace the below in hal.cdl:
    Jesper>     make -priority 250 {
    Jesper>         <PREFIX>/lib/extras.o: <PREFIX>/lib/libextras.a
    Jesper>         $(CC) $(CFLAGS) -nostdlib -Wl,-r -Wl,--whole-archive -o $@ $<
    Jesper>     }

    Jesper> with something along the lines of:

    Jesper> --- hal.cdl	(revision 25)
    Jesper> +++ hal.cdl	(working copy)
    Jesper> @@ -71,10 +71,21 @@

    Jesper>      make -priority 250 {
    Jesper>          <PREFIX>/lib/extras.o: <PREFIX>/lib/libextras.a
    Jesper> -        $(CC) $(CFLAGS) -nostdlib -Wl,-r -Wl,--whole-archive -o $@ $<
    Jesper> +        $(CC) $(CFLAGS) $(EXTRAS_LDFLAGS) -o $@ $<
    Jesper>      }

    Jesper> +        cdl_option CYGBLD_GLOBAL_EXTRAS_LDFLAGS {
    Jesper> +            display "Extras.o linker flags"
    Jesper> +            flavor  data
    Jesper> +	      parent  CYGBLD_GLOBAL_OPTIONS
    Jesper> +            no_define
    Jesper> +            default_value { "-nostdlib -Wl,-r -Wl,--whole-archive" }
    Jesper> +            description   "
    Jesper> +                This option controls the extras.o linker flags. Individual
    Jesper> +                packages may define options which override these global flags."
    Jesper> +        }

    Jesper> So I can modify the EXTRAS_LDFLAGS in a platform HAL.

    Jesper> Unfortunately, as far as I remember, CDL doesn't allow CDL
    Jesper> values to expanded in the make section. And I couldn't
    Jesper> find anything to that effect in the documentation or in
    Jesper> the existing CDL files, so I figure not much changed in
    Jesper> this regard in the past 6 years. Or am I wrong?

    Jesper> Suggestions for alternative ways of handling this
    Jesper> obviously accepted :)

Sadly nothing has changed in this area, i.e. the makefile generator is
now another six years overdue for a major overhaul.

If you really need to do something like this, it is possible but not
easy. You can invoke a Tcl script from inside a custom build step,
along similar lines to the memalloc package. That Tcl script can read
in install/include/pkgconf/ecos.mak and anything else in pkgconf/ that
contains relevant options, e.g. your CYGBLD_GLOBAL_EXTRAS_LDFLAGS. It
can then exec the linker with the appropriate options.

Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.

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