Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] elibtoolize/eautoreconf interactions and lazy eclasses/ebuilds
Date: Sun, 13 Nov 2011 17:38:30
Message-Id: 201111131237.50507.vapier@gentoo.org
1 it seems we have some cases where eclasses/ebuilds interact poorly. for
2 example, if an eclass runs eautoreconf or elibtoolize, and then the ebuild
3 does some stuff where it ends up running eautoreconf, subsequent elibtoolize
4 calls are skipped.
5
6 this means that the work done by the earlier elibtoolize call was all for
7 naught, as eautoreconf blows all of its work away be regenerating the files
8 elibtoolize patched. and when eautoreconf attempts to run elibtoolize itself,
9 we don't get all the fun patches since elibtoolize detected it was run
10 already.
11
12 rather than have this continue to silently ignore the issue, i'm thinking of
13 making these changes:
14 - elibtoolize now has a --force flag
15 - eautoreconf always calls elibtoolize with --force
16 - if elibtoolize detects a previous run with --force, it warns, but runs
17 this way we complain, but at least we continue to work
18
19 the prefix guys first brought this up here:
20 https://bugs.gentoo.org/232820
21 but i've hit this since with cross-compiling Linux targets:
22 - pygobject ebuild inherits gnome2 eclass
23 - pygobject's src_prepare first calls gnome2_src_prepare
24 - gnome2_src_prepare always calls elibtoolize (which normally is good)
25 - pygobject's src_prepare applies patches and then calls eautoreconf
26 - eautoreconf regens all files that where patched earlier
27 - eautoreconf's call to elibtoolize is skipped
28 - builds fail which need those elibtoolize patches
29 -mike
30
31 --- autotools.eclass
32 +++ autotools.eclass
33 @@ -146,7 +146,7 @@
34
35 # Call it here to prevent failures due to elibtoolize called _before_
36 # eautoreconf. We set $S because elibtoolize runs on that #265319
37 - S=${PWD} elibtoolize
38 + S=${PWD} elibtoolize --force
39
40 return 0
41 }
42 --- libtool.eclass
43 +++ libtool.eclass
44 @@ -119,6 +119,7 @@
45 local do_uclibc="yes"
46 local deptoremove=
47 local do_shallow="no"
48 + local force="false"
49 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed"
50
51 for x in "$@" ; do
52 @@ -153,6 +154,9 @@
53 --no-uclibc)
54 do_uclibc="no"
55 ;;
56 + --force)
57 + force="true"
58 + ;;
59 *)
60 eerror "Invalid elibtoolize option: ${x}"
61 die "elibtoolize called with ${x} ??"
62 @@ -186,9 +190,15 @@
63 for d in "$@" ; do
64 export ELT_APPLIED_PATCHES=
65
66 - [[ -f ${d}/.elibtoolized ]] && continue
67 + if [[ -f ${d}/.elibtoolized ]] ; then
68 + ${force} || continue
69 + fi
70
71 einfo "Running elibtoolize in: ${d#${WORKDIR}/}/"
72 + if [[ -f ${d}/.elibtoolized ]] ; then
73 + ewarn " We've already been run in this tree; you should"
74 + ewarn " avoid this if possible (perhaps by filing a bug)"
75 + fi
76
77 for p in ${elt_patches} ; do
78 local ret=0

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies