After commit 1997d3d6c4 (net-snmp: Do not
pass LDFLAGS to compiler), some linker flags, like "-Wl,--as-needed",
appear too late on the linker command line. Backport a patch that
corrects the order of the arguments given to the linker.
Unfortunately, the patch is not enough. libtool reorders the arguments
given to libtool --mode=link so that any lib dependencies appear before
other linker arguments. Therefore it is needed to inject -Wl,--as-needed
on the linker command line that libtool produces.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>