From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-embedded+bounces-3482-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1OKgsx-0001Gs-Qa
	for garchives@archives.gentoo.org; Sat, 05 Jun 2010 00:05:12 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6FB83E0F2A
	for <garchives@archives.gentoo.org>; Sat,  5 Jun 2010 00:05:11 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 1A68AE0815
	for <gentoo-embedded@lists.gentoo.org>; Fri,  4 Jun 2010 23:20:48 +0000 (UTC)
Received: from [192.168.1.2] (dsl081-240-085.sfo1.dsl.speakeasy.net [64.81.240.85])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTP id 8F1A51B4019
	for <gentoo-embedded@lists.gentoo.org>; Fri,  4 Jun 2010 23:20:47 +0000 (UTC)
Subject: Re: [gentoo-embedded] ref bug 297229 (virutal/libiconv vs
 sys-libs/uclibc[iconv] vs sys-devel/gcc)
From: solar <solar@gentoo.org>
To: gentoo-embedded@lists.gentoo.org
In-Reply-To: <4C08E724.3080605@wildgooses.com>
References: <4C078710.8060808@wildgooses.com>
	 <1275606120.2949.3.camel@hangover>  <4C08E724.3080605@wildgooses.com>
Content-Type: text/plain
Organization: Gentoo Linux
Date: Fri, 04 Jun 2010 16:20:45 -0700
Message-Id: <1275693645.5301.2.camel@here>
Precedence: bulk
List-Post: <mailto:gentoo-embedded@lists.gentoo.org>
List-Help: <mailto:gentoo-embedded+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-embedded+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-embedded+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-embedded.gentoo.org>
X-BeenThere: gentoo-embedded@lists.gentoo.org
Reply-to: gentoo-embedded@lists.gentoo.org
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 
Content-Transfer-Encoding: 7bit
X-Archives-Salt: eecc5d65-2b42-4bdb-a90b-7a2945b4e051
X-Archives-Hash: a9ac5af7fe04832f00f461d36b88e6e3

On Fri, 2010-06-04 at 12:44 +0100, Ed W wrote:
> On 04/06/2010 00:02, Ned Ludd wrote:
> > On Thu, 2010-06-03 at 11:42 +0100, Ed W wrote:
> > [snip]
> >
> >    
> >> I guess the real question here is what's the best way to build glib
> >> under uclibc? Recommendations please?
> >>
> >>      
> >
> > mini-iconv.c
> 
> Do you have a recipe for this?  I have built a couple of things using 
> mini-iconv.c now and it seems often to need a bit of hacking of config 
> files more than anything else.  I don't recall exactly what came up with 
> glib, but it seemed like a much harder problem - from memory I believe 
> it also had a required dependency on gettext that seemed unavoidable? (I 
> gave up at that point I think?)
> 
> 
> > or fake it.
> >    
> 
> See now, I'm still missing the bigger picture here.  I'm still not sure 
> I understand why I don't just do this "properly" and either use iconv in 
> uclibc or libiconv (and gettext)?  Is there anything "bad" in having 
> libiconv installed other than it becoming an accidently gcc dep? (And is 
> that an unmanageable situation?)


I avoid gettext 100% in my uClibc env by using the following stub
macros.


uClibc env.d # cat /usr/include/libintl.h 
#ifndef _LIBINTL_H
#define _LIBINTL_H      1

#include <features.h>

#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_GETTEXT_AWARENESS__)
/* Stubs for gettext/locale bullshit... */
#undef gettext
#undef dgettext
#undef dcgettext
#undef ngettext
#undef dngettext
#undef dcngettext
#undef textdomain
#undef bindtextdomain
#undef bind_textdomain_codeset
/* this fucker seems to be installed  in /usr/include/locale.h */
/* #undef setlocale */
#undef _
#undef N_

#define gettext(String) (String)
#define dgettext(Domain, String) (String)
#define dcgettext(Domain, String, Type) (String)
#define ngettext(Singular, Plural, Count) ((Count) == 1 ? (const char *)
(Singular) : (const char *) (Plural))
#define dngettext(Domain, Singular, Plural, Count) ((Count) == 1 ?
(const char *) (Singular) : (const char *) (Plural))
#define dcngettext(Domain, Singular, Plural, Count, Category) ((Count)
== 1 ? (const char *) (Singular) : (const char *) (Plural))
#define dgettext(Domain, String) (String)
#define dcgettext(Domain, String, Type) (String)

#ifndef _LOCALE_H
/* #define setlocale(Category, Locale) ((char *)NULL) */
#endif

#define bindtextdomain(Domain, Directory) (Domain)
#define bind_textdomain_codeset(Domain, Codeset)
#define textdomain(String)

#define _(String) (String)
#define N_(String) (String)

#endif  /* GETTEXT */
#endif  /* _LIBINTL_H */