summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-12-18 11:42:43 +0000
committerVincent Sanders <vince@kyllikki.org>2018-12-18 11:42:43 +0000
commit413929dad5a0bffc41d0c66df9cc80689a23c00f (patch)
treeb8a7ddb9fa6892a947c03f51401807d18f9c00b5
parent0a3a40c23eeb22a4ec6e463ca2287df9e337f8ff (diff)
downloadnetsurf-413929dad5a0bffc41d0c66df9cc80689a23c00f.tar.gz
netsurf-413929dad5a0bffc41d0c66df9cc80689a23c00f.tar.bz2
Use pkg-config for freetype2 if available else fallback to old script
-rw-r--r--frontends/framebuffer/Makefile28
1 files changed, 22 insertions, 6 deletions
diff --git a/frontends/framebuffer/Makefile b/frontends/framebuffer/Makefile
index d36728ec0..a99031ef9 100644
--- a/frontends/framebuffer/Makefile
+++ b/frontends/framebuffer/Makefile
@@ -23,17 +23,33 @@ CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
LDFLAGS += -lm
+# freetype is optional but older versions do not use pkg-config
+ifeq ($(NETSURF_FB_FONTLIB),freetype)
+ NETSURF_USE_FREETYPE2 := AUTO
+ NETSURF_FEATURE_FREETYPE2_CFLAGS := -DFB_USE_FREETYPE
+
+ $(eval $(call pkg_config_find_and_add_enabled,FREETYPE2,freetype2,freetype2))
+
+ # try and use non pkg-config method
+ ifeq ($(NETSURF_USE_FREETYPE2),NO)
+ FREETYPE_CONFIG_EXISTS := $(shell freetype-config --cflags >/dev/null && echo yes)
+ ifeq ($(FREETYPE_CONFIG_EXISTS),yes)
+ NETSURF_USE_FREETYPE2 := YES
+ CFLAGS += $(shell freetype-config --cflags) $(NETSURF_FEATURE_FREETYPE2_CFLAGS)
+ LDFLAGS += $(shell freetype-config --libs)
+ $(info FT2.CNFG: freetype2 (freetype2) enabled)
+ else
+ $(info FT2.CNFG: freetype2 (freetype2) failed)
+ $(error Unable to find library for: freetype2)
+ endif
+ endif
+endif
+
# non optional pkg-configed libs
LDFLAGS += -Wl,--whole-archive
$(eval $(call pkg_config_find_and_add,libnsfb,libnsfb))
LDFLAGS += -Wl,--no-whole-archive
-# freetype is optional but does not use pkg-config
-ifeq ($(NETSURF_FB_FONTLIB),freetype)
- CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
- LDFLAGS += $(shell freetype-config --libs)
-endif
-
# ---------------------------------------------------------------------------
# HOST specific feature flags
# ---------------------------------------------------------------------------