From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j3HDocuc013710 for ; Sun, 17 Apr 2005 13:50:39 GMT Received: from pop.gmx.net ([213.165.64.20] helo=mail.gmx.net) by smtp.gentoo.org with smtp (Exim 4.43) id 1DNAAJ-0001fe-NE for gentoo-dev@lists.gentoo.org; Sun, 17 Apr 2005 13:50:24 +0000 Received: (qmail invoked by alias); 17 Apr 2005 13:50:43 -0000 Received: from port-212-202-181-147.dynamic.qsc.de (EHLO [192.168.2.2]) [212.202.181.147] by mail.gmx.net (mp023) with SMTP; 17 Apr 2005 15:50:43 +0200 X-Authenticated: #13596455 Message-ID: <426269B4.6080503@gmx.net> Date: Sun, 17 Apr 2005 15:50:44 +0200 From: Philipp Hasse User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org, gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] Automatically replace -mtune= with -mcpu= if not supported by gcc?! Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-Archives-Salt: 81262742-3a1a-457c-8df1-da28a4eb7582 X-Archives-Hash: 04b61d566fd707ed31cd333c3f85ccee 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@gentoo.org mailing list