python-utils-r1.eclass: python_moduleinto, allow package dot-notation
[gentoo.git] / eclass / makeedit.eclass
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: makeedit.eclass
5 # @AUTHOR:
6 # Spider
7 # @BLURB: An eclass to replace some flags in makefiles
8 # @DESCRIPTION:
9 #
10 # @CODE
11 # To use this eclass, do 2 things:
12 #   1. append-flags "$MAKEEDIT_FLAGS".  If you filter-flags, make sure to do
13 #      the append-flags afterward, otherwise you'll lose them.
14 #   2. after running configure or econf, call edit_makefiles to remove
15 #      extraneous CFLAGS from your Makefiles.
16 # @CODE
17 #
18 # This combination should reduce the RAM requirements of your build, and maybe
19 # even speed it up a bit.
20
21
22 MAKEEDIT_FLAGS="-Wno-return-type -w"
23
24 # @FUNCTION: edit_makefiles
25 # @DESCRIPTION:
26 # Removes some flags in makefiles
27 edit_makefiles() {
28         # We already add "-Wno-return-type -w" to compiler flags, so
29         # no need to replace "-Wall" and "-Wreturn-type" with them.
30         einfo "Parsing Makefiles ..."
31         find . \( -iname makefile -o -name \*.mk -o -name GNUmakefile \) -print0 | \
32                 xargs -0 sed -i \
33                 -e 's:-Wall::g' \
34                 -e 's:-Wreturn-type::g' \
35                 -e 's:-pedantic::g'
36 }