Description: fix dpkg-shlibdeps warning
 Essentially this says don't link in libraries when no symbol from those
 libraries are used. Not implementing this patch causes warning messages
 to appear during dpkg-shlibdeps processing, and eliminating those is the
 first motivation for this patch. For more information see
 https://buildd.debian.org/~brlink/bytag/I-shlibs-useless-link.html .
 One option would have been to remove the '-ldl' argument. However it seems
 safer and more generic to use '-Wl,--as-needed'. This can be viewed as part of
 a wider Ubuntu/Debian movement to tighten the linking in of libraries.
 For more information on this wider movement see
 http://wiki.debian.org/ToolChain/DSOLinking .
Author: Nicholas Bamber <nicholas@periapt.co.uk>
Forwarded: yes, sent private email to upstream authors
Last-Update: 2012-02-21
--- a/mgen/makefiles/Makefile.freebsd
+++ b/mgen/makefiles/Makefile.freebsd
@@ -6,7 +6,7 @@
 #    (Where to find X11 libraries, etc)
 #
 SYSTEM_INCLUDES =  
-SYSTEM_LDFLAGS = 
+SYSTEM_LDFLAGS = -Wl,--as-needed
 SYSTEM_LIBS = -pthread
 ####SYSTEM_LIBS = -lc_r
 
--- a/mgen/makefiles/Makefile.linux
+++ b/mgen/makefiles/Makefile.linux
@@ -7,6 +7,7 @@
 #
 SYSTEM_INCLUDES = -I/usr/X11R6/include 
 SYSTEM_LDFLAGS = -L/usr/X11R6/lib 
+SYSTEM_LDFLAGS += -Wl,--as-needed
 SYSTEM_LIBS = -ldl -lpthread
 
 # 2) System specific capabilities
