8sa1-gcc/gcc/exgettext
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00

119 lines
3.1 KiB
Bash
Executable File

#! /bin/sh
# Wrapper around gettext for GCC sources.
# Copyright 1998 Free Software Foundation, Inc.
# Written by Paul Eggert <eggert@twinsun.com>.
# This file is part of GCC.
# GCC is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
# GCC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING. If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Set environment to default value, if not already set.
: ${AWK=awk}
# The argument to this wrapper is the xgettext command to be executed.
# Extract the xgettext program name from the rest of the command.
xgettext=${1?}
shift
# Save work if we're just wrapping a no-op.
case $xgettext in
:) exit;;
esac
# Find the files to be scanned, and the directory to scan them from.
directory=.
files=
for i
do
case $i in
--directory=*)
directory=`expr " $i" : ' --directory=\(.*\)'`;;
--files-from=*)
files_from=`expr " $i" : ' --files-from=\(.*\)'`
files=`$AWK '/^[^#]/ { print }' $files_from`;;
esac
done
# Generate keyword options for xgettext,
# by scanning for declarations of functions
# whose parameter names end in "msgid".
generate_keyword_options='
/^[A-Z_a-z].*\(.*msgid[,)]/ {
paren_index = index($0, "(")
name = substr($0, 1, paren_index - 1)
sub(/[^0-9A-Z_a-z]*$/, "", name)
sub(/[ ]+PARAMS/, "", name)
sub(/[ ]+VPARAMS/, "", name)
sub(/.*[^0-9A-Z_a-z]/, "", name)
args = substr($0, paren_index)
sub(/msgid[,)].*/, "", args)
for (n = 1; sub(/^[^,]*,/, "", args); n++) {
continue;
}
if (n == 1) {
keyword = name
} else {
keyword = name ":" n
}
if (! keyword_seen[keyword]++) {
print "--keyword=" keyword
}
}
'
keyword_options=`(
cd $directory &&
$AWK "$generate_keyword_options" $files < /dev/null
)` || exit
# Generate temporary file reflecting the %e strings in the scanned files.
tmp=tmp-emsgids.c
generate_emsgids='
/%e.*}/ {
line = $0
while ((percent_index = index(line, "%e")) != 0) {
line = substr(line, percent_index + 2)
bracket_index = index(line, "}")
if (bracket_index == 0) {
continue
}
msgid = substr(line, 1, bracket_index - 1)
if (index(msgid, "%") != 0) {
continue
}
printf "#line %d \"%s\"\n", FNR, FILENAME
printf "_(\"%s\")\n", msgid
line = substr(line, bracket_index + 1)
}
}
'
(cd $directory &&
$AWK "$generate_emsgids" $files < /dev/null
) > $directory/$tmp || exit
# Run the xgettext command, with temporary added as a file to scan.
"$xgettext" $keyword_options ${1+"$@"} $tmp || exit
# Clean up.
# If we don't get here, `make clean' will remove this file later.
rm -f $directory/$tmp