Skip to content

Commit d7a45a6

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Switch to using freetype-config for freetype detection.
2 parents edf601a + a0955f3 commit d7a45a6

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ PHP NEWS
2323
- Filter:
2424
. Fixed bug #66229 (128.0.0.0/16 isn't reserved any longer). (Adam)
2525

26+
- GD:
27+
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
28+
(Adam)
29+
2630
- SOAP
2731
. Fixed bug #66112 (Use after free condition in SOAP extension).
2832
(martin dot koegler at brz dot gv dot at)

ext/gd/config.m4

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,30 +185,25 @@ AC_DEFUN([PHP_GD_FREETYPE2],[
185185
if test "$PHP_FREETYPE_DIR" != "no"; then
186186
187187
for i in $PHP_FREETYPE_DIR /usr/local /usr; do
188-
if test -f "$i/include/freetype2/freetype/freetype.h"; then
188+
if test -f "$i/bin/freetype-config"; then
189189
FREETYPE2_DIR=$i
190-
FREETYPE2_INC_DIR=$i/include/freetype2
190+
FREETYPE2_CONFIG="$i/bin/freetype-config"
191191
break
192192
fi
193193
done
194194
195195
if test -z "$FREETYPE2_DIR"; then
196-
AC_MSG_ERROR([freetype.h not found.])
196+
AC_MSG_ERROR([freetype-config not found.])
197197
fi
198198
199-
PHP_CHECK_LIBRARY(freetype, FT_New_Face,
200-
[
201-
PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD)
202-
PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
203-
PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
204-
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
205-
AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
206-
AC_DEFINE(ENABLE_GD_TTF,1,[ ])
207-
],[
208-
AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.])
209-
],[
210-
-L$FREETYPE2_DIR/$PHP_LIBDIR
211-
])
199+
FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags`
200+
FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs`
201+
202+
PHP_EVAL_INCLINE($FREETYPE2_CFLAGS)
203+
PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
204+
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
205+
AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
206+
AC_DEFINE(ENABLE_GD_TTF,1,[ ])
212207
else
213208
AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>])
214209
fi

0 commit comments

Comments
 (0)