difficulty cross-compiling on Leopard for Tiger

Ryan Schmidt ryandesign at macports.org
Thu May 22 21:07:01 PDT 2008

On May 22, 2008, at 14:55, Zachary Fine wrote:

> I'm trying to cross-compile php5, lighttpd, and mysql5 on a MacBook
> Pro running OS X 10.5.2, and I plan to transfer the resulting binaries
> over to run on my AppleTV box. The AppleTV runs a slimmed-down version
> of OS 10.4 Tiger, and seems to run <10.4.8 binaries just fine. Running
> 'uname -a' on my AppleTV box results in the following output:
> Darwin AppleTV.local 8.8.2 Darwin Kernel Version 8.8.2: Mon Jan 29
> 18:57:29 PST 2007; root:xnu-792.94.18~1/RELEASE_I386 i386 i386
> I first tried just copying the lighttpd and php5 that I'd compiled on
> my Leopard MacBook Pro over to the AppleTV and running them, but the
> binaries are incompatible:
>> bash-2.05b$ ./php-cgi
>> dyld: unknown required load command 0x8000001C
>> Trace/BPT trap
> Through a process of research, trial and error, I made the following
> adjustments to macports.conf and variants.conf.
> I added the following lines to 'macports.conf':
> universal_target       10.4
> universal_sysroot      /Developer/SDKs/MacOSX10.4u.sdk
> mmacosx-version-min    10.4
> and the following to variants.conf:
> +darwin_8 +i386 +universal
> I uninstalled all ports, and was able to get my lighttpd and mysql5 to
> install (using the command "sudo port install lighttpd +cml +davprops
> +mysql5 +ssl") but php refuses to compile:
>> [zachmbp:~] zach% sudo port install php5 +fastcgi +imap +macosx
>> +mysql5 +pcntl +pear +sqlite +tidy
>> Error: Error executing universal: Default universal variant only
>> works with ports based on configure
>> Error: Unable to execute port: Error evaluating variants
> I'm tempted to just give up on my cross-compilation effort, set up
> 10.4.8 on a partition on a firewire drive, and compile using macports
> on that. But it feels like it should be possible to get this working,
> and I don't really want to have to keep 10.4.8 around any time I need
> to compile something for an older system.

This exercise is of course completely unsupported. Compiling on one  
major Mac OS X release for use on another major Mac OS X release is  
not supported by MacPorts, and MacPorts isn't supported at all on  
AppleTV, which is not (according to Apple definitions anyway) a Mac.

However, I applaud your efforts thus far, and you're clearly on the  
right track. The error message you're getting is also, I should point  
out, not coming from php5, which is based on configure and builds  
universal just fine. Some other port is complaining (maybe one of the  
ones necessary for the imap, pcntl, pear, or tidy variants.... those  
I haven't tested much). To find out which one, try using the debug  
flag ("sudo port -d install php5 ........"). That should make it more  
clear which non-configure port doesn't have a universal variant.  
Maybe then we can add one to make a universal build of that port  

More information about the macports-dev mailing list