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

Diff of /eclass/autotools.eclass

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

Revision 1.159 Revision 1.160
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.eclass,v 1.159 2013/12/31 16:53:05 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.160 2014/02/18 03:57:36 vapier Exp $
4 4
5# @ECLASS: autotools.eclass 5# @ECLASS: autotools.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: Regenerates auto* build scripts 8# @BLURB: Regenerates auto* build scripts
340 340
341# @FUNCTION: eautomake 341# @FUNCTION: eautomake
342# @DESCRIPTION: 342# @DESCRIPTION:
343# Runs automake. 343# Runs automake.
344eautomake() { 344eautomake() {
345 local extra_opts 345 local extra_opts=()
346 local makefile_name 346 local makefile_name
347 347
348 # Run automake if: 348 # Run automake if:
349 # - a Makefile.am type file exists 349 # - a Makefile.am type file exists
350 # - the configure script is using the AM_INIT_AUTOMAKE directive 350 # - the configure script is using the AM_INIT_AUTOMAKE directive
351 for makefile_name in {GNUmakefile,{M,m}akefile}.am "" ; do 351 for makefile_name in {GNUmakefile,{M,m}akefile}.am "" ; do
352 [[ -f ${makefile_name} ]] && break 352 [[ -f ${makefile_name} ]] && break
353 done 353 done
354 354
355 _automake_version() {
356 automake --version 2>/dev/null | sed -n -e '1{s:.*(GNU automake) ::p;q}'
357 }
358
355 if [[ -z ${makefile_name} ]] ; then 359 if [[ -z ${makefile_name} ]] ; then
356 _at_uses_automake || return 0 360 _at_uses_automake || return 0
357 361
358 elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then 362 elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then
359 local used_automake 363 local used_automake
360 local installed_automake 364 local installed_automake
361 365
362 installed_automake=$(WANT_AUTOMAKE= automake --version | head -n 1 | \ 366 installed_automake=$(WANT_AUTOMAKE= _automake_version)
363 sed -e 's:.*(GNU automake) ::')
364 used_automake=$(head -n 1 < ${makefile_name%.am}.in | \ 367 used_automake=$(head -n 1 < ${makefile_name%.am}.in | \
365 sed -e 's:.*by automake \(.*\) from .*:\1:') 368 sed -e 's:.*by automake \(.*\) from .*:\1:')
366 369
367 if [[ ${installed_automake} != ${used_automake} ]]; then 370 if [[ ${installed_automake} != ${used_automake} ]]; then
368 einfo "Automake used for the package (${used_automake}) differs from" 371 einfo "Automake used for the package (${used_automake}) differs from"
371 return 0 374 return 0
372 fi 375 fi
373 fi 376 fi
374 377
375 [[ -f INSTALL && -f AUTHORS && -f ChangeLog && -f NEWS && -f README ]] \ 378 [[ -f INSTALL && -f AUTHORS && -f ChangeLog && -f NEWS && -f README ]] \
376 || extra_opts="${extra_opts} --foreign" 379 || extra_opts+=( --foreign )
377 380
378 # --force-missing seems not to be recognized by some flavours of automake 381 # Older versions of automake do not support --force-missing. But we want
382 # to use this whenever possible to update random bundled files #133489.
383 case $(_automake_version) in
384 1.4|1.4[.-]*) ;;
385 *) extra_opts+=( --force-missing ) ;;
386 esac
387
379 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@" 388 autotools_run_tool automake --add-missing --copy "${extra_opts[@]}" "$@"
380} 389}
381 390
382# @FUNCTION: eautopoint 391# @FUNCTION: eautopoint
383# @DESCRIPTION: 392# @DESCRIPTION:
384# Runs autopoint (from the gettext package). 393# Runs autopoint (from the gettext package).

Legend:
Removed from v.1.159  
changed lines
  Added in v.1.160

  ViewVC Help
Powered by ViewVC 1.1.20