Mac OSX10.5.6でPHP5.2.9をコンパイルしています。これを理解するためにいくつかの助けが必要です。
PHPをコンパイルして基本構成を操作していますが、GD2でコンパイルしようとしています。私が遭遇している問題は、Freetypeでビルドするための引数を追加すると、ビルドエラーが発生することです。これは、問題をデモするための私の最小構成です。また、libjpeg / libpngなどには他にも要件があることは知っています。これを簡単にするために、現時点ではそれらを含めていません。
sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/conf/php \
--enable-fastcgi \
--with-freetype-dir=/usr/local \
--with-gd
エラー:
checking for FT_New_Face in -lfreetype... no
configure: error: Problem with freetype.(a|so). Please check config.log for more information.
これはエラーログからのものです:
configure:36779: gcc -o conftest -gstabs -no-cpp-precomp -Wl,-rpath,/usr/loca$
Undefined symbols:
"_FT_New_Face", referenced from:
_main in ccgzHTP6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 36768 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
--with-freetype-dir引数で定義したように、freelib-2.1.3をソースからビルドし、/ usr /local/にインストールしました。フォントファイルを見つけようとしていると言っていると思いますが、そのようなフォントがいつインストールされているのか、インストールされているのかはわかりません。
Freetypeなしでビルドすると、GD2がビルドおよびインストールされますが、システムにFreetype機能が必要です。以下は、Freetypeオプションを使用した完全な構成セットアップです(失敗しているものです!)
sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/conf/php --enable-fastcgi \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-zlib-dir=/usr/local \
--enable-gd-native-ttf \
--with-tlib=/usr/local \
--with-freetype-dir=/usr/local \
--with-xpm-dir=/usr/X11R6 \
--with-gd