Which GCC does macports use?

Ryan Schmidt ryandesign at macports.org
Sun Apr 4 09:51:57 PDT 2010


On Apr 4, 2010, at 08:41, Ctalk Project wrote:

> I installed macports (OS X 10.4) and then installed and built the gcc44 package without
> any issues.  Per the macports installation, I guess, /opt/local/bin is now in the path, so the
> macports GCC is the compiler in general use,

Only if you've used gcc_select to select that version. Otherwise, the Apple gcc provided with Xcode will be the one in general use.

> and for non-macports sources it works okay.
> 
> When trying to build further macports packages, however, I get errors like the following:
> 
> checking for gcc... /usr/bin/gcc-4.0
> checking for C compiler default output... configure: error: C compiler cannot create executables
> Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_ncursesw/work/ncurses-5.7" && ./configure --prefix=/opt/local --enable-widec --disable-rpath --with-shared --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --mandir=/opt/local/share/man --with-manpage-format=normal " returned error 77
> DEBUG: Backtrace: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_ncursesw/work/ncurses-5.7" && ./configure --prefix=/opt/local --enable-widec --disable-rpath --with-shared --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --mandir=/opt/local/share/man --with-manpage-format=normal " returned error 77
>    while executing
> "$procedure $targetname"
> 
> In short, the macports installer still wants to use the Xcode GCC in /usr/bin.  If it matters, here is
> the value of $PATH after installing macports:
> 
> ctalk-projects-powerbook-g4:/ root# echo $PATH
> /opt/local/bin:/opt/local/sbin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/gcc-current/bin:/usr/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
> ctalk-projects-powerbook-g4:/ root#
> 
> So how do I tell macports to use the newly installed compiler?

You don't. MacPorts will use the Xcode provided by gcc. This is by design. It would be a testing nightmare if users were allowed to select their own compiler. We don't have the resources to support that.



More information about the macports-users mailing list