From 32ce533d54f3474f11d871fa754d621e0e820dd2 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 1 Aug 2011 18:09:27 +0200 Subject: [PATCH] =?utf8?q?enable=20-Wl,--as-needed=20only=20on=20Linux=20(?= =?utf8?q?doesn=E2=80=99t=20work=20on=20Mac=20OS=20X)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- common.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common.mk b/common.mk index 05b10611..ce41f287 100644 --- a/common.mk +++ b/common.mk @@ -71,7 +71,11 @@ LIBS += $(call ldflags_for_lib, x11, X11) LIBS += $(call ldflags_for_lib, yajl, yajl) LIBS += $(call ldflags_for_lib, libev, ev) +# Please test if -Wl,--as-needed works on your platform and send me a patch. +# it is known not to work on Darwin (Mac OS X) +ifneq (,$(filter Linux GNU GNU/%, $(UNAME))) LDFLAGS += -Wl,--as-needed +endif ifeq ($(UNAME),NetBSD) # We need -idirafter instead of -I to prefer the system’s iconv over GNU libiconv -- 2.39.5