From 589a84fd3d5362d2acb964c7ef3071e9315ce740 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Wed, 20 Dec 2017 10:50:47 +0100 Subject: [PATCH] Fix use of FontConfig on non linux platforms (FreeBSD, etc.) just define USE_FC in the Makefile to have text.c compiled with Fontconfig support --- src/Makefile | 2 ++ src/text.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 211bba14..2b36a2a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -257,6 +257,7 @@ endif LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm OBJDIR = ../obj/unix FCLOPT = -lfontconfig + COPT += -DUSE_FC CC = gcc else ifeq ($(PLATFORM),FreeMiNT) #10 @@ -397,6 +398,7 @@ endif CC = gcc OBJDIR = ../obj/unix FCLOPT = -lfontconfig + COPT += -DUSE_FC # enable UTF8 filename translation # For Linux (GLibc), iconv is built into the C library so no LOPT needed. diff --git a/src/text.c b/src/text.c index a5ffafce..f4d905cf 100644 --- a/src/text.c +++ b/src/text.c @@ -40,7 +40,7 @@ #if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__) // No fontconfig -#elif defined(__linux__) +#elif defined(USE_FC) && !defined(NOTTF) #include #endif #endif @@ -327,11 +327,8 @@ void Init_text(void) #elif defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__) // No fontconfig : Only use fonts from Grafx2 - #elif defined(__linux__) + #elif defined(USE_FC) #ifndef NOTTF - #define USE_FC - - #ifdef USE_FC { FcStrList* dirs; FcChar8 * fdir; @@ -345,7 +342,6 @@ void Init_text(void) FcStrListDone(dirs); } - #endif #endif #elif defined(__amigaos4__) || defined(__amigaos__) #ifndef NOTTF