bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] autopoint and GREP_OPTIONS


From: Daiki Ueno
Subject: Re: [bug-gettext] autopoint and GREP_OPTIONS
Date: Mon, 17 Dec 2012 17:56:17 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Daiki Ueno <address@hidden> writes:

> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -368,6 +368,7 @@ cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS
>  
>  (cd gettext-tools
>   ../build-aux/fixaclocal aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I 
> gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
> + autom4te --language M4sh --cache '' --melt misc/autopoint.as -o 
> misc/autopoint.in

Probably it would better let "make" track dependencies.  So I'll use the
attached instead.  It also fixes similar issue in gettextize.

Regards,
-- 
Daiki Ueno

Insert shell sanitization stuff into the scripts using AS_INIT,
to unset interfering variables such as GREP_OPTIONS.
Reported by Jens Petersen <address@hidden>.
* gettextize.as: Rename from gettextize.in.
* autopoint.as: Rename from autopoint.in.
* Makefile.am (edit): New variable.
(gettextize.in): New rule.
(autopoint.in): New rule.
(gettextize): New rule.
(autopoint): New rule.
(MOSTLYCLEANFILES): Add gettextize.in and autopoint.in.
---
 gettext-tools/ChangeLog                            |    4 +++
 gettext-tools/configure.ac                         |    2 --
 gettext-tools/misc/ChangeLog                       |   16 +++++++++++
 gettext-tools/misc/Makefile.am                     |   29 ++++++++++++++++++++
 gettext-tools/misc/{autopoint.in => autopoint.as}  |   11 +++++---
 .../misc/{gettextize.in => gettextize.as}          |    7 +++--
 6 files changed, 61 insertions(+), 8 deletions(-)
 rename gettext-tools/misc/{autopoint.in => autopoint.as} (98%)
 rename gettext-tools/misc/{gettextize.in => gettextize.as} (99%)

diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog
index a259b3f..85bfcd2 100644
--- a/gettext-tools/ChangeLog
+++ b/gettext-tools/ChangeLog
@@ -1,5 +1,9 @@
 2012-12-17  Daiki Ueno  <address@hidden>
 
+       * configure.ac: Don't generate gettextize and autopoint here.
+
+2012-12-17  Daiki Ueno  <address@hidden>
+
        * configure.ac: Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER.
        Suggested by Stefano Lattarini <address@hidden>.
 
diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac
index 4064f9a..f2f8c93 100644
--- a/gettext-tools/configure.ac
+++ b/gettext-tools/configure.ac
@@ -511,8 +511,6 @@ AC_CONFIG_FILES([projects/Makefile])
 AC_CONFIG_FILES([styles/Makefile])
 
 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([misc/convert-archive], [chmod a+x misc/convert-archive])
 
 AC_CONFIG_FILES([man/Makefile],
diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index 8502295..45dafde 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,3 +1,19 @@
+2012-12-17  Daiki Ueno  <address@hidden>
+
+       Use M4sh to generate gettextize and autopoint.
+
+       Insert shell sanitization stuff into the scripts using AS_INIT,
+       to unset interfering variables such as GREP_OPTIONS.
+       Reported by Jens Petersen <address@hidden>.
+       * gettextize.as: Rename from gettextize.in.
+       * autopoint.as: Rename from autopoint.in.
+       * Makefile.am (edit): New variable.
+       (gettextize.in): New rule.
+       (autopoint.in): New rule.
+       (gettextize): New rule.
+       (autopoint): New rule.
+       (MOSTLYCLEANFILES): Add gettextize.in and autopoint.in.
+
 2010-08-30  Bruno Haible  <address@hidden>
 
        Improve interopability with Emacs 23.
diff --git a/gettext-tools/misc/Makefile.am b/gettext-tools/misc/Makefile.am
index 1c30157..4db208f 100644
--- a/gettext-tools/misc/Makefile.am
+++ b/gettext-tools/misc/Makefile.am
@@ -27,8 +27,37 @@ DISTCLEANFILES =
 
 bin_SCRIPTS = gettextize autopoint
 
+edit = sed \
+       -e 's|@address@hidden|$(PACKAGE)|g' \
+       -e 's|@address@hidden|$(VERSION)|g' \
+       -e 's|@address@hidden|$(ARCHIVE_FORMAT)|g' \
+       -e 's|@address@hidden|$(RELOCATABLE)|g' \
+       -e 's|@address@hidden|$(bindir)|g' \
+       -e 's|@address@hidden|$(datadir)|g' \
+       -e 's|@address@hidden|$(datarootdir)|g' \
+       -e 's|@address@hidden|$(exec_prefix)|g' \
+       -e 's|@address@hidden|$(prefix)|g'
+
+gettextize.in: $(srcdir)/gettextize.as
+       $(AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/gettextize.as 
-o $@
+
+autopoint.in: $(srcdir)/autopoint.as
+       $(AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autopoint.as -o 
$@
+
+$(bin_SCRIPTS): Makefile
+       rm -f $@ address@hidden
+       $(edit) address@hidden >address@hidden
+       chmod +x address@hidden
+       chmod a-w address@hidden
+       mv address@hidden $@
+
+gettextize: gettextize.in
+autopoint: autopoint.in
+
 DISTCLEANFILES += gettextize autopoint convert-archive
 
+MOSTLYCLEANFILES += gettextize.in autopoint.in *.tmp
+
 CLEANFILES += \
   archive.dir.tar.gz \
   archive.dir.tar.bz2 \
diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.as
similarity index 98%
rename from gettext-tools/misc/autopoint.in
rename to gettext-tools/misc/autopoint.as
index 48f661d..091ee19 100644
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.as
@@ -1,5 +1,5 @@
-#! /bin/sh
-#
+AS_INIT[]dnl                                            -*- shell-script -*-
+m4_divert_push([HEADER-COPYRIGHT])dnl
 # Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -16,6 +16,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
+AS_ME_PREPARE[]dnl
+
 # This file is meant for authors, maintainers, co-maintainers or installers
 # of packages which are internationalized with the help of GNU gettext.  For
 # further information how to use it consult the GNU gettext manual.
@@ -152,7 +155,7 @@ fi
 func_usage ()
 {
   echo "\
-Usage: autopoint [OPTION]...
+Usage: $as_me [OPTION]...
 
 Copies standard gettext infrastructure files into a source package.
 
@@ -228,7 +231,7 @@ func_fatal_error ()
         shift; break ;;
       -* )
         echo "autopoint: unknown option $1" 1>&2
-        echo "Try 'autopoint --help' for more information." 1>&2
+        echo "Try '$as_me --help' for more information." 1>&2
         exit 1 ;;
       * )
         break ;;
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.as
similarity index 99%
rename from gettext-tools/misc/gettextize.in
rename to gettext-tools/misc/gettextize.as
index c5ee610..f582ef9 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.as
@@ -1,5 +1,5 @@
-#! /bin/sh
-#
+AS_INIT[]dnl                                            -*- shell-script -*-
+m4_divert_push([HEADER-COPYRIGHT])dnl
 # Copyright (C) 1995-1998, 2000-2010 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -16,6 +16,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
+AS_ME_PREPARE[]dnl
+
 # This file is meant for authors or maintainers which want to
 # internationalize their package with the help of GNU gettext.  For
 # further information how to use it consult the GNU gettext manual.
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]