README 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. Warning!!! Warning!!! Warning!!! Warning!!! Warning!!! Warning!!!
  2. Warning!!! Warning!!! Warning!!! Warning!!! Warning!!! Warning!!!
  3. The programs in this directory are strictly cut-and-paste hack jobs to
  4. extract the data I needed from glibc's locale database. I'm ashamed to
  5. even let them into the light of day, and I consider them complete garbage.
  6. However, they are currently necessary to build the data needed for the
  7. locale support I've implemented, so I'm forced to include them here.
  8. NOTE: While its possible to use this stuff for native != target arch,
  9. you'll have to either write a converter to account for endianess and
  10. struct padding issues, or run the mmap file generator on your target
  11. arch. But all these programs will be rewritten at some point.
  12. All that being said, LC_CTYPE support has been added and supports the
  13. ctype.h and wctype.h function. Also, LC_TIME, LC_MONETARY, LC_NUMERIC,
  14. and LC_MESSAGES are supported wrt SUSv3. localeconv() works in both
  15. real and stub locale modes. nl_langinfo() currently only works with
  16. real locales enabled. That will be fixed though. wc->mb unsupported
  17. char replacement and basic translit support is on the way as well.
  18. Finally, some basic 8-bit codeset LC_COLLATE support should be in place
  19. in the next week or two (similar to what was in the previous locale
  20. implementation).
  21. Also, as one can probably guess, I'm working towards having the locale
  22. data accessed via a shared mmap. That will allow non-mmu platforms
  23. to use this without the current bloat.
  24. Currently, the output of size for my locale_data.o file is
  25. text data bss dec hex filename
  26. 59072 4 0 59076 e6c4 extra/locale/locale_data.o
  27. which is for the C locale (automatic of course) + all codesets in
  28. charmaps/ and all 268 locales in LOCALES. I estimate that the
  29. translit support for those 8-bit codesets will add another 7-10k.
  30. One difference of note is that the special case upper/lower mappings
  31. in the turkish locale are currently not implemented. That will be
  32. fixed.
  33. Manuel
  34. Warning!!! Warning!!! Warning!!! Warning!!! Warning!!! Warning!!!
  35. Warning!!! Warning!!! Warning!!! Warning!!! Warning!!! Warning!!!
  36. 1) In the toplevel dir, 'make headers'.
  37. 2) Create a codesets.txt file in this dir listing the codesets you want
  38. to support. The easiest way to do this is to edit the output of
  39. 'find ./charmaps -name "*.pairs" > codesets.txt'.
  40. NOTE: UTF-8 support is always included if you build with wide chars enabled.
  41. NOTE: The files in charmaps/ were created from glibc's charmap files
  42. with the awk script at the end of this file. You can add others
  43. but only single byte codesets are supported.
  44. 3) Create a locales.txt file to select the locales you want to support.
  45. You can copy and edit the LOCALES file for example. Other locales could
  46. added provided you've included the appropriate codesets in step 2.
  47. NOTE: You have to have the approprite locales available for glibc!
  48. 4) Run make here.
  49. 5) Continue building uClibc from the toplevel dir.
  50. Script used to generate the charmaps/*.pairs files:
  51. cat $1 | awk 'BEGIN { i = 0 } ; { if ($1 == "CHARMAP") i=1 ; else if ($1 == "END") i=0 ; else if (i==1) { sub("/","0",$2) ; sub("<U","0x",$1) ; sub(">","",$1) ; print "{", $2, ",", $1, "}," } }'