/[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.29 Revision 1.31
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/autotools-utils.eclass,v 1.29 2011/11/27 09:57:20 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.31 2011/12/22 18:01:12 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>
91case ${EAPI:-0} in 91case ${EAPI:-0} in
92 2|3|4) ;; 92 2|3|4) ;;
93 *) die "EAPI=${EAPI} is not supported" ;; 93 *) die "EAPI=${EAPI} is not supported" ;;
94esac 94esac
95 95
96inherit autotools base eutils libtool 96inherit autotools eutils libtool
97 97
98EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test 98EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
99 99
100# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR 100# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
101# @DEFAULT_UNSET
101# @DESCRIPTION: 102# @DESCRIPTION:
102# Build directory, location where all autotools generated files should be 103# Build directory, location where all autotools generated files should be
103# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build. 104# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
104 105
105# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD 106# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
107# @DEFAULT_UNSET
106# @DESCRIPTION: 108# @DESCRIPTION:
107# Set to enable in-source build. 109# Set to enable in-source build.
108 110
109# @ECLASS-VARIABLE: ECONF_SOURCE 111# @ECLASS-VARIABLE: ECONF_SOURCE
112# @DEFAULT_UNSET
110# @DESCRIPTION: 113# @DESCRIPTION:
111# Specify location of autotools' configure script. By default it uses ${S}. 114# Specify location of autotools' configure script. By default it uses ${S}.
112 115
113# @ECLASS-VARIABLE: myeconfargs 116# @ECLASS-VARIABLE: myeconfargs
117# @DEFAULT_UNSET
114# @DESCRIPTION: 118# @DESCRIPTION:
115# Optional econf arguments as Bash array. Should be defined before calling src_configure. 119# Optional econf arguments as Bash array. Should be defined before calling src_configure.
116# @CODE 120# @CODE
117# src_configure() { 121# src_configure() {
118# local myeconfargs=( 122# local myeconfargs=(
121# $(use_enable debug cnddebug) 125# $(use_enable debug cnddebug)
122# $(use_enable threads multithreading) 126# $(use_enable threads multithreading)
123# ) 127# )
124# autotools-utils_src_configure 128# autotools-utils_src_configure
125# } 129# }
130# @CODE
131
132# @ECLASS-VARIABLE: DOCS
133# @DEFAULT_UNSET
134# @DESCRIPTION:
135# Array containing documents passed to dodoc command.
136#
137# Example:
138# @CODE
139# DOCS=( NEWS README )
140# @CODE
141
142# @ECLASS-VARIABLE: HTML_DOCS
143# @DEFAULT_UNSET
144# @DESCRIPTION:
145# Array containing documents passed to dohtml command.
146#
147# Example:
148# @CODE
149# HTML_DOCS=( doc/html/ )
150# @CODE
151
152# @ECLASS-VARIABLE: PATCHES
153# @DEFAULT_UNSET
154# @DESCRIPTION:
155# PATCHES array variable containing all various patches to be applied.
156#
157# Example:
158# @CODE
159# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
126# @CODE 160# @CODE
127 161
128# Determine using IN or OUT source build 162# Determine using IN or OUT source build
129_check_build_dir() { 163_check_build_dir() {
130 : ${ECONF_SOURCE:=${S}} 164 : ${ECONF_SOURCE:=${S}}
219# @FUNCTION: autotools-utils_src_prepare 253# @FUNCTION: autotools-utils_src_prepare
220# @DESCRIPTION: 254# @DESCRIPTION:
221# The src_prepare function. 255# The src_prepare function.
222# 256#
223# Supporting PATCHES array and user patches. See base.eclass(5) for reference. 257# Supporting PATCHES array and user patches. See base.eclass(5) for reference.
258#
259# This function calls elibtoolize implicitly. If you need to call eautoreconf
260# afterwards, please use AT_NOELIBTOOLIZE=yes to avoid it being called twice.
224autotools-utils_src_prepare() { 261autotools-utils_src_prepare() {
225 debug-print-function ${FUNCNAME} "$@" 262 debug-print-function ${FUNCNAME} "$@"
226 263
227 base_src_prepare 264 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
265 epatch_user
266
228 elibtoolize --patch-only 267 elibtoolize --patch-only
229} 268}
230 269
231# @FUNCTION: autotools-utils_src_configure 270# @FUNCTION: autotools-utils_src_configure
232# @DESCRIPTION: 271# @DESCRIPTION:
258 econfargs+=("${myeconfargs[@]}") 297 econfargs+=("${myeconfargs[@]}")
259 298
260 _check_build_dir 299 _check_build_dir
261 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" 300 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
262 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 301 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
263 base_src_configure "${econfargs[@]}" "$@" 302 econf "${econfargs[@]}" "$@"
264 popd > /dev/null 303 popd > /dev/null
265} 304}
266 305
267# @FUNCTION: autotools-utils_src_compile 306# @FUNCTION: autotools-utils_src_compile
268# @DESCRIPTION: 307# @DESCRIPTION:
270autotools-utils_src_compile() { 309autotools-utils_src_compile() {
271 debug-print-function ${FUNCNAME} "$@" 310 debug-print-function ${FUNCNAME} "$@"
272 311
273 _check_build_dir 312 _check_build_dir
274 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 313 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
275 base_src_compile "$@" 314 emake "$@" || die 'emake failed'
276 popd > /dev/null 315 popd > /dev/null
277} 316}
278 317
279# @FUNCTION: autotools-utils_src_install 318# @FUNCTION: autotools-utils_src_install
280# @DESCRIPTION: 319# @DESCRIPTION:
287autotools-utils_src_install() { 326autotools-utils_src_install() {
288 debug-print-function ${FUNCNAME} "$@" 327 debug-print-function ${FUNCNAME} "$@"
289 328
290 _check_build_dir 329 _check_build_dir
291 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null 330 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
292 base_src_install "$@" 331 emake DESTDIR="${D}" "$@" install || die "emake install failed"
293 popd > /dev/null 332 popd > /dev/null
333
334 # XXX: support installing them from builddir as well?
335 if [[ ${DOCS} ]]; then
336 dodoc "${DOCS[@]}" || die "dodoc failed"
337 fi
338 if [[ ${HTML_DOCS} ]]; then
339 dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
340 fi
294 341
295 # Remove libtool files and unnecessary static libs 342 # Remove libtool files and unnecessary static libs
296 remove_libtool_files 343 remove_libtool_files
297} 344}
298 345

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20