Building FOX on OS X with Xft support

View: New views
7 Messages — Rating Filter:   Alert me  

Building FOX on OS X with Xft support

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,

I've just been through the exercise of figuring out how to build FOX  
with Xft support on OS X (Snow Leopard) and so I wanted to briefly  
report on the magical incantation required to pull it off. If I am  
late to the party and everyone else has already figured it out,  
apologies in advance for the wasted bandwidth. ;)

On Linux, and maybe some other operating systems, you can just pass  
the "--with-xft" switch to the configure script and it will turn on  
the required compiler and linker flags for Xft support. The problem on  
OS X is that while libXft and friends are part of the operating  
system, the configure script that's included with both fox-1.6.36 and  
fox-1.7.20 assumes that if you have Xft installed, that you'll also  
have the pkg-config tool installed. This is not the case on OS X, so  
we have to work around it by passing in the required compiler and  
linker flags ourselves:

        env CFLAGS="-I/usr/X11/include -I/usr/X11/include/freetype2 -
DHAVE_XFT_H" \
                CXXFLAGS="-I/usr/X11/include -I/usr/X11/include/freetype2 -
DHAVE_XFT_H=1" \
                LDFLAGS="-L/usr/X11/lib -lXft -lfontconfig -lfreetype" \
                ./configure --with-x --with-opengl --enable-cups

Note that we don't pass the "--with-xft" switch to configure, but  
instead plug the needed flags into CFLAGS, CXXFLAGS and LDFLAGS.

Hope this helps,

Lyle

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Building FOX on OS X with Xft support

by Anders F Björklund :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lyle Johnson wrote:

> On Linux, and maybe some other operating systems, you can just pass
> the "--with-xft" switch to the configure script and it will turn on
> the required compiler and linker flags for Xft support. The problem on
> OS X is that while libXft and friends are part of the operating
> system, the configure script that's included with both fox-1.6.36 and
> fox-1.7.20 assumes that if you have Xft installed, that you'll also
> have the pkg-config tool installed. This is not the case on OS X, so
> we have to work around it by passing in the required compiler and
> linker flags ourselves:

At least on earlier OS versions, you could (alternatively) just install
pkg-config and it would find /usr/X11/lib/pkgconfig/xft.pc and friends.

But like you mention it's also possible to copy/paste the needed flags
from the .pc files in this case, they're not too many to copy/paste...

--anders



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Building FOX on OS X with Xft support

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 22, 2009, at 1:46 AM, Anders F Björklund wrote:

> Lyle Johnson wrote:
>
>> On Linux, and maybe some other operating systems, you can just pass
>> the "--with-xft" switch to the configure script and it will turn on
>> the required compiler and linker flags for Xft support. The problem  
>> on
>> OS X is that while libXft and friends are part of the operating
>> system, the configure script that's included with both fox-1.6.36 and
>> fox-1.7.20 assumes that if you have Xft installed, that you'll also
>> have the pkg-config tool installed. This is not the case on OS X, so
>> we have to work around it by passing in the required compiler and
>> linker flags ourselves:
>
> At least on earlier OS versions, you could (alternatively) just  
> install
> pkg-config and it would find /usr/X11/lib/pkgconfig/xft.pc and  
> friends.

Yes, that ought to work too. It is curious to me that Apple decided to  
include the pkg-config files but not the pkg-config tools itself. I  
wonder what the thinking was there; maybe it was just an oversight?
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: Building FOX on OS X with Xft support

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 22, 2009, at 1:56 AM, Anders F Björklund wrote:

>> I've just been through the exercise of figuring out how to build FOX
>> with Xft support on OS X (Snow Leopard) and so I wanted to briefly
>> report on the magical incantation required to pull it off. If I am
>> late to the party and everyone else has already figured it out,
>> apologies in advance for the wasted bandwidth. ;)
>
> The problem has been there "for a while", attaching the most recent
> patch I could find that was submitted upstream sometime 2006/2007...
>
> I suppose it *could* be adopted for the Leopards, if one wanted FOX
> to build out-of-the-box on Mac OS X (which doesn't seem a priority)

I could have sworn we had discussed this on the list before, but when  
I went to search my archives I was only finding things related to FOX  
with Xft on Linux.

I haven't tried applying this patch to fox-1.6.36, but just  
"eyeballing" it, it looks like the right thing. I agree that it would  
be really nice if this could be added.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Building FOX on OS X with Xft support

by Anders F Björklund :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lyle Johnson wrote:

>> At least on earlier OS versions, you could (alternatively) just
>> install
>> pkg-config and it would find /usr/X11/lib/pkgconfig/xft.pc and
>> friends.
>
> Yes, that ought to work too. It is curious to me that Apple decided to
> include the pkg-config files but not the pkg-config tools itself. I
> wonder what the thinking was there; maybe it was just an oversight?

It could be a license thing ?

Anyway, it should be doable enough to get pkg-config and install it
with --prefix=/opt/pkgconfig or something to not have it in the way.

http://pkg-config.freedesktop.org/

--anders


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Building FOX on OS X with Xft support

by Anders F Björklund :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I haven't tried applying this patch to fox-1.6.36, but just
> "eyeballing" it, it looks like the right thing. I agree that it would
> be really nice if this could be added.

Well, minus all the hardcoded /usr/X11R6 paths and other such hacks.
Does that even work on Snow Leopard ? (It was a symlink on Leopard...)
But something similar, that would cope with pkg-config being missing ?

--anders


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: Building FOX on OS X with Xft support

by Sander Jansen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 22, 2009 at 8:25 AM, Lyle Johnson <lyle@...> wrote:

>
> On Oct 22, 2009, at 1:46 AM, Anders F Björklund wrote:
>
>> Lyle Johnson wrote:
>>
>>> On Linux, and maybe some other operating systems, you can just pass
>>> the "--with-xft" switch to the configure script and it will turn on
>>> the required compiler and linker flags for Xft support. The problem
>>> on
>>> OS X is that while libXft and friends are part of the operating
>>> system, the configure script that's included with both fox-1.6.36 and
>>> fox-1.7.20 assumes that if you have Xft installed, that you'll also
>>> have the pkg-config tool installed. This is not the case on OS X, so
>>> we have to work around it by passing in the required compiler and
>>> linker flags ourselves:
>>
>> At least on earlier OS versions, you could (alternatively) just
>> install
>> pkg-config and it would find /usr/X11/lib/pkgconfig/xft.pc and
>> friends.
>
> Yes, that ought to work too. It is curious to me that Apple decided to
> include the pkg-config files but not the pkg-config tools itself. I
> wonder what the thinking was there; maybe it was just an oversight?

You don't need pkg-config to install package specific pkg-config
files. I'm sure they didn't even notice these files were installed as
part of each package...


> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Foxgui-users mailing list
> Foxgui-users@...
> https://lists.sourceforge.net/lists/listinfo/foxgui-users
>



--
"And any fool knows a dog needs a home
A shelter from pigs on the wing"

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users