View Single Post
Old 7th May 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

CPUTYPE sets various flags for port and world compiles. It doesn't enable things like SSE for kernel compiles, though. The build system is smart enough to know what is safe for the kernel and what is safe for the world.

Until you set CFLAGS, that is. Then things can go haywire. If you use CFLAGS=whatever, then you are replacing the CFLAGS set in the build system. If you use CFLAGS+=whatever, then you append to the end of the CFLAGS line, again overriding anything set previously. If you use CFLAGS="whatever ${CFLAGS}" then you add your option in front of the defaults, and the defaults override your settings. Things can get pretty hairy.

And the default CFLAGS do change overtime (for instance, -O2 is the default now).

Better to set CPUTYPE, don't set CFLAGS, and just let the build system do its job.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote