]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Rebuild the help2man dependent man pages at "make dist" time.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Nov 2003 15:38:58 +0000 (15:38 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:16 +0000 (12:11 +0200)
gettext-runtime/ChangeLog
gettext-runtime/configure.ac
gettext-runtime/man/ChangeLog
gettext-runtime/man/Makefile.am
gettext-runtime/man/x-to-1.in
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/man/ChangeLog
gettext-tools/man/Makefile.am
gettext-tools/man/x-to-1.in

index 1976b7ff171de7a7b3ca147cd4d12330997c574c..0c411717442f9c4f303f8c32057a719abeab898f 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-16  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac (man/Makefile): Postprocess with FIX_MAKEFILE_DISTRIB.
+
 2003-11-13  Bruno Haible  <bruno@clisp.org>
 
        * configure.ac (docdir): New variable.
index 72d3ea5a680dff412e0ecb69138c66e003210f26..01878e73458c985b5c2e6f5e9a672519205c4efb 100644 (file)
@@ -150,7 +150,8 @@ AC_CONFIG_FILES([src/Makefile],
 
 AC_CONFIG_FILES([po/Makefile.in])
 
-AC_CONFIG_FILES([man/Makefile])
+AC_CONFIG_FILES([man/Makefile],
+                [FIX_MAKEFILE_DISTRIB])
 AC_CONFIG_FILES([man/x-to-1])
 
 AC_CONFIG_FILES([m4/Makefile])
index 835b3adc8d58f23b490a437b30a06c5b9322205d..5d2435e2e2ebde900eeefd8b28ba411421c62e27 100644 (file)
@@ -1,3 +1,11 @@
+2003-11-16  Bruno Haible  <bruno@clisp.org>
+
+       * x-to-1.in: Support --update option.
+       * Makefile.am (UPDATEMODE): New variable.
+       (gettext.1.in, ngettext.1.in, envsubst.1): Pass it to x-to-1.
+       (update-man1): New rule.
+       (distdir): Depend on it.
+
 2003-11-16  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am: Let gettext.1.in and ngettext.1.in, not gettext.1 and
index ef235b999a9d70ebcef37a9acaaba82e4d6f5532..e8ca9ee5771b61a68a25523451e414aacccde75e 100644 (file)
@@ -90,16 +90,25 @@ ngettext.1: ngettext.1.in Makefile
        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
+       IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       IN_HELP2MAN=1 $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
 
 envsubst.1: envsubst.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
 
 # Depend on version.sh to get version number changes.
 $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../version.sh
 
+# Update them also during "make dist", in order to propagate added command
+# line options that were added, even if version.sh didn't change.
+UPDATEMODE =
+update-man1:
+       $(MAKE) $(man_MAN1IN) $(man_MAN1OTHER) UPDATEMODE=--update
+       $(MAKE)
+# Hidden from automake, but really activated. Works around an automake-1.5 bug.
+#distdir: update-man1
+
 gettext.3: gettext.3.in $(top_srcdir)/../version.sh
        sed -e 's/@''VERSION''@/@VERSION@/g' < $(srcdir)/gettext.3.in > t-$@
        mv t-$@ $@
index c26843bd3e685e0c8e2a1babf9d0c08286a08129..310629348083b72c7e895f9e854d487314afdfa6 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003 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
 # This program creates a program's manual from the .x skeleton and its --help
 # output.
 
+update=
+while true; do
+  case "$1" in
+    --update) update=yes;;
+    *) break;;
+  esac
+done
+
 if test $# != 5; then
-  echo "Usage: x-to-1 PERL HELP2MAN executable program.x program.1" 1>&2
+  echo "Usage: x-to-1 [OPTIONS] PERL HELP2MAN executable program.x program.1" 1>&2
   exit 1
 fi
 PERL="$1"
@@ -37,7 +45,16 @@ if test @CROSS_COMPILING@ = no && test -f $executable && test $perlok = yes; the
   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
+  if test -n "$update"; then
+    # In --update mode, don't overwrite the output if nothing would change.
+    if cmp t-$progname.1 $output >/dev/null 2>&1; then
+      rm -f t-$progname.1
+    else
+      mv t-$progname.1 $output
+    fi
+  else
+    mv t-$progname.1 $output
+  fi
 else
   echo "WARNING: The man page $output cannot be updated yet."
 fi
index 4efcd3669a167c58d4f417e8561fee7bb31733a2..84a353f419fcb496ea48eff78dbab649bbf9fbf2 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-16  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac (man/Makefile): Postprocess with FIX_MAKEFILE_DISTRIB.
+
 2003-11-16  Bruno Haible  <bruno@clisp.org>
 
        * windows/gettextpo.rc: Bump version number to 0.13.
index 26afc7d4659f046b7424e389bfd3dacba7f4ec56..6587b8da5a5abb4cc9954af78d525896f31a5bad 100644 (file)
@@ -266,7 +266,8 @@ AC_CONFIG_FILES([misc/Makefile])
 AC_CONFIG_FILES([misc/gettextize], [chmod a+x misc/gettextize])
 AC_CONFIG_FILES([misc/autopoint], [chmod a+x misc/autopoint])
 
-AC_CONFIG_FILES([man/Makefile])
+AC_CONFIG_FILES([man/Makefile],
+                [FIX_MAKEFILE_DISTRIB])
 AC_CONFIG_FILES([man/x-to-1])
 
 AC_CONFIG_FILES([m4/Makefile])
index 857dc2aefedc78a1b52319767ffad59749906222..168c6519dcc1f65e034d204876c2d499b60f7a96 100644 (file)
@@ -1,3 +1,14 @@
+2003-11-16  Bruno Haible  <bruno@clisp.org>
+
+       * x-to-1.in: Support --update option.
+       * Makefile.am (UPDATEMODE): New variable.
+       (msgcmp.1, msgfmt.1, msgmerge.1, msgunfmt.1, xgettext.1, msgattrib.1,
+       msgcat.1, msgcomm.1, msgconv.1, msgen.1, msgexec.1, msgfilter.1,
+       msggrep.1, msginit.1, msguniq.1, gettextize.1, autopoint.1): Pass it to
+       x-to-1.
+       (update-man1): New rule.
+       (distdir): Depend on it.
+
 2003-11-13  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (docdir): Use the value from the configure script.
index a9406ed56bef69cda7f19b9bfc460c453423f578..47968cce649911830a6744620b456d64180060f2 100644 (file)
@@ -80,44 +80,53 @@ uninstall-local: uninstall-html
 # "progname --help" output.
 
 msgcmp.1: msgcmp.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcmp$(EXEEXT) $(srcdir)/msgcmp.x msgcmp.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/xgettext$(EXEEXT) $(srcdir)/xgettext.x xgettext.1
 msgattrib.1: msgattrib.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgattrib$(EXEEXT) $(srcdir)/msgattrib.x msgattrib.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgattrib$(EXEEXT) $(srcdir)/msgattrib.x msgattrib.1
 msgcat.1: msgcat.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgcat$(EXEEXT) $(srcdir)/msgcat.x msgcat.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(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
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgexec$(EXEEXT) $(srcdir)/msgexec.x msgexec.1
 msgfilter.1: msgfilter.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msgfilter$(EXEEXT) $(srcdir)/msgfilter.x msgfilter.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msgfilter$(EXEEXT) $(srcdir)/msgfilter.x msgfilter.1
 msggrep.1: msggrep.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msggrep$(EXEEXT) $(srcdir)/msggrep.x msggrep.1
 msginit.1: msginit.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msginit$(EXEEXT) $(srcdir)/msginit.x msginit.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msginit$(EXEEXT) $(srcdir)/msginit.x msginit.1
 msguniq.1: msguniq.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../src/msguniq$(EXEEXT) $(srcdir)/msguniq.x msguniq.1
 
 gettextize.1: gettextize.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../misc/gettextize $(srcdir)/gettextize.x gettextize.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/gettextize $(srcdir)/gettextize.x gettextize.1
 autopoint.1: autopoint.x
-       $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../misc/autopoint $(srcdir)/autopoint.x autopoint.1
+       $(SHELL) x-to-1 $(UPDATEMODE) "$(PERL)" "$(HELP2MAN)" ../misc/autopoint $(srcdir)/autopoint.x autopoint.1
 
 # Depend on version.sh to get version number changes.
 $(man_MAN1): help2man $(top_srcdir)/../version.sh
 
+# Update them also during "make dist", in order to propagate added command
+# line options that were added, even if version.sh didn't change.
+UPDATEMODE =
+update-man1:
+       $(MAKE) $(man_MAN1) UPDATEMODE=--update
+       $(MAKE)
+# Hidden from automake, but really activated. Works around an automake-1.5 bug.
+#distdir: update-man1
+
 
 # Man pages in HTML format.
 
index c26843bd3e685e0c8e2a1babf9d0c08286a08129..310629348083b72c7e895f9e854d487314afdfa6 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003 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
 # This program creates a program's manual from the .x skeleton and its --help
 # output.
 
+update=
+while true; do
+  case "$1" in
+    --update) update=yes;;
+    *) break;;
+  esac
+done
+
 if test $# != 5; then
-  echo "Usage: x-to-1 PERL HELP2MAN executable program.x program.1" 1>&2
+  echo "Usage: x-to-1 [OPTIONS] PERL HELP2MAN executable program.x program.1" 1>&2
   exit 1
 fi
 PERL="$1"
@@ -37,7 +45,16 @@ if test @CROSS_COMPILING@ = no && test -f $executable && test $perlok = yes; the
   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
+  if test -n "$update"; then
+    # In --update mode, don't overwrite the output if nothing would change.
+    if cmp t-$progname.1 $output >/dev/null 2>&1; then
+      rm -f t-$progname.1
+    else
+      mv t-$progname.1 $output
+    fi
+  else
+    mv t-$progname.1 $output
+  fi
 else
   echo "WARNING: The man page $output cannot be updated yet."
 fi