1 | # Copyright 1999-2011 Gentoo Foundation |
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/toolchain-funcs.eclass,v 1.111 2012/06/09 06:56:14 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.112 2012/06/14 03:38:51 vapier Exp $ |
4 | |
4 | |
5 | # @ECLASS: toolchain-funcs.eclass |
5 | # @ECLASS: toolchain-funcs.eclass |
6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
7 | # Toolchain Ninjas <toolchain@gentoo.org> |
7 | # Toolchain Ninjas <toolchain@gentoo.org> |
8 | # @BLURB: functions to query common info about the toolchain |
8 | # @BLURB: functions to query common info about the toolchain |
… | |
… | |
213 | |
213 | |
214 | # *MiNT doesn't have shared libraries, only platform so far |
214 | # *MiNT doesn't have shared libraries, only platform so far |
215 | return $([[ ${host} == *-mint* ]]) |
215 | return $([[ ${host} == *-mint* ]]) |
216 | } |
216 | } |
217 | |
217 | |
|
|
218 | # @FUNCTION: tc-export_build_env |
|
|
219 | # @USAGE: [compiler variables] |
|
|
220 | # @DESCRIPTION: |
|
|
221 | # Export common build related compiler settings. |
|
|
222 | tc-export_build_env() { |
|
|
223 | tc-export "$@" |
|
|
224 | : ${BUILD_CFLAGS:=-O1 -pipe} |
|
|
225 | : ${BUILD_CXXFLAGS:=-O1 -pipe} |
|
|
226 | : ${BUILD_CPPFLAGS:=} |
|
|
227 | : ${BUILD_LDFLAGS:=} |
|
|
228 | export BUILD_{C,CXX,CPP,LD}FLAGS |
|
|
229 | } |
|
|
230 | |
218 | # @FUNCTION: tc-env_build |
231 | # @FUNCTION: tc-env_build |
219 | # @USAGE: <command> [command args] |
232 | # @USAGE: <command> [command args] |
220 | # @INTERNAL |
233 | # @INTERNAL |
221 | # @DESCRIPTION: |
234 | # @DESCRIPTION: |
222 | # Setup the compile environment to the build tools and then execute the |
235 | # Setup the compile environment to the build tools and then execute the |
223 | # specified command. We use tc-getBUILD_XX here so that we work with |
236 | # specified command. We use tc-getBUILD_XX here so that we work with |
224 | # all of the semi-[non-]standard env vars like $BUILD_CC which often |
237 | # all of the semi-[non-]standard env vars like $BUILD_CC which often |
225 | # the target build system does not check. |
238 | # the target build system does not check. |
226 | tc-env_build() { |
239 | tc-env_build() { |
|
|
240 | tc-export_build_env |
227 | CFLAGS=${BUILD_CFLAGS:--O1 -pipe} \ |
241 | CFLAGS=${BUILD_CFLAGS} \ |
228 | CXXFLAGS=${BUILD_CXXFLAGS:--O1 -pipe} \ |
242 | CXXFLAGS=${BUILD_CXXFLAGS} \ |
229 | CPPFLAGS=${BUILD_CPPFLAGS} \ |
243 | CPPFLAGS=${BUILD_CPPFLAGS} \ |
230 | LDFLAGS=${BUILD_LDFLAGS} \ |
244 | LDFLAGS=${BUILD_LDFLAGS} \ |
231 | AR=$(tc-getBUILD_AR) \ |
245 | AR=$(tc-getBUILD_AR) \ |
232 | AS=$(tc-getBUILD_AS) \ |
246 | AS=$(tc-getBUILD_AS) \ |
233 | CC=$(tc-getBUILD_CC) \ |
247 | CC=$(tc-getBUILD_CC) \ |