Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2002 01:44:08 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Peter Leftwich <Hostmaster@Video2Video.Com>
Cc:        FreeBSD Questions <FreeBSD-Questions@FreeBSD.Org>, FreeBSD Ports <FreeBSD-Ports@FreeBSD.Org>
Subject:   Re: gcc -O -mcpu=i686 -howtooverride=486?
Message-ID:  <20020408234407.GA17303@student.uu.se>
In-Reply-To: <20020408140315.J8518-100000@66-75-1-142.san.rr.com>
References:  <20020408140315.J8518-100000@66-75-1-142.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 08, 2002 at 02:14:58PM -0700, Peter Leftwich wrote:
> Today I have been immersing myself in the many splendors of "./configure"
> and "make" (which seems to create a Makefile that the user may edit before
> running...) "make install" and (sort of) gone are the old days of pkg_add
> -r!  This activity all came about as a result of my (so far trying to)
> upgrading w3m to the latest install, and along the way wishing to implement
> openssl and imlib.
> 
> My question is the following-- It seems like my /etc/make.conf file (which
> I think I either mv'ed or cp'ed from /usr/local/etc/make.conf) is getting
> ignored as far as the "CPUTYPE=i686" flag goes.  How do I remedy this?

Setting CPUTYPE in /etc/make.conf should work (and works fine for me)
provided that /etc/make.conf is included by the Makefile.  This is the
case when doing a make world or building programs using the ports
mechanism. /etc/make.conf is normally not used when one is building
programs "manually".

/usr/local/etc/make.conf shouldn't exist so I doubt you copied anything
from that place.
What you might be thinking of is /etc/defaults/make.conf which is
normally included before /etc/make.conf and gives default values for
various options.  Note that currently everything in
/etc/default/make.conf is commented out and thus doesn't really do
anything but it is still useful as a guide on what things one can set
in /etc/make.conf together with the manpage for make.conf(5).

> 
> I have been editing the various "Makefile" files, overriding the usual "-O
> -m486" with "-O -mcpu=i686" (what is -march by the way?) but my extended

Why bother with editing the makefiles?  It is usually possible to set
compileoptions using CFLAGS instead. This can either be set in
/etc/make.conf or, if one building programs by hand, sent as an extra
parameter to ./configure. 
Example:

CFLAGS="-O -mcpu=pentium" ./configure 


For programs not using some kind of configure script it will be
necessary to edit Makefiles directly but such programs are thankfully a
minority these days.

> question is the following-- Does the -mcpu flag that mean [paraphrase-ically]
> "use i686 instructions for the compile process" or does it mean "compile
> some binaries with i686 smartness built into them?"  Know-whuht-eye-mean?

-mcpu=xxx means "optimize for processor xxx but ensure that the
generated code can run on all CPUs in the family".  So -mcpu=i686 tells
the compiler to optimize for the P6 architecture but the generated code
can still run on anything from a 386sx to the latest Pentium 4.

-march=xxx means "optimize for procssor xxx and feel free to use
instructions unique to that particular processor"
-march=i686  means that the generated code will be optimized for a P6
and will probably not run on a 386.


Using -march can potentially result in faster code than using -mcpu but
with the drawback that the generated code might be able to run on all
machines.





-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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