Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-user@g.o, gentoo-dev@g.o
From: Philipp Hasse <dream-weaver@...>
Subject: Automatically replace -mtune= with -mcpu= if not supported by gcc?!
Date: Sun, 17 Apr 2005 15:50:44 +0200
Hi,

I recently noticed that portage executes the file bashrc located in
/etc/portage before every ebuild.
This way it can be used to set the -mcpu and -mtune flags correctly.
If you add the following to this file everything goes automatically:

<--- SNIP --->
# Automatically replace -mtune= with -mcpu if not supported by gcc
# and vice versa.
echo "" | gcc -mtune=i386 -E - > /dev/null 2> /dev/null
if [ $? == 0 ]; then
export CFLAGS=`echo $CFLAGS | /bin/sed 's/-mcpu=/-mtune=/'`
export CXXFLAGS=`echo $CXXFLAGS | /bin/sed 's/-mcpu=/-mtune=/'`
else
export CFLAGS=`echo $CFLAGS | /bin/sed 's/-mtune=/-mcpu=/'`
export CXXFLAGS=`echo $CXXFLAGS | /bin/sed 's/-mtune=/-mcpu=/'`
fi
<--- SNIP --->

Maybe someone can give me a feedback if this is good idea or if I missed
something for some exotic situation this will fail.

Why doesn't portage do this automatically by itself? If it encounters an
-mtune“= option in make.conf and gcc doesn't support it it replaces it
with -mcpu=?!

Regards
Philipp Hasse

-- 
gentoo-dev@g.o mailing list

Replies:
Re: Automatically replace -mtune= with -mcpu= if not supported by gcc?!
-- Paul de Vrieze
Re: Automatically replace -mtune= with -mcpu= if not supported by gcc?!
-- Mike Frysinger
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
net-irc/xchat-xsys: Test request for ~x86 & ~amd64
Next by thread:
Re: Automatically replace -mtune= with -mcpu= if not supported by gcc?!
Previous by date:
net-irc/xchat-xsys: Test request for ~x86 & ~amd64
Next by date:
Re: New developer: Herbie Hopkins (Herbs)


Updated Jun 17, 2009

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.