1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-06 13:54:12 +01:00

configure: rewrote detection for 'xgettext'

The main change is to use Autoconf's syntax for consistency;

Now the detected program is used in the makefiles (user has the possibility
to change the name of the command);

A conditional is used to avoid enabling make targets that would fail if
the command does not exist.

Took opportunity to implement the silent-rules compliance to POT generation
rules.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2015-01-20 22:03:57 +01:00
committed by Carlos R. Mafra
parent 80e00c3521
commit 2cfb2b5276
6 changed files with 43 additions and 21 deletions

View File

@@ -79,14 +79,18 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS)
if HAVE_XGETTEXT
$(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)
$(mkinstalldirs) $(DESTDIR)$(nlsdir)

View File

@@ -45,14 +45,17 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS)
if HAVE_XGETTEXT
$(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)

View File

@@ -417,17 +417,9 @@ dnl ====================
dnl Detect the language for translations to be installed and check
dnl that the gettext environment works
WM_I18N_LANGUAGES
WM_I18N_XGETTEXT
AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
if test "$XGETTEXT" != ""; then
if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
echo "xgettext isn't GNU version"
XGETTEXT=""
fi
fi
dnl Added by Oliver - Support for NLSDIR option
dnl ===========================================
AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the locale stuff should go]))

View File

@@ -92,3 +92,19 @@ AC_SUBST([WMAKERMOFILES])dnl
AC_SUBST([WPREFSMOFILES])dnl
AC_SUBST([UTILMOFILES])dnl
])
# WM_I18N_XGETTEXT
# ----------------
#
# xgettext is used to generate the Templates for translation, it is not
# mandatory for users, only for translation teams. We look for it even
# if I18N was not asked because it can be used by dev team.
AC_DEFUN_ONCE([WM_I18N_XGETTEXT],
[AC_CHECK_PROGS([XGETTEXT], [xgettext], [])
AS_IF([test "x$XGETTEXT" != "x"],
AS_IF([$XGETTEXT --help 2>&1 | grep "illegal" > /dev/null],
[AC_MSG_WARN([[$XGETTEXT is not GNU version, ignoring]])
XGETTEXT=""]))
AM_CONDITIONAL([HAVE_XGETTEXT], [test "x$XGETTEXT" != "x"])dnl
])

View File

@@ -74,14 +74,18 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS)
if HAVE_XGETTEXT
$(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)
$(mkinstalldirs) $(DESTDIR)$(nlsdir)

View File

@@ -20,14 +20,17 @@ SUFFIXES = .po .mo
all-local: $(CATALOGS)
if HAVE_XGETTEXT
$(DOMAIN).pot: $(POTFILES)
xgettext --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
$(AM_V_GEN)$(XGETTEXT) --default-domain=$(DOMAIN) \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
@if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
rm -f $(DOMAIN).po; \
else \
mv -f $(DOMAIN).po $(DOMAIN).pot; \
fi
endif
install-data-local: $(CATALOGS)