Fix Savannah bug #38235.

Work around a bug in pkg-config version 0.28 and earlier: If a
variable value gets surrounded by doublequotes (in particular values
for the `prefix' variable), the prefix override mechanism fails.

* builds/unix/freetype2.in: Don't use doublequotes.
* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
names with backslashes.
This commit is contained in:
Werner Lemberg 2014-03-27 17:38:23 +01:00
parent ab76d970e7
commit f41070fef0
3 changed files with 33 additions and 8 deletions

View File

@ -1,3 +1,15 @@
2014-03-27 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #38235.
Work around a bug in pkg-config version 0.28 and earlier: If a
variable value gets surrounded by doublequotes (in particular values
for the `prefix' variable), the prefix override mechanism fails.
* builds/unix/freetype2.in: Don't use doublequotes.
* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
names with backslashes.
2014-03-24 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #41946.

View File

@ -1,7 +1,7 @@
prefix="%prefix%"
exec_prefix="%exec_prefix%"
libdir="%libdir%"
includedir="%includedir%/freetype2"
prefix=%prefix%
exec_prefix=%exec_prefix%
libdir=%libdir%
includedir=%includedir%/freetype2
Name: FreeType 2
URL: http://freetype.org

View File

@ -114,16 +114,29 @@ $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
chmod a-w $@.tmp
mv $@.tmp $@
# To support directory names with spaces (as might easily happen on Windows
# platforms), the right solution would be to surround the pkg-variables in
# `freetype2.pc' with double quotes. However, doing so ironically disables
# the prefix override mechanism especially written for Windows. This is a
# bug in pkg-config version 0.28 and earlier.
#
# For this reason, we escape spaces with backslashes.
exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix))
includedir_x := $(subst $(space),\\$(space),$(includedir))
libdir_x := $(subst $(space),\\$(space),$(libdir))
prefix_x := $(subst $(space),\\$(space),$(prefix))
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
rm -f $@ $@.tmp
sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \
-e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
-e 's|%exec_prefix%|$(exec_prefix)|' \
-e 's|%exec_prefix%|$(exec_prefix_x)|' \
-e 's|%ft_version%|$(ft_version)|' \
-e 's|%includedir%|$(includedir)|' \
-e 's|%libdir%|$(libdir)|' \
-e 's|%prefix%|$(prefix)|' \
-e 's|%includedir%|$(includedir_x)|' \
-e 's|%libdir%|$(libdir_x)|' \
-e 's|%prefix%|$(prefix_x)|' \
$< \
> $@.tmp
chmod a-w $@.tmp