summaryrefslogtreecommitdiff
path: root/eclass
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
commit9fc61568d00dd6e678e8f4d74ea926f32cd2c275 (patch)
treeb99cd69879f1e712e4c1e3dff5dc39426a1fc681 /eclass
parentStable on mips (diff)
downloadhistorical-9fc61568d00dd6e678e8f4d74ea926f32cd2c275.tar.gz
historical-9fc61568d00dd6e678e8f4d74ea926f32cd2c275.tar.bz2
historical-9fc61568d00dd6e678e8f4d74ea926f32cd2c275.zip
Don't append to CFLAGS in global scope #56409
Diffstat (limited to 'eclass')
-rw-r--r--eclass/makeedit.eclass44
-rw-r--r--eclass/mozconfig.eclass5
2 files changed, 22 insertions, 27 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'
}
diff --git a/eclass/mozconfig.eclass b/eclass/mozconfig.eclass
index 70946d285e93..ceaac43d55a8 100644
--- a/eclass/mozconfig.eclass
+++ b/eclass/mozconfig.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig.eclass,v 1.10 2005/05/12 14:49:26 weeve Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig.eclass,v 1.11 2005/07/02 03:19:12 agriffis Exp $
#
# mozconfig.eclass: the new mozilla.eclass
@@ -150,6 +150,9 @@ mozconfig_init() {
CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
fi
+ # Go a little faster; use less RAM
+ append-flags "$MAKEEDIT_FLAGS"
+
####################################
#
# mozconfig setup