/intl/tst-gettext.sh

https://github.com/nitinkamble/x32-glibc · Shell · 59 lines · 26 code · 11 blank · 22 comment · 1 complexity · c3b0e4846b6203456f83327bc33c04f7 MD5 · raw file

  1. #! /bin/sh
  2. # Test of gettext functions.
  3. # Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
  4. # This file is part of the GNU C Library.
  5. #
  6. # The GNU C Library is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public
  8. # License as published by the Free Software Foundation; either
  9. # version 2.1 of the License, or (at your option) any later version.
  10. # The GNU C Library is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Lesser General Public License for more details.
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with the GNU C Library; if not, write to the Free
  16. # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  17. # 02111-1307 USA.
  18. common_objpfx=$1
  19. objpfx=$2
  20. malloc_trace=$3
  21. LC_ALL=C
  22. export LC_ALL
  23. # Generate the test data.
  24. # Create the locale directories.
  25. mkdir -p ${objpfx}localedir/existing-locale/LC_MESSAGES
  26. for f in ADDRESS COLLATE CTYPE IDENTIFICATION MEASUREMENT MONETARY NAME NUMERIC PAPER TELEPHONE TIME; do
  27. cp -f ${common_objpfx}localedata/de_DE.UTF-8/LC_$f \
  28. ${objpfx}localedir/existing-locale
  29. done
  30. cp -f ${common_objpfx}localedata/de_DE.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES \
  31. ${objpfx}localedir/existing-locale/LC_MESSAGES
  32. # Create the domain directories.
  33. mkdir -p ${objpfx}domaindir/existing-locale/LC_MESSAGES
  34. mkdir -p ${objpfx}domaindir/existing-locale/LC_TIME
  35. # Populate them.
  36. msgfmt -o ${objpfx}domaindir/existing-locale/LC_MESSAGES/existing-domain.mo \
  37. -f ../po/de.po
  38. msgfmt -o ${objpfx}domaindir/existing-locale/LC_TIME/existing-time-domain.mo \
  39. -f ../po/de.po
  40. GCONV_PATH=${common_objpfx}iconvdata
  41. export GCONV_PATH
  42. LOCPATH=${common_objpfx}localedata
  43. export LOCPATH
  44. # Now run the test.
  45. MALLOC_TRACE=$malloc_trace LOCPATH=${objpfx}localedir:$LOCPATH \
  46. ${common_objpfx}elf/ld.so --library-path $common_objpfx \
  47. ${objpfx}tst-gettext > ${objpfx}tst-gettext.out ${objpfx}domaindir
  48. exit $?