From: Daiki Ueno Date: Fri, 1 Mar 2013 10:44:46 +0000 (+0900) Subject: gettextize: extract macro directories from configure.ac X-Git-Tag: v0.18.3~75^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d2db6fed93380b876374338b9f6c27ff0e3f77;p=thirdparty%2Fgettext.git gettextize: extract macro directories from configure.ac --- diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index 32ba28f14..3ff5a0a4e 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,3 +1,9 @@ +2013-03-01 Daiki Ueno + + * gettextize.in: Handle macro directories specified in configure.ac. + Reported by Pavel Raiskup in + . + 2013-02-28 Daiki Ueno * autopoint.in (gettext_dir): Substitute PATH_SEPARATOR at diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in index b21af24a8..0bb31b754 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.