From: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Date: Sat, 10 Oct 2015 19:55:38 +0300
Subject: Remove custom library search paths from Makefiles

This patch removes library search and include paths (such as -L/usr/lib)
defined by upstream. Since all the libraries and headers needed are
available in the default path, these flags are redundant. In addition,
since '/usr/lib' may have different purpose on various architectures,
like mips*, it causes FTBFS.

Thanks to YunQiang Su for bringing this up.

Author: Vasudev Kamath <kamathvasudev@gmail.com>
Bug-Debian: https://bugs.debian.org/722839
Forwarded: no
---
 dmenu/config.mk    |    4 ++--
 lsw/config.mk      |    4 ++--
 slock/config.mk    |    4 ++--
 slstatus/config.mk |    4 ++--
 sprop/config.mk    |    4 ++--
 sselp/config.mk    |    4 ++--
 ssid/config.mk     |    4 ++--
 swarp/config.mk    |    4 ++--
 tabbed/Makefile    |    4 ++--
 wmname/config.mk   |    4 ++--
 xssstate/config.mk |    4 ++--
 11 files changed, 22 insertions(+), 22 deletions(-)

--- a/dmenu/config.mk
+++ b/dmenu/config.mk
@@ -20,8 +20,8 @@ FREETYPEINC = /usr/include/freetype2
 #MANPREFIX = ${PREFIX}/man
 
 # includes and libs
-INCS = -I$(X11INC) -I$(FREETYPEINC)
-LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
+INCS = $(shell $(PKG_CONFIG) --cflags fontconfig xft)
+LIBS = -lX11 $(XINERAMALIBS) $(FREETYPELIBS)
 
 # flags
 CPPFLAGS += -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
--- a/lsw/config.mk
+++ b/lsw/config.mk
@@ -9,8 +9,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I${X11INC}
-LIBS = -L${X11LIB} -lX11
+INCS =
+LIBS = -lX11
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\"
--- a/slock/config.mk
+++ b/slock/config.mk
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr
+INCS =
+LIBS = -lc -lcrypt -lX11 -lXext -lXrandr
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
--- a/sprop/config.mk
+++ b/sprop/config.mk
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
+INCS =
+LIBS = -lc -lX11
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\"
--- a/sselp/config.mk
+++ b/sselp/config.mk
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
+INCS =
+LIBS = -lc -lX11
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\"
--- a/ssid/config.mk
+++ b/ssid/config.mk
@@ -7,8 +7,8 @@ VERSION = 0.1
 PREFIX = /usr/local
 
 # includes and libs
-INCS = -I. -I/usr/include
-LIBS = -L/usr/lib -lc
+INCS =
+LIBS = -lc
 
 # flags
 CFLAGS += ${INCS} -DVERSION=\"${VERSION}\" ${CPPFLAGS}
--- a/swarp/config.mk
+++ b/swarp/config.mk
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
+INCS =
+LIBS = -lc -lX11
 
 # flags
 CFLAGS += ${INCS} -DVERSION=\"${VERSION}\" ${CPPFLAGS}
--- a/wmname/config.mk
+++ b/wmname/config.mk
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
+INCS =
+LIBS = -lc -lX11
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\"
--- a/xssstate/config.mk
+++ b/xssstate/config.mk
@@ -8,8 +8,8 @@ PREFIX = /usr/local
 MANPREFIX = ${PREFIX}/share/man
 
 # includes and libs
-INCS = -I. -I/usr/include
-LIBS = -L/usr/lib -lc -lX11 -lXss
+INCS =
+LIBS = -lc -lX11 -lXss
 
 # flags
 CPPFLAGS += -DVERSION=\"${VERSION}\"
--- a/tabbed/Makefile
+++ b/tabbed/Makefile
@@ -9,8 +9,8 @@ MANPREFIX = ${PREFIX}/share/man
 DOCPREFIX = ${PREFIX}/share/doc/${NAME}
 
 # use system flags.
-CFLAGS += -I/usr/X11R6/include -I/usr/include/freetype2
-LDFLAGS += -L/usr/X11R6/lib -lX11 -lfontconfig -lXft
+CFLAGS += $(shell $(PKG_CONFIG) --cflags fontconfig xft)
+LDFLAGS += -lX11 $(shell $(PKG_CONFIG) --libs fontconfig xft)
 CPPFLAGS += -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700L
 
 # OpenBSD (uncomment)
--- a/slstatus/config.mk
+++ b/slstatus/config.mk
@@ -11,9 +11,9 @@ X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
 # flags
-CPPFLAGS += -I$(X11INC) -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\"
+CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\"
 CFLAGS   += -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
-LDFLAGS  += -L$(X11LIB)
+LDFLAGS  +=
 # OpenBSD: add -lsndio
 # FreeBSD: add -lkvm -lsndio
 LDLIBS   += -lX11
