blog.up-link.ro
16Sep/100

FreeBSD Optimizations: /etc/make.conf

The file make.conf contains system-wide settings that will apply to every build using make and the standard sys.mk file. The purpose of make.conf is to control the compilation of the FreeBSD sources, documentation, and ports.

The system build procedures occur in the following areas: the world, the kernel, documentation and ports. Variables set in make.conf may be applicable in one, two, or all four of these areas. In addition, control variables can be specified for a particular build via the -D option of make or in environment.

Here is a typical make.conf :

CPUTYPE?=nocona
CFLAGS=-O2 -pipe -fno-strict-aliasing
COPTFLAGS=-O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
KERNCONF=BSD GENERIC
OPTIMIZED_CFLAGS=YES
WITHOUT_X11=YES
BUILD_OPTIMIZED=YES
WITH_CPUFLAGS=YES
WITH_OPTIMIZED_CFLAGS=YES
WITHOUT_DEBUG=YES
BUILD_STATIC=YES
NO_PROFILE=YES
NO_INET6=YES

CPUTYPE specifies your processor type so that the compiler will produce the optimized binary code for your specific processor as well as modifying the value of CFLAGS and COPTFLAGS to contain the appropriate optimization directive to gcc.

A list of supported processors can be found in the default make.conf file in /usr/share/examples/etc/make.conf.
Currently the following CPU types are recognized:

Intel x86 architecture :
AMD CPUs :
opteron athlon64 athlon-mp athlon-xp athlon-4 athlon-tbird athlon k8 k6-3 k6-2 k6 k5
Intel CPUs :
core2 core nocona pentium4m pentium4 prescott pentium3m pentium3 pentium-m pentium2 pentiumpro pentium-mmx pentium i486 i386
Via CPUs :
c3 c3-2

Alpha/AXP architecture : ev67 ev6 pca56 ev56 ev5 ev45 ev4
AMD64 architecture :
opteron, athlon64, nocona, prescott, core2
Intel ia64 architecture
: itanium2, itanium

The CFLAGS variable indicates what parameters should be passed to gcc when compiling typical programs such as ports or when building the whole operating system (i.e. make buildworld ). The COPTFLAGS variables only applies to kernel builds.

The automatic setting of CFLAGS and COPTFLAGS may be overridden using the NO_CPU_CFLAGS and NO_CPU_COPTFLAGS variables.

The KERNCONF controls which kernel configurations will be built and installed. The first will be installed and used as the default kernel (BSD) .

Everything else here is some defaults to be used mostly for ports. They can be found by looking into ports Makefile or the default make.conf file.

BUILD_OPTIMIZED is set to enable compiler optimizations. Use it if you need speed.

BUILD_STATIC is set to build static versions of the binaries. Use it if you need even more speed.

WITHOUT_DEBUG is set to disable debug.

NO_PROFILE is set to avoid compiling profiled libraries.

The NO_INET6 setting is used to disable IPv6 networking for programs and libraries.

Keep in mind that anything you add to /etc/make.conf is also used every time you run make, so it is a good idea to set them to something sensible for your system.

Print This Post Print This Post
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


*

No trackbacks yet.