GD with FreeType 2.x

Strange, when I do ./build GD it shows :


** Configuration summary for gd 2.0.28:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Xpm library: no
Support for pthreads: yes
 
gd
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

This is what it says.

I guess I meant GD+Freetype...... it is to get rid of the problems with the

Fatal error: Call to undefined function: imagefttext()

and

Fatal error: Call to undefined function: imagefttbox()

messages. I have a script that worked on another server and now it shows me this errors. It seems to me I have to install the freetype support then ?
 
To do that, you must compile gd with freetype support.

Do this :

Code:
cd /usr/local/directadmin/customapache/
wget [url]http://ovh.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gz[/url]
tar zxf freetype-2.1.9.tar.gz
cd freetype-2.1.9
./configure
make
make install

Freetype 2.x is now installed on /usr/local/lib directory

Now, modify the build script (./build) for compile GD with FreeType :
In function doGD replace
Code:
./configure --with-png=/usr/local --with-jpeg=/usr/local --without-freetype
by
Code:
./configure --with-png=/usr/local --with-jpeg=/usr/local --with-freetype=/usr/local

Now, build PHP WITH compile of GD (type Y at prompted)

Code:
./build php
and after do
Code:
service httpd restart

That's all. [/B]

:-(

gcc -g -O2 -o .libs/annotate annotate.o /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib ./.libs/libgd.so -ljpeg -lfreetype -lz -lm -Wl,--rpath -Wl,/usr/local/lib
./.libs/libgd.so: undefined reference to `pthread_mutex_unlock'
./.libs/libgd.so: undefined reference to `pthread_mutex_destroy'
./.libs/libgd.so: undefined reference to `pthread_mutex_lock'
./.libs/libgd.so: undefined reference to `pthread_mutex_init'
*** Error code 1

Stop in /usr/local/directadmin/customapache/gd-2.0.25.
*** Error code 1

Stop in /usr/local/directadmin/customapache/gd-2.0.25.
*** Error code 1

Stop in /usr/local/directadmin/customapache/gd-2.0.25.

*** The make has failed, do you want to try to make again? (y,n):


What to do?
 
mvveelen: I've seen in your phpinfo that you finally got it!

I'm having the same problem. I did everything and my phpinfo still does not show support for freetype.

Could you please explain how did you solve it? ...or anyone have an idea?


Thanks
 
Anyone know how to do this right? I've been trying for a while now. and its just not working at all for me.
 
Anyone get this?

I'm tearing my hair out over this. I can get GD to compile fine per the instructions. I can also compile php without a problem too, but freetype doesn't show up in phpinfo().

The proper configuration directives do show up however. Anyone who figured this out willing to share their secret?

Thanks,
Steve
 
Still nothing eh? I am still having problems because of the freetype2. I got it on one machine and stupid me.... I didn't write down what it was.

Still getting this:
./.libs/libgd.so: undefined reference to `pthread_mutex_unlock'
./.libs/libgd.so: undefined reference to `pthread_mutex_destroy'
./.libs/libgd.so: undefined reference to `pthread_mutex_lock'
./.libs/libgd.so: undefined reference to `pthread_mutex_init'
Then make dies.
 
What OS are you using?

Googling one of your error lines returns a lot of hits; all of them appear to be for FreeBSD.

Jeff
 
Sorry my bust. I didn't know any other OS got pthreads errors. ;-)

Just upgraded DA to the latest, rebuilt freetype, png, jpeg, and trying to upgrade GD.

FreeBSD 4.10
freetype2-2.1.7_4
png-1.2.5_6
jpeg-6b_3
gd-2.0.22,1
 
Got it and will document it here as well as in my docs. Freetype2 seems to install a limited version of the X libraries. Because of this there probably arises a dependency issue when trying to install GD with Freetype without xpm. None the less the following configure works with Freetype.

./configure --with-jpeg=/usr/local --with-png=/usr/local

This allowed config to auto detect the appropriate settings:

** Configuration summary for gd 2.0.33:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: yes
Support for pthreads: yes

Again using --without-x didn't work if using --with-freetype. Without both works and with both works but no other combination.

Big Wil
 
Can't install it here either,

Everything goes well, settings included in the build file, I can build without getting any errors (and it tells that there is FreeType support), but it doesn't work..

'./configure' '--with-apxs' '--with-curl' '--with-curl-dir=/usr/local/lib' '--with-gd' '--with-gd-dir=/usr/local/lib' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-kerberos' '--with-mcrypt' '--with-mhash' '--with-mysql' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-xml' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-zip' '--with-openssl' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-track-vars'

No freetype there..

Does anyone have an idea why PHP won't compile with Freetype?
 
I don't consider myself an expert...

I got these instructions from the web host where some of my other sites are located (they owed me a favor)

Go and download the newest, stable version of FreeType2:

http://freetype.sourceforge.net/

While logged in as root on the server, with a copy of the archive for
FT2, gunzip/untar it and change to the directory and type:

./configure --prefix-/usr

make

make install

After that's complete, while compiling PHP w/ the options, add the
following to the configure line, along with your other options:

--with-freetype-dir=/usr

I followed them to the letter and it worked the first time.

Good luck!
 
That's just the problem, PHP doesn't want to compile, any changes I make (both in build and configure.php) aren't working, phpinfo() keeps showing the same thing..

How can I compile PHP with new settings?..
 
Got it! :) After installing freetype, execute these commands:

Code:
./build clean
./build php

And it will work :)

Peter
 
Thank you, I never thought to look in the build script itself. I personally built freetype2 from the freebsd ports tree, then all I had to do was convince da that it was there by modifying the build script :p
 
Back
Top