Dirty hack to get cairo compiled universally

Ryan Schmidt ryandesign at macports.org
Sat Aug 2 22:44:28 PDT 2008


On Aug 1, 2008, at 15:13, Harry van der Wolf wrote:

> To get cairo compiled in macports using the correct SDK I used an  
> extremely dirty hack (See attached Portfile).
> The reason for this is that enabling '-isysroot $SDK_path' treats  
> all other includes as SDK relative path. I don't know how to get  
> around that, so I used a dirty hack (copied from http:// 
> dev.ultravelours.com/ports/enblend/) and symlinked the '/opt'  
> directory (default MacPorts installation prefix is the standard '/ 
> opt/local') from the SDK root directory (and deleted it later in  
> the process). You can find that in the attached portfile.
>
> See for the explanation at: http://lists.apple.com/archives/darwin- 
> dev/2006/Apr/msg00042.html

It's not acceptable for me for a portfile to modify the SDK by  
installing a symlink into it so I'll pass on this.

There are many tickets for many ports about the "all other includes  
treated as SDK-relative" issue. I spent hours the other night  
researching dozens of Google results. Seems like everyone has the  
problem, and either nobody solves it, or nobody posts the solution  
once they find it. It's very frustrating.


> The only other way to get cairo compiled universally is to change  
> the one line in the Portfile. It's the line:
> set my_cflags "${configure.cflags} -isysroot ${sysroot} $ 
> {my_arch_flag}"
>
> to
>
> set my_cflags "${configure.cflags} ${my_arch_flag}"
>
> That works too and is much simpler, but it does not give you the  
> possibility to choose your SDK (however when compiling i386 and  
> ppc, the MacOSX10.4u.sdk is always used, or isn't it)

It's not acceptable to omit the sysroot either. We must tell it which  
SDK to use. Otherwise it won't use any SDK and will use the OS  
libraries. This will not work on 10.4 PPC, where the OS is PPC-only.  
Also, in MacPorts trunk, the user has the option to configure which  
SDK they want in macports.conf. We must respect that setting.




More information about the macports-users mailing list