From:             marcus at synchromedia dot co dot uk
Operating system: Mac OS X
PHP version:      5.1.2
PHP Bug Type:     Compile Failure
Bug description:  gd undeclared freetype2 constants

Description:
------------
I can't get php 5.1.2 to compile with gd and freetype2. I have 
tried using the bundled gd and also gd-2.0.33-3 from fink. 
I've also tried using freetype2-2.1.9-1 from fink and the 
system standard install at /usr/X11R6. Compiling without 
freetype (any version) results in a working (minus freetype 
features) gd extension.
I'm pretty sure I'm using correct paths, as mentioned in 
various places including this bug: http://bugs.php.net/
bug.php?id=27625.
I do not have this problem when compiling on Linux with 
similar settings.

Reproduce code:
---------------
my config.nice (cut down to just environment, gd and freetype related
options):

CFLAGS='-DBIND_8_COMPAT=1 -DEAPI -O3 -mcpu=G4 -mtune=G4 -I/sw/include' \
CXXFLAGS='-I/sw/include' \
CPPFLAGS='-I/sw/include' \
LDFLAGS='-L/sw/lib' \
'./configure' \
'--with-layout=Darwin' \
'--bindir=/usr/bin' \
'--enable-gd-imgstrttf' \
'--enable-gd-native-ttf' \
'--sysconfdir=/etc' \
'--with-apxs2=/sw/sbin/apxs' \
'--with-config-file-path=/etc' \
'--with-config-file-scan-dir=/etc/php.d' \
'--with-freetype-dir=/sw/lib/freetype2' \
'--with-gd' \
'--with-iconv=/sw' \
'--with-jpeg-dir=/sw' \
'--with-png-dir=/sw' \
'--with-pear' \
'--with-png' \
'--with-t1lib=/sw' \
'--with-ttf=/sw' \
'--with-zlib' \
"$@"

make

Expected result:
----------------
Successful compilation.

Actual result:
--------------
Configure seems to be happy with my settings:

checking for GD support... yes
checking for the location of libjpeg... /sw
checking for the location of libpng... /sw
checking for the location of libXpm... no
checking for FreeType 1.x support... /sw
checking for FreeType 2... /sw/lib/freetype2
checking for T1lib support... /sw
checking whether to enable truetype string function in GD... 
yes
checking whether to enable JIS-mapped Japanese font support 
in GD... no
checking for jpeg_read_header in -ljpeg... (cached) yes
checking for png_write_image in -lpng... (cached) yes
If configure fails try --with-xpm-dir=<DIR>
checking for FreeType 1 support... no - FreeType 2.x is to 
be used instead
checking for T1_StrError in -lt1... (cached) yes
checking for gdImageString16 in -lgd... (cached) yes
checking for gdImagePaletteCopy in -lgd... (cached) yes
checking for gdImageCreateFromPng in -lgd... (cached) yes
checking for gdImageCreateFromGif in -lgd... (cached) yes
checking for gdImageGif in -lgd... (cached) yes
checking for gdImageWBMP in -lgd... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) yes
checking for gdImageCreateFromXpm in -lgd... (cached) yes
checking for gdImageCreateFromGd2 in -lgd... (cached) yes
checking for gdImageCreateTrueColor in -lgd... (cached) yes
checking for gdImageSetTile in -lgd... (cached) yes
checking for gdImageEllipse in -lgd... no
checking for gdImageSetBrush in -lgd... (cached) yes
checking for gdImageStringTTF in -lgd... (cached) yes
checking for gdImageStringFT in -lgd... (cached) yes
checking for gdImageStringFTEx in -lgd... (cached) yes
checking for gdImageColorClosestHWB in -lgd... (cached) yes
checking for gdImageColorResolve in -lgd... (cached) yes
checking for gdImageGifCtx in -lgd... (cached) yes
checking for gdCacheCreate in -lgd... (cached) yes
checking for gdFontCacheShutdown in -lgd... (cached) yes
checking for gdFreeFontCache in -lgd... (cached) yes
checking for gdNewDynamicCtxEx in -lgd... (cached) yes
checking for gdImageCreate in -lgd... (cached) yes

but make dies like this:

/Users/marcus/src/php-5.1.2/ext/gd/gd.c: In function 
'zm_info_gd':
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:505: error: 
'FREETYPE_MAJOR' undeclared (first use in this function)
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:505: error: (Each 
undeclared identifier is reported only once
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:505: error: for each 
function it appears in.)
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:505: error: 
'FREETYPE_MINOR' undeclared (first use in this function)
/Users/marcus/src/php-5.1.2/ext/gd/gd.c: In function 
'php_imagechar':
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:2817: warning: 
pointer targets in passing argument 1 of 'strlen' differ in 
signedness
/Users/marcus/src/php-5.1.2/ext/gd/gd.c: In function 
'php_imagettftext_common':
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:3197: warning: 
pointer targets in passing argument 4 of 'gdImageStringFTEx' 
differ in signedness
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:3197: warning: 
pointer targets in passing argument 9 of 'gdImageStringFTEx' 
differ in signedness
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:3203: warning: 
pointer targets in passing argument 4 of 'gdImageStringFT' 
differ in signedness
/Users/marcus/src/php-5.1.2/ext/gd/gd.c:3203: warning: 
pointer targets in passing argument 9 of 'gdImageStringFT' 
differ in signedness
make: *** [ext/gd/gd.lo] Error 1

This looks like a simple missing header file defining these 
constants?

-- 
Edit bug report at http://bugs.php.net/?id=36465&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36465&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36465&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36465&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36465&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36465&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36465&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36465&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36465&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36465&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36465&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36465&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36465&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36465&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36465&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36465&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36465&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36465&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36465&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36465&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36465&r=mysqlcfg

Reply via email to