How to specify (default) compiler options and choose which compiler

Ceriel Jacobs cerieljacobs at gmail.com
Mon Feb 16 10:50:38 PST 2009


My goal is to build speed optimised binaries for 10.5 Core2Duo: -fast - 
march=nocona (-m64).

The -march=nocona requires gcc 4.2 or higher.
The default on MacOS is still gcc 4.0.
I know I can use ./port ... configure.compiler=gcc-4.2

Questions:
- how to specify gcc 4.2 *by default* within MacPorts?
- how to verify that binaries are actually build using gcc 4.2?

I am already using the +universal trick to specify default x86_64  
instead of the default i386/ppc.

Now I read macports documentation regarding setting compiler flags:  
configure.cflags defaults to -O2.

Questions:
- which configuration file should be modified to change the default - 
O2 to -fast?
- in case that is not possible, and it should be appended to the port  
command, how is that best done?
a. configure.cflags=-fast
or
b. configure.cflags-delete=-O2 configure.cflags-append=-fast (and for  
configure.ccflags-delete=-O2 configure.cxxflags-delete=-O2)

~Ceriel


More information about the macports-users mailing list