summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2013-03-01 19:44:46 +0900
committerDaiki Ueno <ueno@gnu.org>2013-03-01 19:44:46 +0900
commit31d2db6fed93380b876374338b9f6c27ff0e3f77 (patch)
treedec2e87155ed73e219a31b3dbc9c2f69e91dd847 /gettext-tools
parent3a526d4c8c25c552b24c2e2f95eed02054fd2d28 (diff)
downloadexternal_gettext-31d2db6fed93380b876374338b9f6c27ff0e3f77.zip
external_gettext-31d2db6fed93380b876374338b9f6c27ff0e3f77.tar.gz
external_gettext-31d2db6fed93380b876374338b9f6c27ff0e3f77.tar.bz2
gettextize: extract macro directories from configure.ac
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/misc/ChangeLog6
-rw-r--r--gettext-tools/misc/gettextize.in72
2 files changed, 42 insertions, 36 deletions
diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog
index 32ba28f..3ff5a0a 100644
--- a/gettext-tools/misc/ChangeLog
+++ b/gettext-tools/misc/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-01 Daiki Ueno <ueno@gnu.org>
+
+ * gettextize.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-02-28 Daiki Ueno <ueno@gnu.org>
* autopoint.in (gettext_dir): Substitute PATH_SEPARATOR at
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in
index b21af24..0bb31b7 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -314,6 +314,13 @@ 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/'`
+for arg in $macrodirs; do
+ m4dir="$arg"
+ break
+done
+
# For simplicity we change to the gettext source directory.
cd "$gettext_dir" ||
func_fatal_error "gettext source directory '${gettext_dir}' doesn't exist"
@@ -785,31 +792,35 @@ if test -f "$srcdir/Makefile.am"; then
esac
fi
- # Extract the macro directory name from Makefile.am.
- aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
- m4dir=m4
- m4dir_defaulted=yes
- m4dir_is_next=
- for arg in $aclocal_amflags; do
- if test -n "$m4dir_is_next"; then
- # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
- case "$arg" in
- /*) ;;
- *)
- m4dir="$arg"
- m4dir_defaulted=
- break
- ;;
- esac
- m4dir_is_next=
- else
- if test "X$arg" = "X-I"; then
- m4dir_is_next=yes
- else
+ if test -z "$m4dir"; then
+ # Extract the macro directory name from Makefile.am.
+ aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
+ m4dir_is_next=
+ for arg in $aclocal_amflags; do
+ if test -n "$m4dir_is_next"; then
+ # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
+ case "$arg" in
+ /*) ;;
+ *)
+ test -z "$m4dir" || m4dir="$arg"
+ macrodirs="$macrodirs $arg"
+ ;;
+ esac
m4dir_is_next=
+ else
+ if test "X$arg" = "X-I"; then
+ m4dir_is_next=yes
+ else
+ m4dir_is_next=
+ fi
fi
- fi
- done
+ done
+ fi
+
+ if test -z "$m4dir"; then
+ m4dir=m4
+ m4dir_defaulted=yes
+ fi
# Decide whether to use $m4dir/ChangeLog, or to use ChangeLog instead.
if test -d "$srcdir/$m4dir" && test -f "$srcdir/ChangeLog" && test ! -f "$srcdir/$m4dir/ChangeLog"; then
@@ -1015,20 +1026,9 @@ if test -f "$srcdir/Makefile.am"; then
fi
fi
# Extract the aclocal options name from Makefile.am.
- aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
aclocal_options=
- m4dir_is_next=
- for arg in $aclocal_amflags; do
- if test -n "$m4dir_is_next"; then
- aclocal_options="$aclocal_options -I $arg"
- m4dir_is_next=
- else
- if test "X$arg" = "X-I"; then
- m4dir_is_next=yes
- else
- m4dir_is_next=
- fi
- fi
+ for arg in $macrodirs; do
+ aclocal_options="$aclocal_options -I $arg"
done
please="$please
Please run 'aclocal$aclocal_options' to regenerate the aclocal.m4 file.