| 1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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.46 2012/01/30 13:11:27 jlec Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.50 2012/05/22 14:29:06 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> |
| … | |
… | |
| 325 | # gnome-doc |
325 | # gnome-doc |
| 326 | if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then |
326 | if [[ $(autotools_check_macro GNOME_DOC_INIT) ]]; then |
| 327 | autotools_run_tool gnome-doc-prepare --copy --force |
327 | autotools_run_tool gnome-doc-prepare --copy --force |
| 328 | fi |
328 | fi |
| 329 | |
329 | |
| 330 | # We need to perform the check twice to know whether to run eaclocal. |
|
|
| 331 | # (_elibtoolize does that itself) |
|
|
| 332 | if [[ $(autotools_check_macro AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT) ]] |
330 | if [[ $(autotools_check_macro AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT) ]] |
| 333 | then |
331 | then |
| 334 | _elibtoolize --copy --force --install |
332 | _elibtoolize --copy --force --install |
| 335 | else |
333 | fi |
|
|
334 | |
| 336 | eaclocal |
335 | eaclocal |
| 337 | fi |
|
|
| 338 | |
|
|
| 339 | eautoconf |
336 | eautoconf |
| 340 | eautoheader |
337 | eautoheader |
| 341 | FROM_EAUTORECONF=sure eautomake |
338 | FROM_EAUTORECONF=sure eautomake |
| 342 | |
339 | |
| 343 | local x |
340 | local x |
| 344 | for x in $(autotools_get_subdirs); do |
341 | for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS); do |
| 345 | if [[ -d ${x} ]] ; then |
342 | if [[ -d ${x} ]] ; then |
| 346 | pushd "${x}" >/dev/null |
343 | pushd "${x}" >/dev/null |
| 347 | autotools-utils_eautoreconf |
344 | autotools-utils_autoreconf |
| 348 | popd >/dev/null |
345 | popd >/dev/null |
| 349 | fi |
346 | fi |
| 350 | done |
347 | done |
| 351 | } |
348 | } |
| 352 | |
349 | |
| … | |
… | |
| 360 | |
357 | |
| 361 | local want_autoreconf=${AUTOTOOLS_AUTORECONF} |
358 | local want_autoreconf=${AUTOTOOLS_AUTORECONF} |
| 362 | |
359 | |
| 363 | [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" |
360 | [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" |
| 364 | |
361 | |
| 365 | touch "${T}"/.autotools-utils.timestamp || die |
362 | at_checksum() { |
|
|
363 | find '(' -name 'Makefile.am' \ |
|
|
364 | -o -name 'configure.ac' \ |
|
|
365 | -o -name 'configure.in' ')' \ |
|
|
366 | -exec cksum {} + | sort -k2 |
|
|
367 | } |
|
|
368 | |
|
|
369 | [[ ! ${want_autoreconf} ]] && local checksum=$(at_checksum) |
| 366 | epatch_user |
370 | epatch_user |
| 367 | if [[ ! ${want_autoreconf} ]]; then |
371 | if [[ ! ${want_autoreconf} ]]; then |
| 368 | if [[ $(find . -newer "${T}"/.autotools-utils.timestamp \ |
372 | if [[ ${checksum} != $(at_checksum) ]]; then |
| 369 | -a '(' -name 'Makefile.am' \ |
|
|
| 370 | -o -name 'configure.ac' \ |
|
|
| 371 | -o -name 'configure.in' ')' \ |
|
|
| 372 | -print -quit) ]]; then |
|
|
| 373 | einfo 'Will autoreconfigure due to user patches applied.' |
373 | einfo 'Will autoreconfigure due to user patches applied.' |
| 374 | want_autoreconf=yep |
374 | want_autoreconf=yep |
| 375 | fi |
375 | fi |
| 376 | fi |
376 | fi |
| 377 | |
377 | |