[gimp] configure: properly generate POTFILES for po-*/.



commit 7d3adc87c08ac72e1c1b4b9c4304fb496d2eb68e
Author: Jehan <jehan girinstud io>
Date:   Wed Dec 27 01:57:21 2017 +0100

    configure: properly generate POTFILES for po-*/.
    
    By default, autoconf only takes care of po/POTFILES, not any
    po-*/POTFILES. The file contents has to go in po-*/Makefile, after
    running `config-status`, step which was consequently not properly done.
    And last consequence is that `make update-po` in any po-*/ was quite
    broken. Now things should be better.

 configure.ac |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e4c4d38..10ba3b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2695,13 +2695,35 @@ gimpthumb-gimp_pkgconfig_version.pc:gimpthumb.pc.in
 gimpui-gimp_pkgconfig_version.pc:gimpui.pc.in
 )
 
-AC_CONFIG_COMMANDS([sed-po-makefiles],
-[sed -e "/POTFILES =/r po-libgimp/POTFILES" po-libgimp/Makefile.in > po-libgimp/Makefile && touch 
po-libgimp/stamp-it
-sed -e "/POTFILES =/r po-python/POTFILES" po-python/Makefile.in > po-python/Makefile && touch 
po-python/stamp-it
-sed -e "/POTFILES =/r po-plug-ins/POTFILES" po-plug-ins/Makefile.in > po-plug-ins/Makefile && touch 
po-plug-ins/stamp-it
-sed -e "/POTFILES =/r po-script-fu/POTFILES" po-script-fu/Makefile.in > po-script-fu/Makefile && touch 
po-script-fu/stamp-it
-sed -e "/POTFILES =/r po-tips/POTFILES" po-tips/Makefile.in > po-tips/Makefile && touch po-tips/stamp-it
-sed -e "/POTFILES =/r po-windows-installer/POTFILES" po-windows-installer/Makefile.in > 
po-windows-installer/Makefile && touch po-windows-installer/stamp-it])
+# By default, autoconf will create only po/Makefile.
+# This code is used to create the POTFILES and Makefile for all
+# additional gettext catalogs.
+m4_define([generate_po_makefile], [
+  AC_MSG_NOTICE([Generating POTFILES and Makefile for $1])
+
+  AC_CONFIG_COMMANDS([$1/stamp-it],
+  [
+    if  ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ; then
+       as_fn_error $? "$1/Makefile.in.in was not created by intltoolize." "$LINENO" 5
+    fi
+    rm -f "$1/stamp-it" "$1/POTFILES"
+    sed -e '/^#/d' -e 's/^[[].*] *//' \
+        -e '/^[        ]*$/d'        \
+        -e "s|^|       $ac_top_srcdir/|" \
+        "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" && \
+    sed -e "/^# This comment gets stripped out/ {"  \
+        -e 'r $1/POTFILES'                          \
+        -e "d }" "$1/Makefile.in" >"$1/Makefile" && \
+    touch "$1/stamp-it"
+    ])
+])
+
+generate_po_makefile([po-libgimp])
+generate_po_makefile([po-python])
+generate_po_makefile([po-plug-ins])
+generate_po_makefile([po-script-fu])
+generate_po_makefile([po-tips])
+generate_po_makefile([po-windows-installer])
 
 # Print a summary of features enabled/disabled:
 optional_deps="


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