summaryrefslogtreecommitdiff
path: root/libgphoto2_port
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-12-13 20:51:56 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-12-16 23:12:49 +0100
commit35bdaf146cc87271b18b290c7dd5ee44b5022fab (patch)
treee12de54926b3ec958c0d7e19c48888cb5add0aeb /libgphoto2_port
parentd65a7211d47a18a6a8533ebe524e0f69d5d12de1 (diff)
downloadlibgphoto2-35bdaf146cc87271b18b290c7dd5ee44b5022fab.tar.gz
Verbose gettext domain consistency checks
Make the gettext domain consistency checks more verbose to help debugging https://github.com/gphoto/libgphoto2/issues/751.
Diffstat (limited to 'libgphoto2_port')
-rw-r--r--libgphoto2_port/gphoto-m4/gp-gettext-setup.m416
1 files changed, 14 insertions, 2 deletions
diff --git a/libgphoto2_port/gphoto-m4/gp-gettext-setup.m4 b/libgphoto2_port/gphoto-m4/gp-gettext-setup.m4
index a73341437..30531c3c2 100644
--- a/libgphoto2_port/gphoto-m4/gp-gettext-setup.m4
+++ b/libgphoto2_port/gphoto-m4/gp-gettext-setup.m4
@@ -42,7 +42,7 @@ dnl into the include file and do not need to define it from a make
dnl rule on the compiler command line.
AC_DEFINE_UNQUOTED([$1], ["$2"], [text domain for string translations])
dnl AM_CPPFLAGS="$AM_CPPFLAGS -D$1=\\\""'$2'"\\\""
-dnl AC_SUBST([$1], [$2])
+AC_SUBST([$1], [$2])
dnl
dnl
dnl The following check will have "make all" print something like
@@ -52,7 +52,19 @@ dnl Error: Inconsistent values for GETTEXT_PACKAGE_LIBGPHOTO2 and po/Makevar
dnl if the consistency check has failed.
dnl
cat >>${GP_GETTEXT_SETUP_MK} <<EOF
- @if \$(GREP) '^DOMAIN *= *$2\$\$' \`test -f '$3/Makevars' || echo '\$(srcdir)/'\`'$3/Makevars'; then :; else echo 'Error: Inconsistent values for $1 and po/Makevars DOMAIN'; exit 1; fi
+ @MAKEVARS_FILE="\$\$(test -f '$3/Makevars' || echo '\$(srcdir)/')$3/Makevars"; \
+ MAKEVARS_DOMAIN="\$\$(\$(SED) -n 's/^DOMAIN \{0,\}= \{0,\}//p' "\$\$MAKEVARS_FILE")"; \
+ MAKE_TIME_DOMAIN="\$($1)"; \
+ echo " MAKEVARS_DOMAIN=\$\$MAKEVARS_DOMAIN"; \
+ echo " $1=\$($1)"; \
+ if test "x\$\$MAKEVARS_DOMAIN" = "x\$($1)"; then \
+ echo "Good: Matching gettext domain values (\$($1))"; \
+ elif test "x\$\$USE_NLS" = xyes; then \
+ echo "Error: Mismatching gettext domain values (\$($1) vs \$\${MAKEVARS_DOMAIN})"; \
+ exit 1; \
+ else \
+ echo "Warning: Mismatching gettext domain values (\$($1) vs \$\${MAKEVARS_DOMAIN})"; \
+ fi
EOF
dnl
])dnl