Search code examples
macosperlosx-snow-leopardtk-toolkit

Compiling perl-tk with xft support on Mac OSX Snow Leopard


I am trying to compile perl-tk with XFT support on a Mac OS X 10.6.8, but running into some problems.

The first is that running

perl Makefile.PL XFT=1

yields the following output (in summary the freetype.h header cannot be found, and the XFT argument is not recognized):

macmini:Tk-804.030 sjurisic$ perl Makefile.PL XFT=1
perl is installed in /usr/local/ActivePerl-5.8/lib okay
PPM for perl5.008009
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c
Test Compiling config/regexp511.c
Test Compiling config/signedchar.c
Test Compiling config/Ksprintf.c
Test Compiling config/svtrv.c
Test Compiling config/tod.c
Test Compiling -DTIMEOFDAY_TZ config/tod.c
TZ gettimeofday()
Using -L/usr/X11R6/lib to find /usr/X11R6/lib/libX11.dylib
Using -I/usr/X11R6/include to find /usr/X11R6/include/X11/Xlib.h
Cannot find freetype.h include file
WARNING: DISTVNAME is not a known parameter.
'DISTVNAME' is not a known MakeMaker parameter name.
'XFT' is not a known MakeMaker parameter name.

Solution

  • You can try to adjust myConfig in the Perl/Tk distribution to add additional search paths for the freetype includes. This would be the line

    my $ftinc = Ift("/usr/include","/usr/local/include",$X11INC||());
    

    where you can add "/usr/X11/include".

    If the libXft.so does not live in /usr/local/lib or any other standard library path, then you probably need to adjust the my $ftlib = definition a few lines below, too.

    Regardless if you're successful or not, this is worth a ticket in https://rt.cpan.org/Ticket/Create.html?Queue=Tk

    BTW, in Tk 804.031 XFT=1 is set by default, so you don't have to specify it anymore in the perl Makefile.PL call. And the warning about 'XFT' is not a known MakeMaker parameter name. is just a MakeMaker artifact and may be ignored.