* use of iconv() in main.c
@ 2005-05-19 6:25 Robert Urban
2005-05-19 6:25 ` Robert Urban
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Robert Urban @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hello,
I'm building an embedded linux system using uClibc, which by default
does not have locale support. In order to build lm_sensors-2.8.7
I had to comment out the code that refers to iconv() in set_degstr() (in
main.c), as well as the "#include <iconv.h>" line.
It might save others a bit of trouble if you made the use of locales
an option...
thanks for lm_sensors, by the way!
cheers,
Rob Urban
Munich, Germany
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
` (3 preceding siblings ...)
2005-05-19 6:25 ` Robert Urban
@ 2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
> I'm building an embedded linux system using uClibc, which by default
> does not have locale support. In order to build lm_sensors-2.8.7
> I had to comment out the code that refers to iconv() in set_degstr()
> (in main.c), as well as the "#include <iconv.h>" line.
>
> It might save others a bit of trouble if you made the use of locales
> an option...
Is there a way we could detect the use of uClibc? If there is a known #define,
we could use it to automatically disable the use of iconv.
Thanks.
--
Jean "Khali" Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
@ 2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Robert Urban
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Robert Urban @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
You wrote:
> > I'm building an embedded linux system using uClibc, which by default
> > does not have locale support. In order to build lm_sensors-2.8.7
> > I had to comment out the code that refers to iconv() in set_degstr()
> > (in main.c), as well as the "#include <iconv.h>" line.
> >
> > It might save others a bit of trouble if you made the use of locales
> > an option...
>
> Is there a way we could detect the use of uClibc? If there is a known #define,
> we could use it to automatically disable the use of iconv.
In the case of cross-compiling, there is probably a way of detecting it's use.
However, I'm using a chroot-environment and then just running make
with the defaults.
Rob Urban
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Robert Urban
@ 2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Robert Urban
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
> > Is there a way we could detect the use of uClibc? If there is a known
> > #define, we could use it to automatically disable the use of iconv.
>
> In the case of cross-compiling, there is probably a way of detecting
> it's use. However, I'm using a chroot-environment and then just
> running make with the defaults.
I was thinking of a test like this within the C source code:
#if defined(__GLIBC__) && __GLIBC__ = 2
#include <something>
#endif
We have this for detecting glibc 2.x. Maybe there is a similar symbol defined
for uClib? If there is, we could rely on it to automatically disable the use
of iconv. This would work for both the cross-compilation and the
chroot-environment cases.
For glibc 2.3, the symbol is defined in include/features.h. Could you please
take a look at this file (or any other you see fit) in your uClibc compilation
environment and search for a similar line? If you find something relevant, let
us know.
Thanks,
--
Jean "Khali" Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
2005-05-19 6:25 ` Robert Urban
@ 2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Jean Delvare
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Robert Urban @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hi Jean,
it looks like __UCLIBC__ is what you're looking for.
from my /usr/include/features.h:
[...]
/* This macro indicates that the installed library is uClibc. Use
* __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in
* specific releases. */
#define __UCLIBC__ 1
thanks for your trouble. Let me know if you'd like to have the
whole features.h file.
cheers,
Rob Urban
You wrote:
>
> > > Is there a way we could detect the use of uClibc? If there is a known
> > > #define, we could use it to automatically disable the use of iconv.
> >
> > In the case of cross-compiling, there is probably a way of detecting
> > it's use. However, I'm using a chroot-environment and then just
> > running make with the defaults.
>
> I was thinking of a test like this within the C source code:
> #if defined(__GLIBC__) && __GLIBC__ = 2
> #include <something>
> #endif
>
> We have this for detecting glibc 2.x. Maybe there is a similar symbol defined
> for uClib? If there is, we could rely on it to automatically disable the use
> of iconv. This would work for both the cross-compilation and the
> chroot-environment cases.
>
> For glibc 2.3, the symbol is defined in include/features.h. Could you please
> take a look at this file (or any other you see fit) in your uClibc compilation
> environment and search for a similar line? If you find something relevant, let
> us know.
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
` (2 preceding siblings ...)
2005-05-19 6:25 ` Jean Delvare
@ 2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
5 siblings, 0 replies; 7+ messages in thread
From: Robert Urban @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hi Jean,
shortly after you sent this mail the hard disk on which my OS resode
died. I will try to test your patch in the next few days and get
back to you.
cheers,
Rob Urban
You wrote:
>
> > it looks like __UCLIBC__ is what you're looking for.
>
> OK. Care to test the attached patch? It should skip iconv completely when
> uclibc is used.
>
> If it works OK I'll commit it to our repository.
>
> Thanks.
>
> --
> Jean "Khali" Delvare
> http://khali.linux-fr.org/
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* use of iconv() in main.c
2005-05-19 6:25 use of iconv() in main.c Robert Urban
` (4 preceding siblings ...)
2005-05-19 6:25 ` Jean Delvare
@ 2005-05-19 6:25 ` Jean Delvare
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hi Robert,
> > OK. Care to test the attached patch? It should skip iconv completely
> > when uclibc is used.
> >
> > If it works OK I'll commit it to our repository.
>
> shortly after you sent this mail the hard disk on which my OS resode
> died. I will try to test your patch in the next few days and get
> back to you.
Any news? I need your confirmation that it works OK for you before I can
apply the patch to our CVS repository.
Thanks.
--
Jean Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-05-19 6:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 6:25 use of iconv() in main.c Robert Urban
2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Robert Urban
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.