1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test that gettext() in multithreaded applications works correctly if 5# different threads operate in different locales with the same encoding. 6 7# Let's use two UTF-8 locales that configure already checked for: 8# French and German. 9 10test -d in-th-2 || mkdir in-th-2 11test -d in-th-2/fr || mkdir in-th-2/fr 12test -d in-th-2/fr/LC_MESSAGES || mkdir in-th-2/fr/LC_MESSAGES 13test -d in-th-2/de || mkdir in-th-2/de 14test -d in-th-2/de/LC_MESSAGES || mkdir in-th-2/de/LC_MESSAGES 15 16: ${MSGFMT=msgfmt} 17${MSGFMT} -o in-th-2/fr/LC_MESSAGES/tstthread.mo "$wabs_srcdir"/intl-thread-2-1.po 18${MSGFMT} -o in-th-2/de/LC_MESSAGES/tstthread.mo "$wabs_srcdir"/intl-thread-2-2.po 19 20: ${DIFF=diff} 21cat <<EOF > in-th-2.ok 22beauté 23Schönheit 24beauté 25Schönheit 26EOF 27 28: ${LOCALE_FR_UTF8=fr_FR.UTF-8} 29: ${LOCALE_DE_UTF8=de_DE.UTF-8} 30if test $LOCALE_FR_UTF8 != none && test $LOCALE_DE_UTF8 != none; then 31 prepare_locale_ in-th-2/fr in-th-2/$LOCALE_FR_UTF8 32 prepare_locale_ in-th-2/de in-th-2/$LOCALE_DE_UTF8 33 ../intl-thread-2-prg $LOCALE_FR_UTF8 $LOCALE_DE_UTF8 > in-th-2.out 34 case $? in 35 0) 36 ${DIFF} in-th-2.ok in-th-2.out || Exit 1 37 ;; 38 77) 39 echo "Skipping test: POSIX per-thread locales not supported" 40 Exit 77 41 ;; 42 *) 43 Exit 1 44 ;; 45 esac 46else 47 if test -f /usr/bin/localedef; then 48 echo "Skipping test: no french and german locales are installed" 49 else 50 echo "Skipping test: no french and german locales are supported" 51 fi 52 Exit 77 53fi 54 55Exit 0 56