#! /bin/sh

# Test C support: --trigraphs option.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles xg-c-4.in.c"
cat <<EOF > xg-c-4.in.c
main()??<printf(gettext("Hello, " "World!" "??/n")); ??>
EOF

tmpfiles="$tmpfiles xg-c-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --trigraphs -d xg-c-4 xg-c-4.in.c
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles xg-c-4.ok"
cat <<EOF > xg-c-4.ok
#, c-format
msgid "Hello, World!\n"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-4.ok xg-c-4.po
result=$?

rm -fr $tmpfiles

exit $result
