aboutsummaryrefslogtreecommitdiff
path: root/gcc/po/exgettext
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-06-06 21:31:40 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-06-06 21:31:40 +0200
commit4b794eaf73ef8df7689d1e9de146e00398f2d1fd (patch)
treec8a8fb885e6d7542f092ff09cfbce8b498ccf63e /gcc/po/exgettext
parent6be74c4f5c988270ef3e4d4664a15b2b2e205f9a (diff)
downloadgcc-4b794eaf73ef8df7689d1e9de146e00398f2d1fd.zip
gcc-4b794eaf73ef8df7689d1e9de146e00398f2d1fd.tar.gz
gcc-4b794eaf73ef8df7689d1e9de146e00398f2d1fd.tar.bz2
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format.
gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676
Diffstat (limited to 'gcc/po/exgettext')
-rw-r--r--gcc/po/exgettext55
1 files changed, 45 insertions, 10 deletions
diff --git a/gcc/po/exgettext b/gcc/po/exgettext
index 3408cb7..40c6463 100644
--- a/gcc/po/exgettext
+++ b/gcc/po/exgettext
@@ -43,6 +43,12 @@ xgettext=$1
package=$2
srcdir=$3
+case `$xgettext --version | sed -e 1q | sed -e 's/^\([^0-9]*\)//'` in
+ 0.14.[5-9]* | 0.14.[1-9][0-9]* | 0.1[5-9]* | 0.[2-9][0-9]* | [1-9].*) : ;;
+ *) echo "$xgettext is too old. GNU xgettext 0.14.5 is required"
+ exit 1 ;;
+esac
+
nl='
'
@@ -55,8 +61,12 @@ trap "rm -r $T" 0
pwd=`${PWDCMD-pwd}`
kopt=$pwd/$T/keyword-options
+kopt2=$pwd/$T/keyword2-options
emsg=$pwd/$T/emsgids.c
posr=$pwd/$T/po-sources
+pottmp1=$pwd/$T/tmp1.pot
+pottmp2=$pwd/$T/tmp2.pot
+pottmp=$pwd/$T/tmp.pot
# Locate files to scan, and generate the list. All .c, .h, and .def files
# in $srcdir are examined, likewise $srcdir/config and $srcdir/config/*
@@ -81,7 +91,7 @@ echo "scanning for keywords and %e strings..." >&2
done
done;
} | tr ' ' "$nl" | grep -v '\*' |
- $AWK -v excl=po/EXCLUDES -v posr=$posr -v kopt=$kopt -v emsg=$emsg '
+ $AWK -v excl=po/EXCLUDES -v posr=$posr -v kopt=$kopt -v kopt2=$kopt2 -v emsg=$emsg '
function keyword_option(line) {
paren_index = index(line, "(")
name = substr(line, 1, paren_index - 1)
@@ -95,12 +105,28 @@ function keyword_option(line) {
for (n = 1; sub(/^[^,]*,/, "", args); n++) {
continue
}
+ format=""
+ if (args ~ /g$/)
+ format="gcc-internal-format"
+ else if (args ~ /c$/)
+ format="c-format"
+
+ if (n == 1) { keyword = "--keyword=" name }
+ else { keyword = "--keyword=" name ":" n }
+ if (format) {
+ keyword=keyword "\n--flag=" name ":" n ":" format
+ }
- if (n == 1) { keyword = name }
- else { keyword = name ":" n }
-
- if (! keyword_seen[keyword]++) {
- print "--keyword=" keyword > kopt
+ if (! keyword_seen[name]) {
+ if (format == "gcc-internal-format")
+ print keyword > kopt2
+ else
+ print keyword > kopt
+ keyword_seen[name] = keyword
+ } else if (keyword_seen[name] != keyword) {
+ printf("%s used incompatibly as both %s and %s\n",
+ name, keyword_seen[name], keyword)
+ exit (1)
}
}
@@ -155,7 +181,7 @@ END {
}
print emsg > posr
}'
-)
+) || exit
echo "scanning option files..." >&2
@@ -186,7 +212,16 @@ $xgettext --default-domain=$package --directory=$srcdir \
--add-comments `cat $kopt` --files-from=$posr \
--copyright-holder="Free Software Foundation, Inc." \
--msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
- --language=c -o po/$package.pot.tmp
+ --language=c -o $pottmp1
+$xgettext --default-domain=$package --directory=$srcdir \
+ --add-comments --keyword= `cat $kopt2` --files-from=$posr \
+ --copyright-holder="Free Software Foundation, Inc." \
+ --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
+ --language=GCC-source -o $pottmp2
+$xgettext --default-domain=$package \
+ --add-comments $pottmp1 $pottmp2 \
+ --copyright-holder="Free Software Foundation, Inc." \
+ --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
+ --language=PO -o $pottmp
# Remove local paths from .pot file.
-sed "s:$srcdir/::g;s:$pwd/::g;" <po/$package.pot.tmp >po/$package.pot
-rm po/$package.pot.tmp
+sed "s:$srcdir/::g;s:$pwd/::g;" <$pottmp >po/$package.pot