how to cross compile?

Ryan Schmidt ryandesign at
Fri Apr 1 01:27:16 PDT 2011

On Mar 31, 2011, at 22:56, Chris Murphy wrote:
> On Mar 30, 2011, at 8:26 AM, Rainer Müller wrote:
>> On 03/25/2011 08:30 AM, Chris Murphy wrote:
>>> I am on x86_64 Darwin 10.6. I need to compile smartmontools for PPC
>>> Darwin 9.
>>> If I change build_arch to ppc, the build fails presumably because I'm
>>> on Snow Leopard which doesn't support ppc. But I don't see an option
>>> in macports.conf to tell it to build for another platform.
>>> Suggestions?
>> You could try to set macosx_deployment_target in macports.conf which
>> will use the appropriate SDK if it does not match the current system.
>> But be aware that this is an unsupported option. Actually I never tried
>> it myself.
> I get this:
> :info:configure checking whether we are cross compiling... configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_smartmontools/work/smartmontools-5.40':
> :info:configure configure: error: cannot run C++ compiled programs.
> :info:configure If you meant to cross compile, use `--host'.
> So it seems like I need to track down the Portfile and set:
> platform darwin powerpc {
> 	configure.args-append \
> 		--host=ppc-apple-rhapsody-10.5
> }
> But this is not exactly clear from the example and lack of an options list. I'm not seeing a Tcl file related to this package at all, so I have no idea how to proceed.

I am not certain if you need to add --host. I frequently see the message "If you meant to cross compile, use `--host'" fly by when building ports universal, and there is no need to add the flag. If you do need to add a block to a portfile, the portfile's location can be easily obtained by running "port file smartmontools". Or you can display the portfile contents in the terminal by running "port cat smartmontools" or edit it with your editor by running "port edit smartmontools".

Note that Mac OS X's core operating system is called Darwin. (Rhapsody is what Mac OS X Server 1.x was based on, before Mac OS X 10.x and Mac OS X Server 10.x were available.)

More information about the macports-users mailing list