Browse Source

iconv: Do not include __iconv_codesets into iconv utility

Host iconv needs only L_iconv_main defined and __iconv_codesets
has to included, as host system does not provide it.
Keep __iconv_codesets out of iconv linked against uClibc.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
d46dc8bc88
3 changed files with 10 additions and 3 deletions
  1. 3 0
      libc/misc/wchar/wchar.c
  2. 1 2
      utils/Makefile.in
  3. 6 1
      utils/iconv.c

+ 3 - 0
libc/misc/wchar/wchar.c

@@ -1196,6 +1196,9 @@ libc_hidden_proto(__iconv_codesets)
 #endif
 
 #if defined L_iconv || defined L_iconv_main
+# ifdef L_iconv_main
+static
+# endif
 const unsigned char __iconv_codesets[] =
 	"\x0a\xe0""WCHAR_T\x00"		/* superset of UCS-4 but platform-endian */
 #if __BYTE_ORDER == __BIG_ENDIAN

+ 1 - 2
utils/Makefile.in

@@ -36,8 +36,7 @@ CFLAGS-ldd := $(CFLAGS-utils-shared) -DBUILDING_LINKAGE
 # Need CFLAGS-utils explicitly, because the source file is not located in utils
 CFLAGS-iconv := $(CFLAGS-utils) \
     $(CFLAGS-utils-shared) \
-    -I$(top_srcdir)libc/misc/wchar \
-    -DL_iconv_main \
+    -I$(top_srcdir)libc/misc/wchar
 
 CFLAGS-locale := $(CFLAGS-utils)
 CFLAGS-getconf :=$(CFLAGS-utils) \

+ 6 - 1
utils/iconv.c

@@ -108,7 +108,12 @@
 #include <wchar.h>
 #include "wchar.c" /* for _UC_iconv_t and __iconv_codesets */
 
-extern const unsigned char __iconv_codesets[];
+#ifdef L_iconv_main
+static
+#else
+extern
+#endif
+const unsigned char __iconv_codesets[];
 
 #define IBUF BUFSIZ
 #define OBUF BUFSIZ