Gentoo Archives: gentoo-embedded

From: solar <solar@g.o>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] ref bug 297229 (virutal/libiconv vs sys-libs/uclibc[iconv] vs sys-devel/gcc)
Date: Sat, 05 Jun 2010 00:05:12
Message-Id: 1275693645.5301.2.camel@here
In Reply to: Re: [gentoo-embedded] ref bug 297229 (virutal/libiconv vs sys-libs/uclibc[iconv] vs sys-devel/gcc) by Ed W
1 On Fri, 2010-06-04 at 12:44 +0100, Ed W wrote:
2 > On 04/06/2010 00:02, Ned Ludd wrote:
3 > > On Thu, 2010-06-03 at 11:42 +0100, Ed W wrote:
4 > > [snip]
5 > >
6 > >
7 > >> I guess the real question here is what's the best way to build glib
8 > >> under uclibc? Recommendations please?
9 > >>
10 > >>
11 > >
12 > > mini-iconv.c
13 >
14 > Do you have a recipe for this? I have built a couple of things using
15 > mini-iconv.c now and it seems often to need a bit of hacking of config
16 > files more than anything else. I don't recall exactly what came up with
17 > glib, but it seemed like a much harder problem - from memory I believe
18 > it also had a required dependency on gettext that seemed unavoidable? (I
19 > gave up at that point I think?)
20 >
21 >
22 > > or fake it.
23 > >
24 >
25 > See now, I'm still missing the bigger picture here. I'm still not sure
26 > I understand why I don't just do this "properly" and either use iconv in
27 > uclibc or libiconv (and gettext)? Is there anything "bad" in having
28 > libiconv installed other than it becoming an accidently gcc dep? (And is
29 > that an unmanageable situation?)
30
31
32 I avoid gettext 100% in my uClibc env by using the following stub
33 macros.
34
35
36 uClibc env.d # cat /usr/include/libintl.h
37 #ifndef _LIBINTL_H
38 #define _LIBINTL_H 1
39
40 #include <features.h>
41
42 #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_GETTEXT_AWARENESS__)
43 /* Stubs for gettext/locale bullshit... */
44 #undef gettext
45 #undef dgettext
46 #undef dcgettext
47 #undef ngettext
48 #undef dngettext
49 #undef dcngettext
50 #undef textdomain
51 #undef bindtextdomain
52 #undef bind_textdomain_codeset
53 /* this fucker seems to be installed in /usr/include/locale.h */
54 /* #undef setlocale */
55 #undef _
56 #undef N_
57
58 #define gettext(String) (String)
59 #define dgettext(Domain, String) (String)
60 #define dcgettext(Domain, String, Type) (String)
61 #define ngettext(Singular, Plural, Count) ((Count) == 1 ? (const char *)
62 (Singular) : (const char *) (Plural))
63 #define dngettext(Domain, Singular, Plural, Count) ((Count) == 1 ?
64 (const char *) (Singular) : (const char *) (Plural))
65 #define dcngettext(Domain, Singular, Plural, Count, Category) ((Count)
66 == 1 ? (const char *) (Singular) : (const char *) (Plural))
67 #define dgettext(Domain, String) (String)
68 #define dcgettext(Domain, String, Type) (String)
69
70 #ifndef _LOCALE_H
71 /* #define setlocale(Category, Locale) ((char *)NULL) */
72 #endif
73
74 #define bindtextdomain(Domain, Directory) (Domain)
75 #define bind_textdomain_codeset(Domain, Codeset)
76 #define textdomain(String)
77
78 #define _(String) (String)
79 #define N_(String) (String)
80
81 #endif /* GETTEXT */
82 #endif /* _LIBINTL_H */

Replies