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

Diff of /eclass/makeedit.eclass

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

Revision 1.4 Revision 1.13
1# Copyright 1999-2002 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.4 2002/08/29 23:56:15 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.13 2011/08/22 04:46:32 vapier Exp $
4 4
5# Author: Spider 5# @ECLASS: makeedit.eclass
6# makeedit eclass, will remove -Wreturn-type and -Wall from compiling, this will reduce the RAM requirements. 6# @AUTHOR:
7# Spider
8# @BLURB: An eclass to replace some flags in makefiles
9# @DESCRIPTION:
10#
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
18#
19# This combination should reduce the RAM requirements of your build, and maybe
20# even speed it up a bit.
7 21
8# Debug ECLASS
9ECLASS="makeedit"
10INHERITED="$INHERITED $ECLASS"
11 22
12export CFLAGS="${CFLAGS} -Wno-return-type -w" 23MAKEEDIT_FLAGS="-Wno-return-type -w"
13export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"
14 24
25# @FUNCTION: edit_makefiles
26# @DESCRIPTION:
27# Removes some flags in makefiles
15edit_makefiles () { 28edit_makefiles() {
16 einfo "Parsing Makefiles..."
17 find . -iname makefile | while read MAKEFILE
18 do
19 cp ${MAKEFILE} ${MAKEFILE}.old
20 # We already add "-Wno-return-type -w" to compiler flags, so 29 # We already add "-Wno-return-type -w" to compiler flags, so
21 # 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 \
22 sed -e 's:-Wall::g' \ 34 -e 's:-Wall::g' \
23 -e 's:-Wreturn-type::g' \ 35 -e 's:-Wreturn-type::g' \
24 -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE} 36 -e 's:-pedantic::g'
25 rm -f ${MAKEFILE}.old
26 done
27 # Mozilla use .mk includes
28 find . -name '*.mk' | while read MAKEFILE
29 do
30 cp ${MAKEFILE} ${MAKEFILE}.old
31 sed -e 's:-Wall::g' \
32 -e 's:-Wreturn-type::g' \
33 -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}
34 rm -f ${MAKEFILE}.old
35 done
36} 37}

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

  ViewVC Help
Powered by ViewVC 1.1.20