From: Bjorn dot Wiberg at its dot uu dot se
Operating system: IBM AIX 5.2.0.0 ML3
PHP version: 5.0.0
PHP Bug Type: Compile Failure
Bug description: OpenSSL include path cause FreeType 1 headers to be found instead of FreeType 2
Description:
------------
If OpenSSL support is configured (OpenSSL installed from RPM), and both
FreeType 1 and 2 are installed on the system, OpenSSL causes GDLIB_CFLAGS
to list -I/opt/freeware/include before -I/usr/include/freetype2, such that
the chosen FreeType version (2) accidentally includes
/opt/freeware/include/freetype/freetype.h (from FreeType 1.x) instead of
the correct one, /usr/include/freetype2/freetype/freetype.h (from FreeType
2).
This causes a compile failure.
Reproduce code:
---------------
Install RPMs "openssl-0.9.6m-1" and "openssl-devel-0.9.6m-1" (or later)
from http://www.bullfreeware.com/listaix52.html.
Configure PHP 5 with the following directives (from config.nice):
CPPFLAGS='-I/usr/local/include' \
LDFLAGS='-L/lib -L/opt/freeware/lib -L/usr/local/lib' \
CC='/usr/local/bin/gcc' \
'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-dba' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-debug' \
'--enable-filepro' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-mbstring' \
'--enable-memory-limit' \
'--enable-versioning' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-apxs2filter=/apache/bin/apxs' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-inifile' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir' \
'--with-mime-magic' \
'--with-mnogosearch' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-tiff-dir' \
'--with-ttf' \
'--with-xpm-dir' \
'--with-zlib' \
'--with-zlib-dir'
Notice the "--with-openssl" path and "--with-freetype-dir".
Compile with 'make'.
Expected result:
----------------
Compilation success.
Actual result:
--------------
Excerpt from 'make':
...
/usr/local/bin/gcc -I/usr/local/src/php-5.0.0/ext/gd/libgd -DHAVE_LIBPNG
-DHAVE_LIBJPEG -DHAVE_XPM -DHAVE_LIBFREETYPE -DJISX0208 -Iext/gd/
-I/usr/local/src/php-5.0.0/ext/gd/ -DPHP_ATOM_INC
-I/usr/local/src/php-5.0.0/include -I/usr/local/src/php-5.0.0/main
-I/usr/local/src/php-5.0.0 -I/usr/local/src/php-5.0.0/Zend
-I/opt/freeware/include/libxml2 -I/opt/freeware/include
-I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/local/include
-I/usr/local/src/php-5.0.0/ext/mbstring/oniguruma
-I/usr/local/src/php-5.0.0/ext/mbstring/libmbfl
-I/usr/local/src/php-5.0.0/ext/mbstring/libmbfl/mbfl
-I/usr/local/mnogosearch/include -I/usr/local/mysql/include/mysql
-I/usr/local/include -I/usr/local/src/php-5.0.0/TSRM -g -Wall -c
/usr/local/src/php-5.0.0/ext/gd/gd.c -DPIC -o ext/gd/gd.lo
/usr/local/src/php-5.0.0/ext/gd/gd.c: In function `zm_info_gd':
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: `FREETYPE_MAJOR'
undeclared (first use in this function)
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: (Each undeclared
identifier is reported only once
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: for each function it
appears in.)
/usr/local/src/php-5.0.0/ext/gd/gd.c:487: error: `FREETYPE_MINOR'
undeclared (first use in this function)
/usr/local/src/php-5.0.0/ext/gd/gd.c: At top level:
/usr/local/src/php-5.0.0/TSRM/tsrm_virtual_cwd.h:182: warning:
`php_realpath_hack' defined but not used
make: The error code from the last command is 1.
Stop.
--
Edit bug report at http://bugs.php.net/?id=29190&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29190&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29190&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29190&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29190&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29190&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29190&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29190&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29190&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29190&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29190&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29190&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29190&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29190&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29190&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29190&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29190&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29190&r=float