From: Michael Stapelberg Date: Mon, 1 Aug 2011 16:09:27 +0000 (+0200) Subject: enable -Wl,--as-needed only on Linux (doesn’t work on Mac OS X) X-Git-Tag: 4.0.1~3^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32ce533d54f3474f11d871fa754d621e0e820dd2;p=i3%2Fi3 enable -Wl,--as-needed only on Linux (doesn’t work on Mac OS X) --- 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