My god, I am a horrible self-editor. Sorry. Please ignore the magnum
opus above and allow me to try again.
In dev-lang/python*, we use
append-ldflags '-L.'
to ensure linking is performed against the built libpython.so in-tree,
rather than than in the one in $(libdir). But, this doesn't work if
LDFLAGS contains "-L$(libdir)".
We could try to fix this like:
export LDFLAGS="-L. ${LDFLAGS}"
or so. That would cover 99.9% of the cases out there. But very rarely,
indiscriminately placing our '-L.' before every other clause in LDFLAGS
might cause an unanticipated side-effect.
The flag-o-matic patch in my previous post analyses LDPATH and finds the
first statement that might possibly cause the ld command-line
library-search-path to be impacted, and inserts the "-L." just before
that statement, hopefully achieving the desired result with the least
possible side-effects.
I wonder: do people feel this distinction is meaningful enough to
justify actually making it? Or am I just being an anal-retentive nut-job?
If you tried to read my first post, thanks for not offing yourself like
the guys who get stuck sitting next to Ted Striker in _Airplane!_
-gmt