aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorArthur Williams <taaparthur@gmail.com>2021-09-19 01:49:56 -0700
committerNRK <nrk@disroot.org>2021-10-10 02:17:50 +0600
commit675db4bbb646ff51cc3ecc8ba7d587670872580a (patch)
treef0536022677edf2968f770a0dc67a02e074d8b69 /Makefile
parent6ce94e3e3b8cccab0a5cc23c7538ad19626c1c1d (diff)
Make statusbar optional (#95)
libXft and libfontconfig are now optional dependencies which can be disabled via `HAVE_LIBFONTS=0`. Disabling them means disabling the statusbar. This also does not search for freetype2 header if disabled. Co-authored-by: NRK <nrk@disroot.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 45971dd..caf72f5 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ OPT_DEP_DEFAULT ?= 1
HAVE_INOTIFY ?= $(OPT_DEP_DEFAULT)
# optional dependencies, see README for more info
+HAVE_LIBFONTS ?= $(OPT_DEP_DEFAULT)
HAVE_LIBGIF ?= $(OPT_DEP_DEFAULT)
HAVE_LIBEXIF ?= $(OPT_DEP_DEFAULT)
HAVE_LIBWEBP ?= $(OPT_DEP_DEFAULT)
@@ -23,11 +24,16 @@ CFLAGS ?= -std=c99 -Wall -pedantic
# icons that will be installed via `make icon`
ICONS = 16x16.png 32x32.png 48x48.png 64x64.png 128x128.png
+inc_fonts_0 =
+inc_fonts_1 = -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2
+
CPPFLAGS = -D_XOPEN_SOURCE=700 \
-DHAVE_LIBGIF=$(HAVE_LIBGIF) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \
- -DHAVE_LIBWEBP=$(HAVE_LIBWEBP) \
- -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2
+ -DHAVE_LIBWEBP=$(HAVE_LIBWEBP) -DHAVE_LIBFONTS=$(HAVE_LIBFONTS) \
+ $(inc_fonts_$(HAVE_LIBFONTS))
+lib_fonts_0 =
+lib_fonts_1 = -lXft -lfontconfig
lib_exif_0 =
lib_exif_1 = -lexif
lib_gif_0 =
@@ -37,9 +43,9 @@ lib_webp_1 = -lwebpdemux -lwebp
autoreload_0 = nop
autoreload_1 = inotify
# using += because certain *BSD distros may need to add additional flags
-LDLIBS += -lImlib2 -lX11 -lXft -lfontconfig \
+LDLIBS += -lImlib2 -lX11 \
$(lib_exif_$(HAVE_LIBEXIF)) $(lib_gif_$(HAVE_LIBGIF)) \
- $(lib_webp_$(HAVE_LIBWEBP))
+ $(lib_webp_$(HAVE_LIBWEBP)) $(lib_fonts_$(HAVE_LIBFONTS))
OBJS = autoreload_$(autoreload_$(HAVE_INOTIFY)).o commands.o image.o main.o options.o \
thumbs.o util.o window.o