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

Diff of /eclass/makeedit.eclass

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

Revision 1.2 Revision 1.8
1# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2004 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.2 2002/07/26 21:50:16 danarmak Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.8 2005/07/02 03:19:12 agriffis Exp $
4#
5# Author: Spider
6#
7# To use this eclass, do 2 things:
8# 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do
9# the append-flags afterward, otherwise you'll lose them.
10# 2. after running configure or econf, call edit_makefiles to remove
11# extraneous CFLAGS from your Makefiles.
12#
13# This combination should reduce the RAM requirements of your build, and maybe
14# even speed it up a bit.
4 15
5# Author: Spider
6# makeedit eclass, will remove -Wreturn-type and -Wall from compiling, this will reduce the RAM requirements.
7
8# Debug ECLASS
9ECLASS="makeedit" 16ECLASS="makeedit"
10INHERITED="$INHERITED $ECLASS" 17INHERITED="$INHERITED $ECLASS"
11 18
12INHERITED="$INHERITED $ECLASS" 19MAKEEDIT_FLAGS="-Wno-return-type -w"
13export CFLAGS="${CFLAGS} -Wno-return-type"
14export CXXFLAGS="${CXXFLAGS} -Wno-return-type"
15 20
16edit_makefiles () { 21edit_makefiles() {
17 find . -iname makefile |while read MAKEFILE 22 # We already add "-Wno-return-type -w" to compiler flags, so
18 do einfo "parsing ${MAKEFILE}" 23 # no need to replace "-Wall" and "-Wreturn-type" with them.
19 cp ${MAKEFILE} ${MAKEFILE}.old 24 einfo "Parsing Makefiles ..."
20 sed -e "s:-Wall:-Wall -Wno-return-type:g" \ 25 find . -iname makefile -o -name \*.mk -o -name GNUmakefile -print0 | \
21 -e "s:-Wreturn-type:-Wno-return-type:g" \ 26 xargs -0 sed -i \
22 -e "s:-pedantic::g" ${MAKEFILE}.old > ${MAKEFILE} 27 -e 's:-Wall::g' \
23 done 28 -e 's:-Wreturn-type::g' \
24 29 -e 's:-pedantic::g'
25} 30}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20