Changes between Version 1 and Version 2 of UsingTheRightCompiler


Ignore:
Timestamp:
Jun 4, 2009, 5:50:18 AM (15 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add section on detecting ports that aren't using ${configure.cc} et al

Legend:

Unmodified
Added
Removed
Modified
  • UsingTheRightCompiler

    v1 v2  
    107107possibly in combination with setting ${build.env} as above.
    108108Such patches should usually be sent upstream for inclusion in the next version of the software.
     109
     110
     111= How to test = #testing
     112
     113Unless you look closely at the build output in debug mode,
     114it can be hard to know whether a port is using ${configure.cc} as it should.
     115Here is one strategy that can be used:
     116
     117 1. Create a directory /opt/local/bin/no_default_gcc
     118 2. Create a script in that directory called "`cc`" that always prints an error message
     119 3. Create symlinks "`c++`", "`cpp`", "`g++`", and "`gcc`", all pointing to the "`cc`" script
     120 4. Edit the value of "binpath" in /opt/local/etc/macports/macports.conf so that it begins with "/opt/local/bin/no_default_gcc:"
     121
     122Now anytime a port tries to use one of these unversioned programs, the compile will stop with an error.
     123
     124Steps 1 through 3 can be done
     125by checking out [browser:users/ryandesign/no_default_gcc this directory]
     126from the MacPorts Subversion repository:
     127
     128{{{
     129svn checkout \
     130http://svn.macosforge.org/repository/macports/users/ryandesign/no_default_gcc \
     131/opt/local/bin/no_default_gcc
     132}}}
     133
     134If you encounter a port which triggers this error
     135but you don't want to fix it immediately,
     136you can bypass it by editing macports.conf
     137and removing "/opt/local/bin/no_default_gcc:" from the "binpath" again.