This is about best practices.
The GNU Make manual says  
(https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html)
> LDFLAGS
> Extra flags to give to compilers when they are supposed to invoke the linker, 
> ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable 
> instead.

> LDLIBS
> Library flags or names given to compilers when they are supposed to invoke 
> the linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative 
> to LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS 
> variable.

When calling, e.g.:  
`xeno-config --skin cobalt --ldflags --no-auto-init`
you get 
-Wl,--no-as-needed -Wl,@/usr/xenomai/lib/modechk.wrappers    -L/usr/xenomai/lib 
-lcobalt -lmodechk -lpthread -lrt

So according to the Make manual, this should be split in 
LDFLAGS=-Wl,--no-as-needed -Wl,@/usr/xenomai/lib/modechk.wrappers    
-L/usr/xenomai/lib 
LDLIBS=-lcobalt -lmodechk -lpthread -lrt

How do you deal with this in practical life? I tend to have everything into 
`LDLIBS`: even though it does not follow the manual, it works. I guess there 
are only a small number of cases in which not following the manual actually 
causes troubles.  Did you encounter any when working with Xenomai? How do you 
handle the list of options generated by xeno-config ?

Giulio
_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to