1#! /bin/sh 2 3# Test that on glibc systems, gettext() in multithreaded applications works 4# correctly if different threads operate in different locales referring to 5# the same catalog file but with different encodings. 6 7tmpfiles="" 8trap 'rm -fr $tmpfiles' 1 2 3 15 9 10# This test works only on glibc systems. 11: ${GLIBC2=no} 12test "$GLIBC2" = yes || { 13 echo "Skipping test: not a glibc system" 14 exit 77 15} 16 17# This test works only on systems that have a de_DE.ISO-8859-1 and 18# de_DE.UTF-8 locale installed. 19LC_ALL=de_DE.ISO-8859-1 ./testlocale || { 20 if test -f /usr/bin/localedef; then 21 echo "Skipping test: locale de_DE.ISO-8859-1 not installed" 22 else 23 echo "Skipping test: locale de_DE.ISO-8859-1 not supported" 24 fi 25 exit 77 26} 27LC_ALL=de_DE.UTF-8 ./testlocale || { 28 if test -f /usr/bin/localedef; then 29 echo "Skipping test: locale de_DE.UTF-8 not installed" 30 else 31 echo "Skipping test: locale de_DE.UTF-8 not supported" 32 fi 33 exit 77 34} 35 36tmpfiles="$tmpfiles de_DE" 37test -d de_DE || mkdir de_DE 38test -d de_DE/LC_MESSAGES || mkdir de_DE/LC_MESSAGES 39 40: ${MSGFMT=msgfmt} 41${MSGFMT} -o de_DE/LC_MESSAGES/tstthread.mo ${top_srcdir}/tests/gettext-7.po 42 43tmpfiles="$tmpfiles gt-7.out" 44./gettext-7-prg > gt-7.out 45case $? in 46 0) ;; 47 77) 48 echo "Skipping test: not a glibc 2.3 system" 49 rm -fr $tmpfiles; exit 77 50 ;; 51esac 52 53rm -fr $tmpfiles 54 55exit 0 56