]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
gettextize: extract macro directories from configure.ac
authorDaiki Ueno <ueno@gnu.org>
Fri, 1 Mar 2013 10:44:46 +0000 (19:44 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 1 Mar 2013 10:44:46 +0000 (19:44 +0900)
gettext-tools/misc/ChangeLog
gettext-tools/misc/gettextize.in

index 32ba28f145f6df183123e4926cd18d347fdbc393..3ff5a0a4e54f38e5ca3dd2ac1a2781a6507b8d79 100644 (file)
@@ -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
index b21af24a8999859ea7c6071faf0e6cf779567a17..0bb31b7542d6bfd4dd1e80fa49c49a7bc7345a3d 100644 (file)
@@ -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.