Gentoo Archives: gentoo-alt

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-alt@l.g.o
Cc: drizzt@g.o
Subject: Re: [gentoo-alt] Re: gnulib.eclass implementation
Date: Thu, 05 Mar 2009 14:00:17
Message-Id: 1236261582.26290.1.camel@salomon-22
In Reply to: [gentoo-alt] Re: gnulib.eclass implementation by Fabian Groffen
1 On Wed, 2009-03-04 at 19:00 +0100, Fabian Groffen wrote:
2 > On 04-03-2009 18:47:43 +0100, Timothy Redaelli wrote:
3 > > I start to implement a gnulib.eclass that allows to include the modules that
4 > > the ebuild wants.
5 > >
6 > > IMHO it's better than the pre-compiled libgnu.a with some modules, since we
7 > > cannot know if an ebuild wants another module.
8 >
9 > At one point we just went for this and decided to just extend gnulib
10 > with a version bump if needed.
11
12 One point was that often there are the same few modules missing for
13 several packages, so building the same thing always feels unnecessary.
14 Instead add new missing modules to the installed libgnu.a.
15 (feels like: everyone uses preinstalled glibc and doesn't configure a
16 private one ...)
17
18 My first intention was to build *all* available gnulib modules, but this
19 turned out to not work, IIRC because of gnulib-bugs in some modules. So
20 I switched to building the required ones only.
21
22 More points to keep in mind:
23 *) libgnu.a (from ebuild, either preinstalled or not) is for packages
24 without any portability bits and thus _not_ shipping with any gnulib
25 modules at all, expecting them from the host os. As of now, haven't seen
26 too many of them yet, at least not in @system. Usually these are
27 distro-specific packages like portage-utils only.
28 *) libgnu.a does not work with packages already shipping with some
29 gnulib modules when they just forgot to add another one.
30 *) Maybe we want a shared libgnu some day, to ease distributing fixes in
31 gnulib modules.
32
33 > > DEPEND="
34 > > - ppc-aix? ( dev-libs/gnulib )
35 > > - sparc-solaris? ( dev-libs/gnulib )
36 > > - sparc64-solaris? ( dev-libs/gnulib )
37 > > - x86-solaris? ( dev-libs/gnulib )
38 > > - x64-solaris? ( dev-libs/gnulib )
39 > > + ppc-aix? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
40 > > + sparc-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
41 > > + sparc64-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
42 > > + x86-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
43 > > + x64-solaris? ( >=dev-libs/gnulib-2009.03.03.14.07.45 )
44 > > "
45
46 As gnulib detects itself if a replacement implementation actually is
47 necessary, this results in an empty libgnu.a on glibc-platforms - still
48 providing some headers causing warnings when using unportable functions.
49 So maybe we want to depend on dev-libs/gnulib unconditionally in the
50 offending packages?
51
52 > > - if [[ ${CHOST} == *-aix* || ${CHOST} == *-solaris* ]]; then
53 > > - append-flags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/include
54 > > - append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/gnulib/lib
55 > > - append-libs -lgnu
56 > > - fi
57
58 +1 for having this in an eclass-function - maybe unconditional, as using
59 gnulib modules can require slightly different sourcecode (like including
60 different headers).
61
62 We just didn't do that yet because there aren't so many packages where
63 libgnu.a really helps.
64
65 When I stopped with portage-utils for solaris9, IIRC it required
66 scandir&co, which was (is?) missing in gnulib[1]. But things seem to
67 have changed since.
68
69 [1] http://lists.gnu.org/archive/html/bug-gnulib/2008-09/msg00148.html
70
71 /haubi/
72 --
73 Michael Haubenwallner
74 Gentoo on a different level