summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Griffis <agriffis@gentoo.org>2005-07-02 03:19:12 +0000
committerAron Griffis <agriffis@gentoo.org>2005-07-02 03:19:12 +0000
commit3394ee00c8d78814f776d3a1405b7065e478bcc2 (patch)
treecdaeb3ce643cabc898cc99a3433feb4c5ebd385e /eclass/makeedit.eclass
parentStable on mips (diff)
downloadgentoo-2-3394ee00c8d78814f776d3a1405b7065e478bcc2.tar.gz
gentoo-2-3394ee00c8d78814f776d3a1405b7065e478bcc2.tar.bz2
gentoo-2-3394ee00c8d78814f776d3a1405b7065e478bcc2.zip
Don't append to CFLAGS in global scope #56409
Diffstat (limited to 'eclass/makeedit.eclass')
-rw-r--r--eclass/makeedit.eclass44
1 files changed, 18 insertions, 26 deletions
diff --git a/eclass/makeedit.eclass b/eclass/makeedit.eclass
index 061813743c5b..6691e66eb478 100644
--- a/eclass/makeedit.eclass
+++ b/eclass/makeedit.eclass
@@ -1,38 +1,30 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.7 2004/10/19 19:51:12 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.8 2005/07/02 03:19:12 agriffis Exp $
#
# Author: Spider
#
-# makeedit eclass, will remove -Wreturn-type and -Wall from compiling,
-# this will reduce the RAM requirements.
+# To use this eclass, do 2 things:
+# 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do
+# the append-flags afterward, otherwise you'll lose them.
+# 2. after running configure or econf, call edit_makefiles to remove
+# extraneous CFLAGS from your Makefiles.
+#
+# This combination should reduce the RAM requirements of your build, and maybe
+# even speed it up a bit.
-# Debug ECLASS
ECLASS="makeedit"
INHERITED="$INHERITED $ECLASS"
-export CFLAGS="${CFLAGS} -Wno-return-type -w"
-export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"
+MAKEEDIT_FLAGS="-Wno-return-type -w"
-edit_makefiles () {
+edit_makefiles() {
+ # We already add "-Wno-return-type -w" to compiler flags, so
+ # no need to replace "-Wall" and "-Wreturn-type" with them.
einfo "Parsing Makefiles ..."
- find . -iname makefile | while read MAKEFILE
- do
- cp ${MAKEFILE} ${MAKEFILE}.old
- # We already add "-Wno-return-type -w" to compiler flags, so
- # no need to replace "-Wall" and "-Wreturn-type" with them.
- sed -e 's:-Wall::g' \
- -e 's:-Wreturn-type::g' \
- -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}
- rm -f ${MAKEFILE}.old
- done
- # Mozilla use .mk includes
- find . -name '*.mk' | while read MAKEFILE
- do
- cp ${MAKEFILE} ${MAKEFILE}.old
- sed -e 's:-Wall::g' \
- -e 's:-Wreturn-type::g' \
- -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}
- rm -f ${MAKEFILE}.old
- done
+ find . -iname makefile -o -name \*.mk -o -name GNUmakefile -print0 | \
+ xargs -0 sed -i \
+ -e 's:-Wall::g' \
+ -e 's:-Wreturn-type::g' \
+ -e 's:-pedantic::g'
}