From: Bruno Haible Date: Wed, 15 Aug 2001 12:27:39 +0000 (+0000) Subject: Reflect the real localedir in the manpages, not the default localedir. X-Git-Tag: v0.11~548 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b8a9ac3d575ecbe8f7cf528879cf47265cf59df;p=thirdparty%2Fgettext.git Reflect the real localedir in the manpages, not the default localedir. --- diff --git a/ChangeLog b/ChangeLog index cee016af3..ac7f5d414 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-07-28 Bruno Haible + + * configure.in (AC_OUTPUT): Add man/x-to-1. + 2001-07-26 Bruno Haible * configure.in (configure.in): Remove automake bug workarounds, not diff --git a/configure.in b/configure.in index 5199bf5ff..a406acc65 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) -AC_REVISION($Revision: 1.38 $) +AC_REVISION($Revision: 1.39 $) AC_INIT(src/msgfmt.c) AM_INIT_AUTOMAKE(gettext, 0.11) RELEASE_DATE=2001-05-23 dnl in "date +%Y-%m-%d" format @@ -105,5 +105,5 @@ $RELEASE_DATE GNU EOF AC_OUTPUT([Makefile lib/Makefile intl/Makefile src/Makefile po/Makefile.in \ - doc/Makefile man/Makefile tests/Makefile m4/Makefile \ + doc/Makefile man/Makefile man/x-to-1 tests/Makefile m4/Makefile \ misc/Makefile misc/gettextize]) diff --git a/man/ChangeLog b/man/ChangeLog index e0daebdec..c32181fea 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,24 @@ +2001-07-28 Bruno Haible + + * x-to-1.in: New file. + * Makefile.am (localedir): New variable. + (man_MAN1GEN, man_MAN1IN, man_MAN1OTHER, man_MAN3LINK, man_HTMLGEN, + man_HTMLIN, man_HTMLOTHER): New variables. + (EXTRA_DIST): Remove gettext.1, ngettext.1, gettext.1.html, + ngettext.1.html. Add gettext.1.in, ngettext.1.in, gettext.1.html.in, + ngettext.1.html.in. + (MAINTAINERCLEANFILES): Likewise. + (CLEANFILES): New variable. + (SUFFIXES): Remove variable. + (.x.1): Remove rule. + (gettext.1, ngettext.1, gettext.1.in, ngettext.1.in, msgcmp.1, + msgfmt.1, msgmerge.1, msgunfmt.1, xgettext.1, msgcat.1, msgcomm.1, + msgconv.1, msgen.1, msgexec.1, msggrep.1, msguniq.1): New rules. + (gettext.1.html.in, ngettext.1.html.in): New rules. + (gettext.1.html, ngettext.1.html): Generated from corresponding .in + files. + (*.1.html): Remove CreationDate line from MAN2HTML output. + 2001-07-21 Bruno Haible * msguniq.x: New file. diff --git a/man/Makefile.am b/man/Makefile.am index 96d3e0d09..f7e765bea 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -22,6 +22,8 @@ mandir = @mandir@ docdir = $(prefix)/doc/@PACKAGE@ htmldir = $(docdir) +localedir = $(datadir)/locale + AUTOMAKE_OPTIONS = 1.2 gnits # A manual page for each of the bin_PROGRAMS in src/Makefile.am. @@ -32,25 +34,31 @@ msgcat.x msgcomm.x msgconv.x msgen.x msgexec.x msggrep.x msguniq.x # Likewise, plus additional manual pages for the libintl functions. -man_MAN1 = gettext.1 ngettext.1 \ +man_MAN1GEN = gettext.1 ngettext.1 +man_MAN1IN = gettext.1.in ngettext.1.in +man_MAN1OTHER = \ msgcmp.1 msgfmt.1 msgmerge.1 msgunfmt.1 xgettext.1 \ msgcat.1 msgcomm.1 msgconv.1 msgen.1 msgexec.1 msggrep.1 msguniq.1 +man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER) man_MAN3 = gettext.3 ngettext.3 \ textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3 man_MAN3IN = gettext.3.in ngettext.3.in \ textdomain.3.in bindtextdomain.3.in bind_textdomain_codeset.3.in -man_MANS = $(man_MAN1) $(man_MAN3) \ -dgettext.3 dcgettext.3 dngettext.3 dcngettext.3 +man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3 +man_MANS = $(man_MAN1) $(man_MAN3) $(man_MAN3LINK) -man_HTML = gettext.1.html ngettext.1.html \ +man_HTMLGEN = gettext.1.html ngettext.1.html +man_HTMLIN = gettext.1.html.in ngettext.1.html.in +man_HTMLOTHER = \ msgcmp.1.html msgfmt.1.html msgmerge.1.html msgunfmt.1.html xgettext.1.html \ msgcat.1.html msgcomm.1.html msgconv.1.html msgen.1.html msgexec.1.html msggrep.1.html msguniq.1.html \ gettext.3.html ngettext.3.html \ textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html +man_HTML = $(man_HTMLGEN) $(man_HTMLOTHER) -EXTRA_DIST = help2man $(man_aux) $(man_MANS) $(man_MAN3IN) $(man_HTML) -MAINTAINERCLEANFILES = $(man_MAN1) $(man_MAN3) $(man_HTML) -SUFFIXES = .1 .x +EXTRA_DIST = help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER) +CLEANFILES = $(man_MAN1GEN) $(man_HTMLGEN) +MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER) PERL = @PERL@ RM = rm -f @@ -77,19 +85,43 @@ uninstall-local: uninstall-html # The progname.x files contain some extra information not found in the # "progname --help" output. -.x.1: - @progname=`basename $@ .1`; \ - executable=../src/$$progname; \ - case "$(PERL)" in *"/missing perl") perlok=no;; *) perlok=yes;; esac; \ - if test @CROSS_COMPILING@ = no && test -f $$executable && test $$perlok = yes; then \ - echo "Updating man page $@"; \ - echo "$(HELP2MAN) --include=$$progname.x $$executable > $$progname.1"; \ - rm -f t-$$progname.1; \ - $(HELP2MAN) --include=$$progname.x $$executable > t-$$progname.1 || exit 1; \ - mv t-$$progname.1 $$progname.1; \ - else \ - echo "WARNING: The man page $@ cannot be updated yet."; \ - fi + +gettext.1: gettext.1.in Makefile + sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in > t-$@ + mv t-$@ $@ +ngettext.1: ngettext.1.in Makefile + sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in > t-$@ + mv t-$@ $@ + +gettext.1.in: gettext.x + IN_HELP2MAN=1 $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/gettext$(EXEEXT) $(srcdir)/gettext.x gettext.1.in +ngettext.1.in: ngettext.x + IN_HELP2MAN=1 $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in + +msgcmp.1: msgcmp.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcmp$(EXEEXT) $(srcdir)/msgcmp.x msgcmp.1 +msgfmt.1: msgfmt.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgfmt$(EXEEXT) $(srcdir)/msgfmt.x msgfmt.1 +msgmerge.1: msgmerge.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgmerge$(EXEEXT) $(srcdir)/msgmerge.x msgmerge.1 +msgunfmt.1: msgunfmt.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgunfmt$(EXEEXT) $(srcdir)/msgunfmt.x msgunfmt.1 +xgettext.1: xgettext.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/xgettext$(EXEEXT) $(srcdir)/xgettext.x xgettext.1 +msgcat.1: msgcat.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcat$(EXEEXT) $(srcdir)/msgcat.x msgcat.1 +msgcomm.1: msgcomm.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcomm$(EXEEXT) $(srcdir)/msgcomm.x msgcomm.1 +msgconv.1: msgconv.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgconv$(EXEEXT) $(srcdir)/msgconv.x msgconv.1 +msgen.1: msgen.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgen$(EXEEXT) $(srcdir)/msgen.x msgen.1 +msgexec.1: msgexec.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgexec$(EXEEXT) $(srcdir)/msgexec.x msgexec.1 +msggrep.1: msggrep.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1 +msguniq.1: msguniq.x + $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1 # Depend on configure.in to get version number changes. $(man_MAN1): help2man $(top_srcdir)/configure.in @@ -115,62 +147,70 @@ bind_textdomain_codeset.3: bind_textdomain_codeset.3.in $(top_srcdir)/configure. html: $(man_HTML) -gettext.1.html: gettext.1 - $(MAN2HTML) `if test -f gettext.1; then echo .; else echo $(srcdir); fi`/gettext.1 > t-$@ +gettext.1.html: gettext.1.html.in Makefile + sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f gettext.1.html.in; then echo .; else echo $(srcdir); fi`/gettext.1.html.in > t-$@ + mv t-$@ $@ +ngettext.1.html: ngettext.1.html.in Makefile + sed -e 's|@''localedir''@|$(localedir)|g' < `if test -f ngettext.1.html.in; then echo .; else echo $(srcdir); fi`/ngettext.1.html.in > t-$@ + mv t-$@ $@ + +gettext.1.html.in: gettext.1.in + $(MAN2HTML) `if test -f gettext.1.in; then echo .; else echo $(srcdir); fi`/gettext.1.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ -ngettext.1.html: ngettext.1 - $(MAN2HTML) `if test -f ngettext.1; then echo .; else echo $(srcdir); fi`/ngettext.1 > t-$@ +ngettext.1.html.in: ngettext.1.in + $(MAN2HTML) `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ + msgcmp.1.html: msgcmp.1 - $(MAN2HTML) `if test -f msgcmp.1; then echo .; else echo $(srcdir); fi`/msgcmp.1 > t-$@ + $(MAN2HTML) `if test -f msgcmp.1; then echo .; else echo $(srcdir); fi`/msgcmp.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgfmt.1.html: msgfmt.1 - $(MAN2HTML) `if test -f msgfmt.1; then echo .; else echo $(srcdir); fi`/msgfmt.1 > t-$@ + $(MAN2HTML) `if test -f msgfmt.1; then echo .; else echo $(srcdir); fi`/msgfmt.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgmerge.1.html: msgmerge.1 - $(MAN2HTML) `if test -f msgmerge.1; then echo .; else echo $(srcdir); fi`/msgmerge.1 > t-$@ + $(MAN2HTML) `if test -f msgmerge.1; then echo .; else echo $(srcdir); fi`/msgmerge.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgunfmt.1.html: msgunfmt.1 - $(MAN2HTML) `if test -f msgunfmt.1; then echo .; else echo $(srcdir); fi`/msgunfmt.1 > t-$@ + $(MAN2HTML) `if test -f msgunfmt.1; then echo .; else echo $(srcdir); fi`/msgunfmt.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ xgettext.1.html: xgettext.1 - $(MAN2HTML) `if test -f xgettext.1; then echo .; else echo $(srcdir); fi`/xgettext.1 > t-$@ + $(MAN2HTML) `if test -f xgettext.1; then echo .; else echo $(srcdir); fi`/xgettext.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgcat.1.html: msgcat.1 - $(MAN2HTML) `if test -f msgcat.1; then echo .; else echo $(srcdir); fi`/msgcat.1 > t-$@ + $(MAN2HTML) `if test -f msgcat.1; then echo .; else echo $(srcdir); fi`/msgcat.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgcomm.1.html: msgcomm.1 - $(MAN2HTML) `if test -f msgcomm.1; then echo .; else echo $(srcdir); fi`/msgcomm.1 > t-$@ + $(MAN2HTML) `if test -f msgcomm.1; then echo .; else echo $(srcdir); fi`/msgcomm.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgconv.1.html: msgconv.1 - $(MAN2HTML) `if test -f msgconv.1; then echo .; else echo $(srcdir); fi`/msgconv.1 > t-$@ + $(MAN2HTML) `if test -f msgconv.1; then echo .; else echo $(srcdir); fi`/msgconv.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgen.1.html: msgen.1 - $(MAN2HTML) `if test -f msgen.1; then echo .; else echo $(srcdir); fi`/msgen.1 > t-$@ + $(MAN2HTML) `if test -f msgen.1; then echo .; else echo $(srcdir); fi`/msgen.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msgexec.1.html: msgexec.1 - $(MAN2HTML) `if test -f msgexec.1; then echo .; else echo $(srcdir); fi`/msgexec.1 > t-$@ + $(MAN2HTML) `if test -f msgexec.1; then echo .; else echo $(srcdir); fi`/msgexec.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msggrep.1.html: msggrep.1 - $(MAN2HTML) `if test -f msggrep.1; then echo .; else echo $(srcdir); fi`/msggrep.1 > t-$@ + $(MAN2HTML) `if test -f msggrep.1; then echo .; else echo $(srcdir); fi`/msggrep.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ msguniq.1.html: msguniq.1 - $(MAN2HTML) `if test -f msguniq.1; then echo .; else echo $(srcdir); fi`/msguniq.1 > t-$@ + $(MAN2HTML) `if test -f msguniq.1; then echo .; else echo $(srcdir); fi`/msguniq.1 | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ gettext.3.html: gettext.3.in - $(MAN2HTML) $(srcdir)/gettext.3.in > t-$@ + $(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ ngettext.3.html: ngettext.3.in - $(MAN2HTML) $(srcdir)/ngettext.3.in > t-$@ + $(MAN2HTML) $(srcdir)/ngettext.3.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ textdomain.3.html: textdomain.3.in - $(MAN2HTML) $(srcdir)/textdomain.3.in > t-$@ + $(MAN2HTML) $(srcdir)/textdomain.3.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ bindtextdomain.3.html: bindtextdomain.3.in - $(MAN2HTML) $(srcdir)/bindtextdomain.3.in > t-$@ + $(MAN2HTML) $(srcdir)/bindtextdomain.3.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ bind_textdomain_codeset.3.html: bind_textdomain_codeset.3.in - $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in > t-$@ + $(MAN2HTML) $(srcdir)/bind_textdomain_codeset.3.in | sed -e '/CreationDate:/d' > t-$@ mv t-$@ $@ install-html: diff --git a/man/x-to-1.in b/man/x-to-1.in new file mode 100644 index 000000000..c26843bd3 --- /dev/null +++ b/man/x-to-1.in @@ -0,0 +1,43 @@ +#! /bin/sh +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# +# This program 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. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# This program creates a program's manual from the .x skeleton and its --help +# output. + +if test $# != 5; then + echo "Usage: x-to-1 PERL HELP2MAN executable program.x program.1" 1>&2 + exit 1 +fi +PERL="$1" +HELP2MAN="$2" +executable="$3" +aux="$4" +output="$5" + +progname=`basename $aux .x` +case "$PERL" in *"/missing perl") perlok=no;; *) perlok=yes;; esac +if test @CROSS_COMPILING@ = no && test -f $executable && test $perlok = yes; then + echo "Updating man page $output" + echo "$HELP2MAN --include=$aux $executable > $output" + rm -f t-$progname.1 + $HELP2MAN --include=$aux $executable > t-$progname.1 || exit 1 + mv t-$progname.1 $output +else + echo "WARNING: The man page $output cannot be updated yet." +fi diff --git a/src/ChangeLog b/src/ChangeLog index ea5dc0cec..926f74ff0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-07-28 Bruno Haible + + * gettext.c (usage): If IN_HELP2MAN is set, output template for + localedir, not its value. + * ngettext.c (usage): Likewise. + 2001-07-28 Bruno Haible * po-lex.c: Include c-ctype.h instead of . diff --git a/src/gettext.c b/src/gettext.c index 987836fe5..fd2817569 100644 --- a/src/gettext.c +++ b/src/gettext.c @@ -280,7 +280,8 @@ variable TEXTDOMAINDIR.\n\ When used with the -s option the program behaves like the `echo' command.\n\ But it does not simply copy its arguments to stdout. Instead those messages\n\ found in the selected catalog are translated.\n\ -Standard search directory: %s\n"), LOCALEDIR); +Standard search directory: %s\n"), + getenv ("IN_HELP2MAN") == NULL ? LOCALEDIR : "@localedir@"); printf ("\n"); fputs (_("Report bugs to .\n"), stdout); } diff --git a/src/ngettext.c b/src/ngettext.c index fcd4f2408..cf932de87 100644 --- a/src/ngettext.c +++ b/src/ngettext.c @@ -236,7 +236,8 @@ If the TEXTDOMAIN parameter is not given, the domain is determined from the\n\ environment variable TEXTDOMAIN. If the message catalog is not found in the\n\ regular directory, another location can be specified with the environment\n\ variable TEXTDOMAINDIR.\n\ -Standard search directory: %s\n"), LOCALEDIR); +Standard search directory: %s\n"), + getenv ("IN_HELP2MAN") == NULL ? LOCALEDIR : "@localedir@"); printf ("\n"); fputs (_("Report bugs to .\n"), stdout); }