Commit 1a7b32a3 by Zack Weinberg Committed by Zack Weinberg

exgettext: Merge changes from diffutils.

	* exgettext: Merge changes from diffutils.  Scan .def files in
	addition to .c and .h.  Add --language=c to xgettext command line.

From-SVN: r49121
parent 333c8841
2002-01-22 Zack Weinberg <zack@codesourcery.com>
* exgettext: Merge changes from diffutils. Scan .def files in
addition to .c and .h. Add --language=c to xgettext command line.
2001-12-05 Martin v. Lwis <loewis@informatik.hu-berlin.de> 2001-12-05 Martin v. Lwis <loewis@informatik.hu-berlin.de>
* es.po: Update to 3.0 template. * es.po: Update to 3.0 template.
......
#! /bin/sh #! /bin/sh
# Wrapper around gettext for GCC sources. # Wrapper around gettext for programs using the msgid convention.
# Copyright 1998, 2001 Free Software Foundation, Inc. # Copyright 1998, 2001, 2002 Free Software Foundation, Inc.
# Written by Paul Eggert <eggert@twinsun.com>. # Written by Paul Eggert <eggert@twinsun.com>.
# Revised by Zack Weinberg <zackw@stanford.edu> for no-POTFILES operation. # Revised by Zack Weinberg <zackw@stanford.edu> for no-POTFILES operation.
# This file is part of GNU CC. # This program is free software; you can redistribute it and/or modify
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2, or (at your option)
# any later version. # any later version.
# GNU CC is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
...@@ -22,8 +20,14 @@ ...@@ -22,8 +20,14 @@
# the Free Software Foundation, 59 Temple Place - Suite 330, # the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA. # Boston, MA 02111-1307, USA.
# Set environment to default value, if not already set. # Always operate in the C locale.
: ${AWK=awk} LANG=C
LANGUAGE=C
LC_ALL=C
export LANG LANGUAGE LC_ALL
# Set AWK if environment has not already set it.
AWK=${AWK-awk}
# The arguments to this wrapper are: the program to execute, the # The arguments to this wrapper are: the program to execute, the
# name of the "package", and the path to the source directory. # name of the "package", and the path to the source directory.
...@@ -52,8 +56,8 @@ kopt=$pwd/$T/keyword-options ...@@ -52,8 +56,8 @@ kopt=$pwd/$T/keyword-options
emsg=$pwd/$T/emsgids.c emsg=$pwd/$T/emsgids.c
posr=$pwd/$T/po-sources posr=$pwd/$T/po-sources
# Locate files to scan, and generate the list. All .c and .h files in # Locate files to scan, and generate the list. All .c, .h, and .def files
# $srcdir are examined, likewise $srcdir/config and $srcdir/config/* # in $srcdir are examined, likewise $srcdir/config and $srcdir/config/*
# (directories). Also, all subdirectories of $srcdir that contain a # (directories). Also, all subdirectories of $srcdir that contain a
# config-lang.in. Exclusions come from $srcdir/po/EXCLUDE. # config-lang.in. Exclusions come from $srcdir/po/EXCLUDE.
# #
...@@ -68,14 +72,12 @@ posr=$pwd/$T/po-sources ...@@ -68,14 +72,12 @@ posr=$pwd/$T/po-sources
echo "scanning for keywords and %e strings..." >&2 echo "scanning for keywords and %e strings..." >&2
( cd $srcdir ( cd $srcdir
lang_subdirs=`echo */config-lang.in | sed -e 's|/config-lang\.in||g'` lang_subdirs=`echo */config-lang.in | sed -e 's|config-lang\.in||g'`
{ echo *.[ch] for dir in "" config/ config/*/ $lang_subdirs
echo config/*.[ch] do for glob in '*.c' '*.h' '*.def'
echo config/*/*.[ch] do eval echo $dir$glob
for l in $lang_subdirs done
do echo $l/*.[ch] done | tr ' ' "$nl" | grep -v '\*' |
done
} | tr ' ' "$nl" |
$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 emsg=$emsg '
function keyword_option(line) { function keyword_option(line) {
paren_index = index(line, "(") paren_index = index(line, "(")
...@@ -153,4 +155,4 @@ END { ...@@ -153,4 +155,4 @@ END {
echo "running xgettext..." >&2 echo "running xgettext..." >&2
$xgettext --default-domain=$package --directory=$srcdir \ $xgettext --default-domain=$package --directory=$srcdir \
--add-comments `cat $kopt` --files-from=$posr \ --add-comments `cat $kopt` --files-from=$posr \
-o po/$package.pot --language=c -o po/$package.pot
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment