]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Reflect the real localedir in the manpages, not the default localedir.
authorBruno Haible <bruno@clisp.org>
Wed, 15 Aug 2001 12:27:39 +0000 (12:27 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Aug 2001 12:27:39 +0000 (12:27 +0000)
ChangeLog
configure.in
man/ChangeLog
man/Makefile.am
man/x-to-1.in [new file with mode: 0644]
src/ChangeLog
src/gettext.c
src/ngettext.c

index cee016af37410f1109a78061b19890843c574567..ac7f5d41416f38836d459df1855060aedda76bed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-28  Bruno Haible  <haible@clisp.cons.org>
+
+       * configure.in (AC_OUTPUT): Add man/x-to-1.
+
 2001-07-26  Bruno Haible  <haible@clisp.cons.org>
 
        * configure.in (configure.in): Remove automake bug workarounds, not
index 5199bf5ff34f165baca270bc5dbe131ae9f04b09..a406acc65318e99eeef854d8931ae12acbd2862c 100644 (file)
@@ -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  <bug-gnu-gettext@gnu.org>
 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])
index e0daebdec73e8bf9c476605febbe3d659f1fee85..c32181feadf4e0e82de8f4b6af023f8cf0c53de2 100644 (file)
@@ -1,3 +1,24 @@
+2001-07-28  Bruno Haible  <haible@clisp.cons.org>
+
+       * 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  <haible@clisp.cons.org>
 
        * msguniq.x: New file.
index 96d3e0d09c8f3ad82b4f8ce6ba4794dc2a603f73..f7e765bea8ba50dc9bf3c2afa665deaa1c796cf0 100644 (file)
@@ -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 (file)
index 0000000..c26843b
--- /dev/null
@@ -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
index ea5dc0cec3a130f04cb091d7dbac3c079c3f2409..926f74ff00e1d84868c6354a82119c0cd5b3f023 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-28  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.c (usage): If IN_HELP2MAN is set, output template for
+       localedir, not its value.
+       * ngettext.c (usage): Likewise.
+
 2001-07-28  Bruno Haible  <haible@clisp.cons.org>
 
        * po-lex.c: Include c-ctype.h instead of <ctype.h>.
index 987836fe516926b0480807ffd35054060c422dc8..fd2817569eb6e233b0b0567bf8c78b129b9b1cb2 100644 (file)
@@ -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 <bug-gnu-gettext@gnu.org>.\n"), stdout);
     }
index fcd4f2408213664a691fa1d8462090f2a2ce2ed5..cf932de87605d37b2bda1dba1e93c9c2484c1e02 100644 (file)
@@ -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 <bug-gnu-gettext@gnu.org>.\n"), stdout);
     }