Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2005 15:57:56 -0500
From:      Russell Meek <russell@russellmeek.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: args to `make` within the ports tree
Message-ID:  <4384D7D4.7090102@russellmeek.net>
In-Reply-To: <20051123164714.GB1416@slackbox.xs4all.nl>
References:  <20051123153513.GE28686@ns2.wananchi.com>	<20051123155019.GB1370@dementia.beyondnormal.net> <20051123164714.GB1416@slackbox.xs4all.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Roland Smith wrote:

>On Wed, Nov 23, 2005 at 10:50:19AM -0500, Mike Hernandez wrote:
>  
>
>>On  Wed, Nov 23, 2005 at 06:35:13PM +0300, Odhiambo Washington wrote:
>>    
>>
>>>There appears to be so many arguments to `make` when compiling
>>>applications fro the ports tree.
>>>What beats me is where they are documented ;)
>>>      
>>>
>>/etc/make.conf?
>>    
>>
>
>Try /usr/ports/KNOBS for the most common ones, and the Makefile of each
>port for specific ones.
>
>Roland
>  
>


Many ports fail if you try to use extravagant make flags like what you 
would use with Gentoo.

The ones that I use for the most optimal performance are:

*CPUTYPE?=* (Enter your CPUTYPE here, ex. prescott, p4, etc.)
*CFLAGS= -O -PIPE*
*COPTFLAGS= -O -PIPE*

Place a space between the *=* and your options.

These are systemwide commands that all ports will use during the build 
process.

*CPUTYPE?=*

An command for applications to be built with code optimizations for your 
CPU type, refer to the FreeBSD handbook for the different types available. 
The most common entries are *p4* if you have a Generic Pentium 4 
(Northwood, etc) or *prescott* if you are using a P4 Prescott model 
processor.

There are many for AMD also, these are listed in the handbook.

*CFLAGS= -O -PIPE*

Command optimizations for the GNU C compiler, -O and -PIPE I believe are 
standard for FreeBSD 6 Release, however I still include them in my 
Make.conf.  -O2 / -O3 are additional options you can use instead of -O, 
however it is not recommended.  I have used -O2 without any issues when 
building from ports, however I have noticed no difference between -O and 
-O2.

*-O* sets the optimization level, in this case 1.

*- PIPE* causes code to be passed between processes using pipes during 
compilation rather than using temporary files, which has obvious I/O 
advantages.

*COPTFLAGS= -O -PIPE*

Optimizational flags used when compiling your kernel, again I stick to 
what works -O and -PIPE.  I have noticed no breakage when using -O2, but 
then again I have noticed no performance increase on my servers either.

If you are just looking for some quick tweaks, these should set you on 
the right track.

Thanks,

Russell



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4384D7D4.7090102>