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