summaryrefslogtreecommitdiff
blob: f422246254f2fa503198403fee9ddef0ed61b510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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.6 2004/06/25 00:39:48 vapier Exp $
#
# Author: Spider
#
# makeedit eclass, will remove -Wreturn-type and -Wall from compiling,
# this will reduce the RAM requirements.

# Debug ECLASS
ECLASS="makeedit"
INHERITED="$INHERITED $ECLASS"

export CFLAGS="${CFLAGS} -Wno-return-type -w"
export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"

edit_makefiles () {
	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
}