/[gentoo-x86]/eclass/autotools-utils.eclass
Gentoo

Diff of /eclass/autotools-utils.eclass

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

Revision 1.22 Revision 1.28
1# Copyright 1999-2010 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/autotools-utils.eclass,v 1.22 2011/09/18 07:57:55 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.28 2011/11/27 09:17:35 mgorny Exp $
4 4
5# @ECLASS: autotools-utils.eclass 5# @ECLASS: autotools-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Maciej Mrozowski <reavertm@gentoo.org> 7# Maciej Mrozowski <reavertm@gentoo.org>
8# Michał Górny <mgorny@gentoo.org> 8# Michał Górny <mgorny@gentoo.org>
9# @BLURB: common ebuild functions for autotools-based packages 9# @BLURB: common ebuild functions for autotools-based packages
10# @DESCRIPTION: 10# @DESCRIPTION:
11# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper 11# autotools-utils.eclass is autotools.eclass(5) and base.eclass(5) wrapper
12# providing all inherited features along with econf arguments as Bash array, 12# providing all inherited features along with econf arguments as Bash array,
13# out of source build with overridable build dir location, static archives 13# out of source build with overridable build dir location, static archives
14# handling, libtool files removal, enable/disable debug handling. 14# handling, libtool files removal.
15#
16# Please note note that autotools-utils does not support mixing of its phase
17# functions with regular econf/emake calls. If necessary, please call
18# autotools-utils_src_compile instead of the latter.
15# 19#
16# @EXAMPLE: 20# @EXAMPLE:
17# Typical ebuild using autotools-utils.eclass: 21# Typical ebuild using autotools-utils.eclass:
18# 22#
19# @CODE 23# @CODE
56# "${FILESDIR}/${P}-unbundle_libpng.patch" 60# "${FILESDIR}/${P}-unbundle_libpng.patch"
57# ) 61# )
58# 62#
59# src_configure() { 63# src_configure() {
60# local myeconfargs=( 64# local myeconfargs=(
65# $(use_enable debug)
61# $(use_with qt4) 66# $(use_with qt4)
62# $(use_enable threads multithreading) 67# $(use_enable threads multithreading)
63# $(use_with tiff) 68# $(use_with tiff)
64# ) 69# )
65# autotools-utils_src_configure 70# autotools-utils_src_configure
86case ${EAPI:-0} in 91case ${EAPI:-0} in
87 2|3|4) ;; 92 2|3|4) ;;
88 *) die "EAPI=${EAPI} is not supported" ;; 93 *) die "EAPI=${EAPI} is not supported" ;;
89esac 94esac
90 95
91inherit autotools base eutils 96inherit autotools base eutils libtool
92 97
93EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test 98EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
94 99
95# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR 100# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
96# @DESCRIPTION: 101# @DESCRIPTION:
209# Supporting PATCHES array and user patches. See base.eclass(5) for reference. 214# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
210autotools-utils_src_prepare() { 215autotools-utils_src_prepare() {
211 debug-print-function ${FUNCNAME} "$@" 216 debug-print-function ${FUNCNAME} "$@"
212 217
213 base_src_prepare 218 base_src_prepare
219 elibtoolize --patch-only
214} 220}
215 221
216# @FUNCTION: autotools-utils_src_configure 222# @FUNCTION: autotools-utils_src_configure
217# @DESCRIPTION: 223# @DESCRIPTION:
218# The src_configure function. For out of source build it creates build 224# The src_configure function. For out of source build it creates build
229 || die 'autotools-utils.eclass: myeconfargs has to be an array.' 235 || die 'autotools-utils.eclass: myeconfargs has to be an array.'
230 236
231 # Common args 237 # Common args
232 local econfargs=() 238 local econfargs=()
233 239
234 # Handle debug found in IUSE
235 if has debug ${IUSE//+}; then
236 local debugarg=$(use_enable debug)
237 if ! has "${debugarg}" "${myeconfargs[@]}"; then
238 eqawarn 'Implicit $(use_enable debug) for IUSE="debug" is no longer supported.'
239 eqawarn 'Please add the necessary arg to myeconfargs if requested.'
240 eqawarn 'The autotools-utils eclass will stop warning about it on Oct 15th.'
241 fi
242 fi
243
244 # Handle static-libs found in IUSE, disable them by default 240 # Handle static-libs found in IUSE, disable them by default
245 if has static-libs ${IUSE//+}; then 241 if in_iuse static-libs; then
246 econfargs+=( 242 econfargs+=(
247 --enable-shared 243 --enable-shared
248 $(use_enable static-libs static) 244 $(use_enable static-libs static)
249 ) 245 )
250 fi 246 fi
252 # Append user args 248 # Append user args
253 econfargs+=("${myeconfargs[@]}") 249 econfargs+=("${myeconfargs[@]}")
254 250
255 _check_build_dir 251 _check_build_dir
256 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 252 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
257 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 253 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
258 base_src_configure "${econfargs[@]}" "$@" 254 base_src_configure "${econfargs[@]}" "$@"
259 popd > /dev/null 255 popd > /dev/null || die
260} 256}
261 257
262# @FUNCTION: autotools-utils_src_compile 258# @FUNCTION: autotools-utils_src_compile
263# @DESCRIPTION: 259# @DESCRIPTION:
264# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR. 260# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
265autotools-utils_src_compile() { 261autotools-utils_src_compile() {
266 debug-print-function ${FUNCNAME} "$@" 262 debug-print-function ${FUNCNAME} "$@"
267 263
268 _check_build_dir 264 _check_build_dir
269 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 265 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
270 base_src_compile "$@" 266 base_src_compile "$@"
271 popd > /dev/null 267 popd > /dev/null || die
272} 268}
273 269
274# @FUNCTION: autotools-utils_src_install 270# @FUNCTION: autotools-utils_src_install
275# @DESCRIPTION: 271# @DESCRIPTION:
276# The autotools src_install function. Runs emake install, unconditionally 272# The autotools src_install function. Runs emake install, unconditionally
281# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference. 277# DOCS and HTML_DOCS arrays are supported. See base.eclass(5) for reference.
282autotools-utils_src_install() { 278autotools-utils_src_install() {
283 debug-print-function ${FUNCNAME} "$@" 279 debug-print-function ${FUNCNAME} "$@"
284 280
285 _check_build_dir 281 _check_build_dir
286 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 282 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
287 base_src_install "$@" 283 base_src_install "$@"
288 popd > /dev/null 284 popd > /dev/null || die
289 285
290 # Remove libtool files and unnecessary static libs 286 # Remove libtool files and unnecessary static libs
291 remove_libtool_files 287 remove_libtool_files
292} 288}
293 289
296# The autotools src_test function. Runs emake check in build directory. 292# The autotools src_test function. Runs emake check in build directory.
297autotools-utils_src_test() { 293autotools-utils_src_test() {
298 debug-print-function ${FUNCNAME} "$@" 294 debug-print-function ${FUNCNAME} "$@"
299 295
300 _check_build_dir 296 _check_build_dir
301 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 297 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
302 # Run default src_test as defined in ebuild.sh 298 # Run default src_test as defined in ebuild.sh
303 default_src_test 299 default_src_test
304 popd > /dev/null 300 popd > /dev/null || die
305} 301}

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20