[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] wl/freetype-demos-support-ot-svg-glyphs-new 9a238b2 5/
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] wl/freetype-demos-support-ot-svg-glyphs-new 9a238b2 5/5: Makefile: Update for recent FreeType changes. |
Date: |
Mon, 3 Jan 2022 13:30:22 -0500 (EST) |
branch: wl/freetype-demos-support-ot-svg-glyphs-new
commit 9a238b2f088785eb8051f376b33a21a5cfdabccd
Author: Werner Lemberg <wl@gnu.org>
Commit: Werner Lemberg <wl@gnu.org>
Makefile: Update for recent FreeType changes.
(LIBRSVG_INCLUDES): Replaced with...
(FT_DEMO_CFLAGS): ... this variable. This is only manually set for
FreeType's `make devel`.
(COMPILE): Add `FT_DEMO_CFLAGS`.
Update all users.
(LINK_LIBS): Updated to use `FT_DEMO_LDFLAGS` for normal compilation, and
manually adding flags for 'librsvg' otherwise.
---
Makefile | 39 +++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index 287328b..be364ef 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,6 @@ TOP_DIR ?= ../freetype
TOP_DIR_2 ?= .
OBJ_DIR ?= $(TOP_DIR)/objs
-LIBRSVG_INCLUDES=$(shell pkg-config librsvg-2.0 --cflags)
######################################################################
#
@@ -126,6 +125,16 @@ else
SRC_DIR := $(TOP_DIR_2)/src
endif
+ ifeq ($(PLATFORM),unixdev)
+ # `FT_DEMO_CFLAGS` comes from FreeType's `configure` script (via
+ # `builds/unix/unix-cc.mk`), holding additional flags to compile the
+ # FreeType demo programs.
+ #
+ # For the pure `make` call (without using `configure`) we have to add
+ # all needed cflags manually.
+ FT_DEMO_CFLAGS := $(shell pkg-config --cflags librsvg-2.0)
+ endif
+
FT_INCLUDES := $(OBJ_BUILD) \
$(DEVEL_DIR) \
$(TOP_DIR)/include \
@@ -134,7 +143,8 @@ else
COMPILE = $(CC) $(ANSIFLAGS) \
$(INCLUDES:%=$I%) \
$(CPPFLAGS) \
- $(CFLAGS)
+ $(CFLAGS) \
+ $(FT_DEMO_CFLAGS)
# Enable C99 for gcc to avoid warnings.
# Note that clang++ aborts with an error if we use `-std=C99',
@@ -165,18 +175,27 @@ else
LINK_ITEMS = $T$(subst /,$(COMPILER_SEP),$@ $<)
ifeq ($(PLATFORM),unix)
+ # `LDFLAGS` comes from the `configure` script (via FreeType's
+ # `builds/unix/unix-cc.mk`), holding all linker flags necessary to
+ # link the FreeType library.
+ #
+ # `FT_DEMO_LDFLAGS` has been set in `unix-cc.mk`, too.
override CC = $(CCraw)
LINK_CMD = $(LIBTOOL) --mode=link $(CC) \
$(subst /,$(COMPILER_SEP),$(LDFLAGS))
- LINK_LIBS = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE))
$(LIB_CLOCK_GETTIME)
- LINK_LIBS += $(shell pkg-config --libs librsvg-2.0 cairo)
+ LINK_LIBS = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE)) \
+ $(FT_DEMO_LDFLAGS)
else
LINK_CMD = $(CC) $(subst /,$(COMPILER_SEP),$(LDFLAGS))
ifeq ($(PLATFORM),unixdev)
- LINK_LIBS := $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE)) -lm -lrt -lz
-lbz2 -lpthread
+ # For the pure `make` call (without using `configure`) we have to add
+ # all needed libraries manually.
+ LINK_LIBS := $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE)) \
+ -lm -lrt -lz -lbz2 -lpthread
LINK_LIBS += $(shell pkg-config --libs libpng)
LINK_LIBS += $(shell pkg-config --libs harfbuzz)
LINK_LIBS += $(shell pkg-config --libs libbrotlidec)
+ LINK_LIBS += $(shell pkg-config --libs librsvg-2.0)
else
LINK_LIBS = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE))
endif
@@ -358,18 +377,15 @@ else
$(OBJ_DIR_2)/ftcommon.$(SO): $(SRC_DIR)/ftcommon.c $(SRC_DIR)/ftcommon.h
$(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
- $(LIBRSVG_INCLUDES) \
- $T$(subst /,$(COMPILER_SEP),$@ $<)
-
- $(OBJ_DIR_2)/rsvg-port.$(SO): $(SRC_DIR)/rsvg-port.c $(SRC_DIR)/rsvg-port.h
- $(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
- $(LIBRSVG_INCLUDES) \
$T$(subst /,$(COMPILER_SEP),$@ $<)
$(OBJ_DIR_2)/ftpngout.$(SO): $(SRC_DIR)/ftpngout.c $(SRC_DIR)/ftcommon.h
$(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
$T$(subst /,$(COMPILER_SEP),$@ $<)
+ $(OBJ_DIR_2)/rsvg-port.$(SO): $(SRC_DIR)/rsvg-port.c $(SRC_DIR)/rsvg-port.h
+ $(COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
FTCOMMON_OBJ := $(OBJ_DIR_2)/ftcommon.$(SO) \
$(OBJ_DIR_2)/ftpngout.$(SO)
@@ -426,7 +442,6 @@ else
$(SRC_DIR)/ftcommon.h \
$(GRAPH_LIB)
$(COMPILE) $(GRAPH_INCLUDES:%=$I%) \
- $(LIBRSVG_INCLUDES) \
$T$(subst /,$(COMPILER_SEP),$@ $<)
$(OBJ_DIR_2)/ftsdf.$(SO): $(SRC_DIR)/ftsdf.c \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] wl/freetype-demos-support-ot-svg-glyphs-new 9a238b2 5/5: Makefile: Update for recent FreeType changes.,
Werner Lemberg <=