only add libxdg-basedir as dependency when needed

This commit is contained in:
Sascha Kruse 2013-03-20 08:54:44 +00:00
parent d03344803d
commit 14d59c4d0c

View File

@ -25,17 +25,22 @@ ifeq (${PKG_CONFIG}, ${EMPTY})
$(error "Failed to find pkg-config, please make sure it is installed") $(error "Failed to find pkg-config, please make sure it is installed")
endif endif
pkg_config_packs:="dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver glib-2.0 gio-2.0 pango cairo pangocairo" # flags
CPPFLAGS += -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${INIFLAGS}
CFLAGS += -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} ${EXTRACFLAGS}
pkg_config_packs:="dbus-1 x11 freetype2 xext xft xscrnsaver glib-2.0 gio-2.0 pango cairo pangocairo"
# check if we need libxdg-basedir
ifeq (,$(findstring STATIC_CONFIG,$(CFLAGS)))
pkg_config_packs += libxdg-basedir
endif
# includes and libs # includes and libs
INCS := $(shell ${PKG_CONFIG} --cflags ${pkg_config_packs}) INCS := $(shell ${PKG_CONFIG} --cflags ${pkg_config_packs})
LIBS := -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell ${PKG_CONFIG} --libs ${pkg_config_packs}) CFLAGS += ${INCS}
LDFLAGS += -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell ${PKG_CONFIG} --libs ${pkg_config_packs})
ifeq (${INCS}, ${EMPTY}) ifeq (${INCS}, ${EMPTY})
$(error "pkg-config failed, see errors above") $(error "pkg-config failed, see errors above")
endif endif
# flags
CPPFLAGS += -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${INIFLAGS}
CFLAGS += -g --std=c99 -pedantic -Wall -Wno-overlength-strings -Os ${INCS} ${STATIC} ${CPPFLAGS} ${EXTRACFLAGS}
LDFLAGS += ${LIBS}