/[gentoo-x86]/eclass/makeedit.eclass
Gentoo

Diff of /eclass/makeedit.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.13
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.5 2003/02/16 04:26:21 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.13 2011/08/22 04:46:32 vapier Exp $
4
5# @ECLASS: makeedit.eclass
6# @AUTHOR:
7# Spider
8# @BLURB: An eclass to replace some flags in makefiles
9# @DESCRIPTION:
4# 10#
5# Author: Spider 11# @CODE
12# To use this eclass, do 2 things:
13# 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do
14# the append-flags afterward, otherwise you'll lose them.
15# 2. after running configure or econf, call edit_makefiles to remove
16# extraneous CFLAGS from your Makefiles.
17# @CODE
6# 18#
7# makeedit eclass, will remove -Wreturn-type and -Wall from compiling, 19# This combination should reduce the RAM requirements of your build, and maybe
8# this will reduce the RAM requirements. 20# even speed it up a bit.
9 21
10# Debug ECLASS
11ECLASS="makeedit"
12INHERITED="$INHERITED $ECLASS"
13 22
14export CFLAGS="${CFLAGS} -Wno-return-type -w" 23MAKEEDIT_FLAGS="-Wno-return-type -w"
15export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"
16 24
25# @FUNCTION: edit_makefiles
26# @DESCRIPTION:
27# Removes some flags in makefiles
17edit_makefiles () { 28edit_makefiles() {
18 einfo "Parsing Makefiles..."
19 find . -iname makefile | while read MAKEFILE
20 do
21 cp ${MAKEFILE} ${MAKEFILE}.old
22 # We already add "-Wno-return-type -w" to compiler flags, so 29 # We already add "-Wno-return-type -w" to compiler flags, so
23 # no need to replace "-Wall" and "-Wreturn-type" with them. 30 # no need to replace "-Wall" and "-Wreturn-type" with them.
31 einfo "Parsing Makefiles ..."
32 find . \( -iname makefile -o -name \*.mk -o -name GNUmakefile \) -print0 | \
33 xargs -0 sed -i \
24 sed -e 's:-Wall::g' \ 34 -e 's:-Wall::g' \
25 -e 's:-Wreturn-type::g' \ 35 -e 's:-Wreturn-type::g' \
26 -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE} 36 -e 's:-pedantic::g'
27 rm -f ${MAKEFILE}.old
28 done
29 # Mozilla use .mk includes
30 find . -name '*.mk' | while read MAKEFILE
31 do
32 cp ${MAKEFILE} ${MAKEFILE}.old
33 sed -e 's:-Wall::g' \
34 -e 's:-Wreturn-type::g' \
35 -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}
36 rm -f ${MAKEFILE}.old
37 done
38} 37}

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20