Просмотр исходного кода

build: Only use po4a if present and if NLS is enabled

Use the po4a command found when doing the availability checks.

Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Guillem Jover лет назад: 16
Родитель
Сommit
679d1d7578
3 измененных файлов с 22 добавлено и 7 удалено
  1. 1 0
      configure.ac
  2. 14 0
      m4/dpkg-progs.m4
  3. 7 7
      man/Makefile.am

+ 1 - 0
configure.ac

@@ -59,6 +59,7 @@ AC_PROG_LEX
 AC_PROG_RANLIB
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
+DPKG_PROG_PO4A
 DPKG_PROG_PERL
 
 # Checks for operating system services and capabilities.

+ 14 - 0
m4/dpkg-progs.m4

@@ -9,3 +9,17 @@ PERL_LIBDIR=$($PERL -MConfig -e 'my $r = $Config{vendorlibexp};
                                  $r =~ s/$Config{vendorprefixexp}/\$(prefix)/;
                                  print $r')dnl
 ])# DPKG_PROG_PERL
+
+# DPKG_PROG_PO4A
+# --------------
+AC_DEFUN([DPKG_PROG_PO4A], [
+AC_REQUIRE([AM_NLS])
+AC_CHECK_PROGS([PO4A], [po4a])
+if test "$USE_NLS" = "yes" && test -n "$PO4A"; then
+  USE_PO4A=yes
+else
+  USE_PO4A=no
+fi
+AC_SUBST([USE_PO4A])
+])# DPKG_PROG_PO4A
+

+ 7 - 7
man/Makefile.am

@@ -8,7 +8,7 @@ PO4A_RM_V = $(PO4A_RM_V_$(V))
 PO4A_RM_V_ = $(PO4A_RM_V_$(AM_DEFAULT_VERBOSITY))
 PO4A_RM_V_0 = @echo "  PO4ARM $@";
 
-all-local: all-local-@USE_NLS@
+all-local: all-local-@USE_PO4A@
 
 all-local-no:
 all-local-yes: man.stamp
@@ -20,25 +20,25 @@ PO4A_CLEAN_OPTS = $(PO4A_COMMON_OPTS) --rm-backups --rm-translations
 # FIXME: Use a stamp file until po4a supports them internally.
 man.stamp:
 	$(PO4A_V) cd $(srcdir) && \
-	po4a $(PO4A_BUILD_OPTS) po/po4a.cfg
+	$(PO4A) $(PO4A_BUILD_OPTS) po/po4a.cfg
 	$(AM_V_at) touch $@
 
-clean-local: clean-local-@USE_NLS@
+clean-local: clean-local-@USE_PO4A@
 
 clean-local-no:
 clean-local-yes:
 	$(PO4A_RM_V) cd $(srcdir) && \
-	po4a $(PO4A_CLEAN_OPTS) po/po4a.cfg
+	$(PO4A) $(PO4A_CLEAN_OPTS) po/po4a.cfg
 	$(AM_V_at) rm -f man.stamp
 
 update-po:
 	$(PO4A_V) cd $(srcdir) && \
-	po4a $(PO4A_BUILD_OPTS) --force po/po4a.cfg
+	$(PO4A) $(PO4A_BUILD_OPTS) --force po/po4a.cfg
 
 # Extract the list of languages from the po4a config file.
 LINGUAS = `sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po/po4a.cfg`
 
-install-data-local: install-data-local-@USE_NLS@
+install-data-local: install-data-local-@USE_PO4A@
 
 install-data-local-no:
 install-data-local-yes:
@@ -55,7 +55,7 @@ install-data-local-yes:
 			dist_man_MANS="$$files"; \
 	done
 
-uninstall-local: uninstall-local-@USE_NLS@
+uninstall-local: uninstall-local-@USE_PO4A@
 
 uninstall-local-no:
 uninstall-local-yes: