Fix Savannah bug #38235. * builds/unix/configure.raw: Don't generate `freetype-config' and `freetype.pc'. * builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ, build_libtool_libs, ft_version): New variables to be substituted. (freetype-config, freetype.pc): New rules to generate those files. * builds/unix/freetype-config.in: Remove code for handling `rpath'. The use of $rpath has been accidentally removed in a patch from 2009-12-22, and apparently noone has missed it since. Use `%' instead of `@' as a variable substitution marker. Use quotes. * builds/unix/freetype.in: Use `%' instead of `@' as a variable substitution marker. Use quotes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
diff --git a/ChangeLog b/ChangeLog
index b42df16..fad4a8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2013-02-02 Werner Lemberg <wl@gnu.org>
+
+ Fix Savannah bug #38235.
+
+ * builds/unix/configure.raw: Don't generate `freetype-config' and
+ `freetype.pc'.
+
+ * builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ,
+ build_libtool_libs, ft_version): New variables to be substituted.
+ (freetype-config, freetype.pc): New rules to generate those files.
+
+ * builds/unix/freetype-config.in: Remove code for handling `rpath'.
+ The use of $rpath has been accidentally removed in a patch from
+ 2009-12-22, and apparently noone has missed it since.
+ Use `%' instead of `@' as a variable substitution marker.
+ Use quotes.
+
+ * builds/unix/freetype.in: Use `%' instead of `@' as a variable
+ substitution marker.
+ Use quotes.
+
2013-02-07 Werner Lemberg <wl@gnu.org>
* src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index bf26061..5ddedc3 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -2,7 +2,7 @@
#
# Process this file with autoconf to produce a configure script.
#
-# Copyright 2001-2012 by
+# Copyright 2001-2013 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -727,9 +727,7 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
# and `builds/unix/unix-cc.mk' that will be used by the build system
#
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
- unix-def.mk:unix-def.in
- freetype-config
- freetype2.pc:freetype2.in])
+ unix-def.mk:unix-def.in])
# re-generate the Jamfile to use libtool now
#
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
index 1c0cc07..2edcd11 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -12,14 +12,12 @@
LC_ALL=C
export LC_ALL
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-includedir=@includedir@
-libdir=@libdir@
-enable_shared=@build_libtool_libs@
-wl=@wl@
-hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
+prefix="%prefix%"
+exec_prefix="%exec_prefix%"
+exec_prefix_set="no"
+includedir="%includedir%"
+libdir="%libdir%"
+enable_shared="%build_libtool_libs%"
usage()
{
@@ -75,7 +73,7 @@ while test $# -gt 0 ; do
echo_exec_prefix=yes
;;
--version)
- echo @ft_version@
+ echo %ft_version%
exit 0
;;
--ftversion)
@@ -143,12 +141,9 @@ if test "$echo_cflags" = "yes" ; then
fi
if test "$echo_libs" = "yes" ; then
- rpath=
- if test "$enable_shared" = "yes" ; then
- eval "rpath=\"$hardcode_libdir_flag_spec\""
- fi
- libs="-lfreetype @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@"
- if test "${SYSROOT}$libdir" != "/usr/lib" && test "${SYSROOT}$libdir" != "/usr/lib64"; then
+ libs="-lfreetype %LIBZ% %LIBBZ2% %FT2_EXTRA_LIBS%"
+ if test "${SYSROOT}$libdir" != "/usr/lib" &&
+ test "${SYSROOT}$libdir" != "/usr/lib64"; then
echo -L${SYSROOT}$libdir $libs
else
echo $libs
diff --git a/builds/unix/freetype2.in b/builds/unix/freetype2.in
index b731800..c5c3027 100644
--- a/builds/unix/freetype2.in
+++ b/builds/unix/freetype2.in
@@ -1,12 +1,12 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix="%prefix%"
+exec_prefix="%exec_prefix%"
+libdir="%libdir%"
+includedir="%includedir%"
Name: FreeType 2
Description: A free, high-quality, and portable font engine.
-Version: @ft_version@
+Version: %ft_version%
Requires:
Libs: -L${libdir} -lfreetype
-Libs.private: @LIBZ@ @LIBBZ2@ @FT2_EXTRA_LIBS@
+Libs.private: %LIBZ% %LIBBZ2% %FT2_EXTRA_LIBS%
Cflags: -I${includedir}/freetype2 -I${includedir}
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index d3ebc8b..9c5e941 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2002, 2004, 2006, 2008 by
+# Copyright 1996-2000, 2002, 2004, 2006, 2008, 2013 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -15,10 +15,10 @@
TOP_DIR := $(shell cd $(TOP_DIR); pwd)
-DELETE := rm -f
-DELDIR := @RMDIR@
-CAT := cat
-SEP := /
+DELETE := rm -f
+DELDIR := @RMDIR@
+CAT := cat
+SEP := /
# this is used for `make distclean' and `make install'
OBJ_BUILD ?= $(BUILD_DIR)
@@ -57,6 +57,13 @@ datadir := @datadir@
version_info := @version_info@
+# Variables needed for `freetype-config' and `freetype.pc'.
+#
+FT2_EXTRA_LIBS := @FT2_EXTRA_LIBS@
+LIBBZ2 := @LIBBZ2@
+LIBZ := @LIBZ@
+build_libtool_libs := @build_libtool_libs@
+ft_version := @ft_version@
# The directory where all library files are placed.
#
@@ -82,4 +89,48 @@ SYSTEM_ZLIB := @SYSTEM_ZLIB@
NO_OUTPUT := 2> /dev/null
+# To support calls like
+#
+# configure --includedir='${libdir}'/freetype2/include
+#
+# we generate `freetype-config' and `freetype.pc' at compile time so that
+# those variables are properly expanded.
+
+$(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
+ rm -f $@ $@.tmp
+ sed -e 's|%FT2_EXTRA_LIBS%|$(FT2_EXTRA_LIBS)|' \
+ -e 's|%LIBBZ2%|$(LIBBZ2)|' \
+ -e 's|%LIBZ%|$(LIBZ)|' \
+ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
+ -e 's|%exec_prefix%|$(exec_prefix)|' \
+ -e 's|%ft_version%|$(ft_version)|' \
+ -e 's|%includedir%|$(includedir)|' \
+ -e 's|%libdir%|$(libdir)|' \
+ -e 's|%prefix%|$(prefix)|' \
+ $< \
+ > $@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
+ rm -f $@ $@.tmp
+ sed -e 's|%FT2_EXTRA_LIBS%|$(FT2_EXTRA_LIBS)|' \
+ -e 's|%LIBBZ2%|$(LIBBZ2)|' \
+ -e 's|%LIBZ%|$(LIBZ)|' \
+ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
+ -e 's|%exec_prefix%|$(exec_prefix)|' \
+ -e 's|%ft_version%|$(ft_version)|' \
+ -e 's|%includedir%|$(includedir)|' \
+ -e 's|%libdir%|$(libdir)|' \
+ -e 's|%prefix%|$(prefix)|' \
+ $< \
+ > $@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+all: $(OBJ_BUILD)/freetype-config \
+ $(OBJ_BUILD)/freetype2.pc
+
# EOF