Ticket #659 (new task)

Opened 4 years ago

Cleanup use of LINK_LIBS

Reported by: baker Owned by: somebody
Priority: trivial Milestone: Linux
Component: ALL modules Version: 7.10
Keywords: Cc:

Description

For Linux, LINK_LIBS is defined in the ew_linux.bash setup script as "-lm -lpthread". In most of the makefile.unix's, the same libraries are defined in the LINUX_FLAGS, then included twice in the link command when LIBS is defined to include both $(SPECIFIC_FLAGS) and $(LINK_LIBS). LINK_LIBS should either be global and used that way, or deleted and LINUX_FLAGS should be set everywhere to include -lm and -lpthread if they are actually needed.

I recommend the use of standard make macro names whenever possible:

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.

It makes writing makefiles much simpler.

Note: See TracTickets for help on using tickets.