Previous 1 2 Next 29 Replies Latest reply: Oct 14, 2012 3:03 PM by etresoft
garberal Level 1 Level 1
Hello,

I am trying to get Freetype support for GD. When I run gdlib-config --all, it returns:

GD library 2.0.34
includedir: /usr/include
cflags: -I/usr/include
ldflags:
libs: -lpng -lz -liconv
libdir: /usr/lib
features: GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON


...indicating no support for Freetype. Does anyone have information on how to recompile gdlib on Snow Leopard?


Thanks!

Andrew

Macbook Pro Intel Core i7, Mac OS X (10.6.7)
Solved by etresoft on Apr 15, 2011 10:34 AM Solved
First of all - a question. What have you already installed? The only gd I have is the bundled one from PHP. I don't have any gdlib-config at all. The instructions below assume there isn't any standalone gd installed on your system.

OK. Here is what you do:

1) Download the source for libgd from: https://bitbucket.org/pierrejoye/gd-libgd/overview
2) Extract the tar ball
3) Edit the file src/configure.ac and remove the 4 lines that start with 'AM_ICONV'
4) Go into the src directory and run: "ln -s ../config config" and "ln -s ../test test"
5) Now (still in src) run "sh bootstrap.sh"
6) Now (still in src) run "autoreconf -fvi"
(Hopefully you have had no errors by this point)
7) Now (still in src) run "./configure"

On my machine, I am running 10.6.7 with Xcode3 and Xcode4 installed. In the past, I have installed a fair number of funky Perl modules. After running "./configure", my system reports:

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

If yours doesn't say the same thing, you may have to go back and install some prerequisites.

8) Run "make"
9) Run "sudo make install"

At this point, you have a standalone libgd installed in /usr/local. If you build all of your Perl modules, they should find that automatically. I don't know what GD they found before.
  • Linc Davis Level 10 Level 10
    expertise.applications
    Applications
  • etresoft Level 7 Level 7
    I don't think this is one that macports can fix. The reasons behind freetype being missing are more complex. This thread: http://discussions.apple.com/message.jspa?messageID=12512596
    has a lot of good links for more information.
  • garberal Level 1 Level 1
    Thanks for the quick reply.

    I followed the link and the install seems beyond the scope of my abilities. Is it something that can be resolved by reverting to an older version of OSX or switching to Unix?
  • Linc Davis Level 10 Level 10
    expertise.applications
    Applications
    I have port gd2 installed, version 2.0.35, and it supports freetype. I don't know exactly what it does, but it certainly builds. Why is that not a solution to the OP's problem?
  • Linc Davis Level 10 Level 10
    expertise.applications
    Applications
    Mac OS X is UNIX. Reverting to an older version is inadvisable, and depending on your hardware, may be impossible.

    MacPorts is a lot easier than tinkering with makefiles and tracking down dependencies to get some random piece of code to build.

    Maybe if you explain what the ultimate goal is, someone will be better able to help you.
  • garberal Level 1 Level 1
    The goal is to work with a visualization software called Circos: http://mkweb.bcgsc.ca/circos/
    I have all of the requisite Perl modules installed, but when I run a diagnostic test on GD, a picture results, but there is no text where there should be.

    I was told that indicates that my install of GD (2.45) does not support Freetype. The suggested solution was to recompile my gdlib, since it was not compiled with Freetype.
  • Linc Davis Level 10 Level 10
    expertise.applications
    Applications
    There is no built-in gdlib. Where did you get it?
  • etresoft Level 7 Level 7
    Linc Davis wrote:
    I have port gd2 installed, version 2.0.35, and it supports freetype. I don't know exactly what it does, but it certainly builds. Why is that not a solution to the OP's problem?


    Does it work? From what I understand, Freetype supports MacOSX fonts, but that logic is incompatible with other parts of GD and/or PHP. So, in order to build it for GD and PHP on MacOSX, you have to disable the MacOSX font logic and build it with support for only X11 fonts. If you are aware of that and don't expect to be able to use your system fonts, it should work fine.
  • garberal Level 1 Level 1
    Linc, I downloaded it from here: https://bitbucket.org/pierrejoye/gd-libgd/overview

    etresoft, if it means losing my system fonts, that may not be a tradeoff I'm willing to take. I need fonts for the type of work I do.
  • etresoft Level 7 Level 7
    garberal wrote:
    etresoft, if it means losing my system fonts, that may not be a tradeoff I'm willing to take. I need fonts for the type of work I do.


    You have fonts, they are just the X11 fonts. That is usually adequate for things people use GD and PHP for. Still, it might be worth trying to compile it again. It may have had improvements since the last time I looked at it.
  • garberal Level 1 Level 1
    Thanks for the help. If I need to go through those steps from the link you sent earlier, by modifying PHP and Apache, I'll probably break my computer.
  • etresoft Level 7 Level 7
    garberal wrote:
    Thanks for the help. If I need to go through those steps from the link you sent earlier, by modifying PHP and Apache, I'll probably break my computer.


    That is a a possibility. You can install a new, self-contained Apache/PHP/etc. with XAMPP: http://www.apachefriends.org/en/xampp-macosx.html

    That is probably the easiest, least invasive way to get GD running with freetype support.

    MacPorts will work too. It does something similar to XAMPP, only it isn't as self-contained. It will squirrel away new versions of PHP and maybe Apache in /opt or somewhere.

    Neither method will replace any built-in software. XAMPP is definitely more self-contained.
  • Linc Davis Level 10 Level 10
    expertise.applications
    Applications
    Why not use the online version of the program on the site you linked to? That means no installation, versus a very difficult, advanced installation that you wouldn't know how to maintain, even if you ever got it working.
  • etresoft Level 7 Level 7
    garberal wrote:
    The goal is to work with a visualization software called Circos: http://mkweb.bcgsc.ca/circos/
    I have all of the requisite Perl modules installed, but when I run a diagnostic test on GD, a picture results, but there is no text where there should be.


    Wait. You aren't trying to run PHP. You are trying to use GD by itself with Perl. That is an entirely different matter.

    I was told that indicates that my install of GD (2.45) does not support Freetype. The suggested solution was to recompile my gdlib, since it was not compiled with Freetype.


    Unfortunately, GD seems to be a truly horrible, unsupported, and unmaintained library. It doesn't even have a web site and about the only way to get it is as part of PHP. Let me see what I can do with it...
Previous 1 2 Next