bug-gettext
[Top][All Lists]
Advanced

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

Re: [bug-gettext] AC_CONFIG_MACRO_DIR{,S} & ACLOCAL_AMFLAGS


From: Daiki Ueno
Subject: Re: [bug-gettext] AC_CONFIG_MACRO_DIR{,S} & ACLOCAL_AMFLAGS
Date: Mon, 04 Mar 2013 18:43:48 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Daiki Ueno <address@hidden> writes:

> Pavel Raiskup <address@hidden> writes:
>
>>   autom4te --language Autoconf-without-aclocal-m4
>> --trace=AC_CONFIG_MACRO_DIR configure.ac
>>
>>   // and for the up2date autoconf (not yet released) should be used (See
>>   // autoconf's manual from git)
>>   autom4te --language Autoconf-without-aclocal-m4
>> --trace=AC_CONFIG_MACRO_DIR_TRACE configure.ac
>>
>> Are there any problems to be dependant on autoconf because of the
>> 'autom4te' utility?  There is a lot of tracing done in gettext.
>> (Note that this is not a blocker.)
>
> Well, I'm not sure :) but this 'autom4te' usage looks very helpful.  So
> let's refactor using it, after installing this patch.

Okay, I'm attaching a patch to use 'autom4te' and a patch for autopoint.
Testing and comments would be appreciated.

Regards,
-- 
Daiki Ueno

>From c7a323d17f238fee4b541d784bdd050165924358 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Mon, 4 Mar 2013 18:30:36 +0900
Subject: [PATCH 1/2] gettextize: Use autoconf trace to detect auxdir and m4dir

---
 gettext-tools/misc/ChangeLog     | 4 ++++
 gettext-tools/misc/gettextize.in | 9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index 92dbd8d..056921f 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,5 +1,9 @@
 2013-03-04  Daiki Ueno  <address@hidden>
 
+       * gettextize.in: Use autoconf trace to detect auxdir and m4dir.
+
+2013-03-04  Daiki Ueno  <address@hidden>
+
        * gettextize.in: Don't add redundant "-I m4" if
        AC_CONFIG_MACRO_DIR{,S} is not specified.
 
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in
index f44a1c2..20647c5 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -30,6 +30,8 @@ prefix="@prefix@"
 datarootdir="@datarootdir@"
 gettext_dir="@datadir@/gettext"
 
+autoconf="autom4te --no-cache --language=Autoconf-without-aclocal-m4"
+
 # func_tmpdir
 # creates a temporary directory.
 # Sets variable
@@ -309,13 +311,16 @@ if test $force -eq 0; then
 fi
 
 # Check in which directory config.rpath etc. belong.
-auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 
's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 
1q`
+auxdir=`$autoconf --trace=AC_CONFIG_AUX_DIR:\$% "$configure_in"`
 if test -n "$auxdir"; then
   auxdir="$auxdir/"
 fi
 
 # Check in which directory gettext.m4 etc. belong.
-macrodirs=`cat "$configure_in" | grep '^AC_CONFIG_MACRO_DIR' | sed -n -e 
's/AC_CONFIG_MACRO_DIRS\{,1\}(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/'`
+macrodirs=`$autoconf --trace=AC_CONFIG_MACRO_DIR_TRACE:\$% "$configure_in"`
+if test -z "$macrodirs"; then
+  macrodirs=`$autoconf --trace=AC_CONFIG_MACRO_DIR:\$% "$configure_in"`
+fi
 for arg in $macrodirs; do
   m4dir="$arg"
   break
-- 
1.8.1.2

>From ec82e6609a62fa89f7a1bdb63c77d7ff4ac27ab8 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Mon, 4 Mar 2013 18:19:02 +0900
Subject: [PATCH 2/2] autopoint: extract macro directories from configure.ac

---
 gettext-tools/misc/ChangeLog    |  6 ++++++
 gettext-tools/misc/autopoint.in | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index 056921f..9a9aac1 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,5 +1,11 @@
 2013-03-04  Daiki Ueno  <address@hidden>
 
+       * autopoint.in: Handle macro directories specified in configure.ac.
+       Reported by Pavel Raiskup in
+       <http://lists.gnu.org/archive/html/bug-gettext/2013-02/msg00017.html>.
+
+2013-03-04  Daiki Ueno  <address@hidden>
+
        * gettextize.in: Use autoconf trace to detect auxdir and m4dir.
 
 2013-03-04  Daiki Ueno  <address@hidden>
diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in
index d0725bc..1701526 100644
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.in
@@ -30,6 +30,8 @@ prefix="@prefix@"
 datarootdir="@datarootdir@"
 gettext_dir="@datadir@/gettext"
 
+autoconf="autom4te --no-cache --language=Autoconf-without-aclocal-m4"
+
 # func_tmpdir
 # creates a temporary directory.
 # Sets variable
@@ -302,14 +304,22 @@ case "$ver" in
 esac
 
 # Check in which directory config.rpath, mkinstalldirs etc. belong.
-auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 
's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 
1q`
+auxdir=`$autoconf --trace=AC_CONFIG_AUX_DIR:\$% "$configure_in"`
 if test -n "$auxdir"; then
   auxdir="$auxdir/"
 fi
 
 # Check in which directory the *.m4 macros belong.
-m4dir=m4
-if test -f Makefile.am; then
+macrodirs=`$autoconf --trace=AC_CONFIG_MACRO_DIR_TRACE:\$% "$configure_in"`
+if test -z "$macrodirs"; then
+  macrodirs=`$autoconf --trace=AC_CONFIG_MACRO_DIR:\$% "$configure_in"`
+fi
+for arg in $macrodirs; do
+  m4dir="$arg"
+  break
+done
+
+if test -z "$m4dir" && test -f Makefile.am; then
   # A package using automake.
   # Extract the macro directory name from Makefile.am.
   aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[     ]*=' Makefile.am | sed -e 
's/^ACLOCAL_AMFLAGS[  ]*=\(.*\)$/\1/'`
-- 
1.8.1.2


reply via email to

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