LD Changes To Implicit DSO Linking Update

Roland McGrath roland at redhat.com
Wed Feb 10 18:41:37 UTC 2010

> To answer the question, it works because the CFLAGS happen to be applied
> to the linker command as well as the LDFLAGS. As Roland says, though,
> adding it to CFLAGS is the wrongest fix, forcing it into LDFLAGS via the
> spec file is slightly less wrong, but having the upstream code add the
> flag properly during its configure stage is least wrong.

The main point of entirely pointless pedanticism I was making is that you
really should put -lfoo at the end of a linking command line (after all the
.o files), not at the beginning where ${LDFLAGS} usually goes.  

For cases like this, it probably doesn't make a great deal of sense to use
a configure test.  That is, the call to some X11* function is not
conditional in the source, so -lX11 need not be conditional in the makefile.

When there is no true need to conditionalize anything, extra autoconf
and/or pkg-config magic just makes everything more arcane for no reason.


More information about the devel mailing list