ref: 36d03c9f583f4c4b2ad2870784e2fe50814820c9
parent: 2af74c9b87d4a35f019d54ad89c9ef1c2208f7bb
author: Werner Lemberg <[email protected]>
date: Mon Jan 12 06:26:30 EST 2015
Fix Savannah bug #43976. Assure that FreeType's internal include directories are found before `CPPFLAGS' (which might be set by the user in the environment), and `CPPFLAGS' before `CFLAGS'. * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'. (FT_COMPILE): Make this a special variable for compiling only the files handled in `freetype.mk'. (.c.$O): Removed, unused. * src/*/rules.mk (*_COMPILE): Fix order of include directories.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2015-01-12 Werner Lemberg <[email protected]>
+
+ Fix Savannah bug #43976.
+
+ Assure that FreeType's internal include directories are found before
+ `CPPFLAGS' (which might be set by the user in the environment), and
+ `CPPFLAGS' before `CFLAGS'.
+
+ * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'.
+ (FT_COMPILE): Make this a special variable for compiling only the
+ files handled in `freetype.mk'.
+ (.c.$O): Removed, unused.
+
+ * src/*/rules.mk (*_COMPILE): Fix order of include directories.
+
2015-01-11 Werner Lemberg <[email protected]>
[truetype] Prettyfing.
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -155,15 +155,13 @@
FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
endif
-# Note that a build with the `configure' script uses $(CFLAGS) only.
+# `CPPFLAGS' might be specified by the user in the environment.
#
FT_CFLAGS = $(CPPFLAGS) \
- $(INCLUDE_FLAGS) \
$(CFLAGS) \
$DFT2_BUILD_LIBRARY \
$DFT_CONFIG_MODULES_H="<ftmodule.h>" \
$(FTOPTION_FLAG)
-FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
# Include the `exports' rules file.
@@ -195,6 +193,8 @@
FREETYPE_H := $(PUBLIC_H) $(INTERNAL_H) $(CONFIG_H) $(DEVEL_H)
+FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
+
# ftsystem component
#
FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
@@ -269,9 +269,6 @@
objects: $(OBJECTS_LIST)
library: $(PROJECT_LIBRARY)
-
-.c.$O:
- $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
ifneq ($(findstring refdoc,$(MAKECMDGOALS)),)
--- a/src/autofit/rules.mk
+++ b/src/autofit/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))
+AUTOF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# AUTOF driver sources (i.e., C files)
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -23,7 +23,10 @@
# layer proper.
-BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
+BASE_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(BASE_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Base layer sources
--- a/src/bdf/rules.mk
+++ b/src/bdf/rules.mk
@@ -32,7 +32,10 @@
BDF_DIR := $(SRC_DIR)/bdf
-BDF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(BDF_DIR))
+BDF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(BDF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# bdf driver sources (i.e., C files)
--- a/src/bzip2/rules.mk
+++ b/src/bzip2/rules.mk
@@ -22,7 +22,9 @@
# compilation flags for the driver
#
-BZIP2_COMPILE := $(FT_COMPILE)
+BZIP2_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# BZIP2 support sources (i.e., C files)
--- a/src/cache/rules.mk
+++ b/src/cache/rules.mk
@@ -17,9 +17,13 @@
#
CACHE_DIR := $(SRC_DIR)/cache
+
# compilation flags for the driver
#
-CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR))
+CACHE_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Cache driver sources (i.e., C files)
@@ -32,6 +36,7 @@
$(CACHE_DIR)/ftcmanag.c \
$(CACHE_DIR)/ftcmru.c \
$(CACHE_DIR)/ftcsbits.c
+
# Cache driver headers
#
--- a/src/cff/rules.mk
+++ b/src/cff/rules.mk
@@ -18,7 +18,10 @@
CFF_DIR := $(SRC_DIR)/cff
-CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))
+CFF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CFF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# CFF driver sources (i.e., C files)
--- a/src/cid/rules.mk
+++ b/src/cid/rules.mk
@@ -18,7 +18,10 @@
CID_DIR := $(SRC_DIR)/cid
-CID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR))
+CID_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(CID_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# CID driver sources (i.e., C files)
--- a/src/gxvalid/rules.mk
+++ b/src/gxvalid/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-GXV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GXV_DIR))
+GXV_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(GXV_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# GXV driver sources (i.e., C files)
--- a/src/gzip/rules.mk
+++ b/src/gzip/rules.mk
@@ -21,9 +21,14 @@
# compilation flags for the driver
#
ifeq ($(SYSTEM_ZLIB),)
- GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR))
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
else
- GZIP_COMPILE := $(FT_COMPILE)
+ GZIP_COMPILE := $(CC) $(ANSIFLAGS) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
endif
--- a/src/lzw/rules.mk
+++ b/src/lzw/rules.mk
@@ -23,7 +23,10 @@
# compilation flags for the driver
#
-LZW_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(LZW_DIR))
+LZW_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(LZW_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# LZW support sources (i.e., C files)
--- a/src/otvalid/rules.mk
+++ b/src/otvalid/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-OTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR))
+OTV_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(OTV_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# OTV driver sources (i.e., C files)
--- a/src/pcf/rules.mk
+++ b/src/pcf/rules.mk
@@ -30,7 +30,10 @@
PCF_DIR := $(SRC_DIR)/pcf
-PCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))
+PCF_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PCF_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# pcf driver sources (i.e., C files)
--- a/src/pfr/rules.mk
+++ b/src/pfr/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-PFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR))
+PFR_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PFR_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# pfr driver sources (i.e., C files)
--- a/src/psaux/rules.mk
+++ b/src/psaux/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-PSAUX_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR))
+PSAUX_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSAUX driver sources (i.e., C files)
--- a/src/pshinter/rules.mk
+++ b/src/pshinter/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))
+PSHINTER_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSHINTER driver sources (i.e., C files)
--- a/src/psnames/rules.mk
+++ b/src/psnames/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
+PSNAMES_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# PSNames driver sources (i.e., C files)
--- a/src/raster/rules.mk
+++ b/src/raster/rules.mk
@@ -19,7 +19,10 @@
# compilation flags for the driver
#
-RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
+RASTER_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# raster driver sources (i.e., C files)
--- a/src/sfnt/rules.mk
+++ b/src/sfnt/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))
+SFNT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# SFNT driver sources (i.e., C files)
--- a/src/smooth/rules.mk
+++ b/src/smooth/rules.mk
@@ -17,9 +17,13 @@
#
SMOOTH_DIR := $(SRC_DIR)/smooth
+
# compilation flags for the driver
#
-SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR))
+SMOOTH_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# smooth driver sources (i.e., C files)
--- a/src/truetype/rules.mk
+++ b/src/truetype/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR))
+TT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(TT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# TrueType driver sources (i.e., C files)
--- a/src/type1/rules.mk
+++ b/src/type1/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-T1_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T1_DIR))
+T1_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(T1_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Type1 driver sources (i.e., C files)
--- a/src/type42/rules.mk
+++ b/src/type42/rules.mk
@@ -20,7 +20,10 @@
# compilation flags for the driver
#
-T42_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T42_DIR))
+T42_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Type42 driver source
--- a/src/winfonts/rules.mk
+++ b/src/winfonts/rules.mk
@@ -18,7 +18,10 @@
FNT_DIR := $(SRC_DIR)/winfonts
-FNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(FNT_DIR))
+FNT_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(FNT_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
# Windows driver sources (i.e., C files)