From owner-freebsd-ports Mon Apr 8 16:44:22 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mailf.telia.com (mailf.telia.com [194.22.194.25]) by hub.freebsd.org (Postfix) with ESMTP id 59D9F37B400 for ; Mon, 8 Apr 2002 16:44:11 -0700 (PDT) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailf.telia.com (8.11.6/8.11.6) with ESMTP id g38Ni9k18513 for ; Tue, 9 Apr 2002 01:44:09 +0200 (CEST) Received: from falcon.midgard.homeip.net (h53n2fls20o913.telia.com [212.181.163.53]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id BAA25398 for ; Tue, 9 Apr 2002 01:44:08 +0200 (CEST) Received: (qmail 20725 invoked by uid 1001); 8 Apr 2002 23:44:08 -0000 Date: Tue, 9 Apr 2002 01:44:08 +0200 From: Erik Trulsson To: Peter Leftwich Cc: FreeBSD Questions , FreeBSD Ports Subject: Re: gcc -O -mcpu=i686 -howtooverride=486? Message-ID: <20020408234407.GA17303@student.uu.se> Mail-Followup-To: Peter Leftwich , FreeBSD Questions , FreeBSD Ports References: <20020408140315.J8518-100000@66-75-1-142.san.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020408140315.J8518-100000@66-75-1-142.san.rr.com> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message