/[gentoo-x86]/eclass/toolchain-funcs.eclass
Gentoo

Diff of /eclass/toolchain-funcs.eclass

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

Revision 1.107 Revision 1.108
1# Copyright 1999-2007 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.107 2011/09/12 21:42:08 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.108 2011/10/17 19:11:49 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
216tc-is-static-only() { 216tc-is-static-only() {
217 local host=${CTARGET:-${CHOST}} 217 local host=${CTARGET:-${CHOST}}
218 218
219 # *MiNT doesn't have shared libraries, only platform so far 219 # *MiNT doesn't have shared libraries, only platform so far
220 return $([[ ${host} == *-mint* ]]) 220 return $([[ ${host} == *-mint* ]])
221}
222
223# @FUNCTION: tc-env_build
224# @USAGE: <command> [command args]
225# @INTERNAL
226# @DESCRIPTION:
227# Setup the compile environment to the build tools and then execute the
228# specified command. We use tc-getBUILD_XX here so that we work with
229# all of the semi-[non-]standard env vars like $BUILD_CC which often
230# the target build system does not check.
231tc-env_build() {
232 CFLAGS=${BUILD_CFLAGS:--O1 -pipe} \
233 CXXFLAGS=${BUILD_CXXFLAGS:--O1 -pipe} \
234 CPPFLAGS=${BUILD_CPPFLAGS} \
235 LDFLAGS=${BUILD_LDFLAGS} \
236 AR=$(tc-getBUILD_AR) \
237 AS=$(tc-getBUILD_AS) \
238 CC=$(tc-getBUILD_CC) \
239 CPP=$(tc-getBUILD_CPP) \
240 CXX=$(tc-getBUILD_CXX) \
241 LD=$(tc-getBUILD_LD) \
242 NM=$(tc-getBUILD_NM) \
243 PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \
244 RANLIB=$(tc-getBUILD_RANLIB) \
245 "$@"
246}
247
248# @FUNCTION: econf_build
249# @USAGE: [econf flags]
250# @DESCRIPTION:
251# Sometimes we need to locally build up some tools to run on CBUILD because
252# the package has helper utils which are compiled+executed when compiling.
253# This won't work when cross-compiling as the CHOST is set to a target which
254# we cannot natively execute.
255#
256# For example, the python package will build up a local python binary using
257# a portable build system (configure+make), but then use that binary to run
258# local python scripts to build up other components of the overall python.
259# We cannot rely on the python binary in $PATH as that often times will be
260# a different version, or not even installed in the first place. Instead,
261# we compile the code in a different directory to run on CBUILD, and then
262# use that binary when compiling the main package to run on CHOST.
263#
264# For example, with newer EAPIs, you'd do something like:
265# @CODE
266# src_configure() {
267# ECONF_SOURCE=${S}
268# if tc-is-cross-compiler ; then
269# mkdir "${WORKDIR}"/${CBUILD}
270# pushd "${WORKDIR}"/${CBUILD} >/dev/null
271# econf_build --disable-some-unused-stuff
272# popd >/dev/null
273# fi
274# ... normal build paths ...
275# }
276# src_compile() {
277# if tc-is-cross-compiler ; then
278# pushd "${WORKDIR}"/${CBUILD} >/dev/null
279# emake one-or-two-build-tools
280# ln/mv build-tools to normal build paths in ${S}/
281# popd >/dev/null
282# fi
283# ... normal build paths ...
284# }
285# @CODE
286econf_build() {
287 tc-env_build econf --build=${CBUILD:-${CHOST}} "$@"
221} 288}
222 289
223# @FUNCTION: tc-has-openmp 290# @FUNCTION: tc-has-openmp
224# @USAGE: [toolchain prefix] 291# @USAGE: [toolchain prefix]
225# @DESCRIPTION: 292# @DESCRIPTION:

Legend:
Removed from v.1.107  
changed lines
  Added in v.1.108

  ViewVC Help
Powered by ViewVC 1.1.20