| 1 |
# Copyright 1999-2004 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/makeedit.eclass,v 1.9 2005/07/06 20:20:04 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. |
| 15 |
|
| 16 |
|
| 17 |
MAKEEDIT_FLAGS="-Wno-return-type -w" |
| 18 |
|
| 19 |
edit_makefiles() { |
| 20 |
# We already add "-Wno-return-type -w" to compiler flags, so |
| 21 |
# no need to replace "-Wall" and "-Wreturn-type" with them. |
| 22 |
einfo "Parsing Makefiles ..." |
| 23 |
find . -iname makefile -o -name \*.mk -o -name GNUmakefile -print0 | \ |
| 24 |
xargs -0 sed -i \ |
| 25 |
-e 's:-Wall::g' \ |
| 26 |
-e 's:-Wreturn-type::g' \ |
| 27 |
-e 's:-pedantic::g' |
| 28 |
} |