From 210e091d81442ae99c8f8f67043e493369a59a6c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 18 Jun 2011 13:11:27 -0400 Subject: [PATCH] No longer need to specify LINGUAS in configure, "make install-nls" now just installs all the .mo files it finds. --- Makefile.in | 64 +++++++++++++++++++++++++++------------------------- configure | 7 +++--- configure.in | 7 +++--- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Makefile.in b/Makefile.in index f71664ed8..adb3863c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,7 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_C = @ECHO_C@ # Message catalog support -LINGUAS = @LINGUAS@ +NLS = @SUDO_NLS@ POTFILES = src/po/sudo.pot plugins/sudoers/po/sudoers.pot MSGFMT = msgfmt MSGMERGE = msgmerge @@ -93,27 +93,33 @@ install-dirs install-binaries install-includes install-plugin: config.status pre exit $$?; \ done -install install-doc: config.status ChangeLog pre-install +install-doc: config.status ChangeLog for d in $(SUBDIRS); \ do (cd $$d && exec $(MAKE) $@) && continue; \ exit $$?; \ done -uninstall: +install: config.status pre-install install-nls for d in $(SUBDIRS); \ do (cd $$d && exec $(MAKE) $@) && continue; \ exit $$?; \ done - if test -n "$(LINGUAS)"; then \ - for pot in $(POTFILES); do \ - domain=`basename $$pot .pot`; \ - set -- $(LINGUAS); \ - while test $$# != 0; do \ - rm -f $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/$$domain.mo; \ - shift; \ - done; \ + +uninstall: uninstall-nls + for d in $(SUBDIRS); \ + do (cd $$d && exec $(MAKE) $@) && continue; \ + exit $$?; \ + done + +uninstall-nls: + for pot in $(POTFILES); do \ + domain=`basename $$pot .pot`; \ + podir=`dirname $$pot`; \ + for po in $$podir/*.po; do \ + lang=`basename $$po .po`; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \ done; \ - fi + done autoconf: autoconf -I m4 @@ -171,7 +177,7 @@ update-pot: case "$$domain" in \ sudo) cfiles="src/*c common/*c compat/*c";; \ sudoers) cfiles="plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \ - *) echo unknown domain $$domain continue;; \ + *) echo unknown domain $$domain; continue;; \ esac; \ $(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot; \ done @@ -180,12 +186,10 @@ update-po: update-pot @cd $(top_srcdir); \ for pot in $(POTFILES); do \ podir=`dirname $$pot`; \ - set -- $(LINGUAS); \ - while test $$# != 0; do \ - echo $(ECHO_N) "Updating $$podir/$$1.po$(ECHO_C)"; \ - $(MSGMERGE) --update $$podir/$$1.po $$pot; \ - $(MSGFMT) --output /dev/null --check-format $$podir/$$1.po || exit 1; \ - shift; \ + for po in $$podir/*.po; do \ + echo $(ECHO_N) "Updating $$po$(ECHO_C)"; \ + $(MSGMERGE) --update $$po $$pot; \ + $(MSGFMT) --output /dev/null --check-format $$po || exit 1; \ done; \ done @@ -193,27 +197,25 @@ compile-po: @cd $(top_srcdir); \ for pot in $(POTFILES); do \ podir=`dirname $$pot`; \ - set -- $(LINGUAS); \ - while test $$# != 0; do \ - echo $(ECHO_N) "Compiling $$podir/$$1.mo: $(ECHO_C)"; \ - $(MSGFMT) --statistics -c -o $$podir/$$1.mo $$podir/$$1.po; \ - shift; \ + for po in $$podir/*.po; do \ + mo=`echo $$po | sed 's/po$$/mo/'`; \ + echo $(ECHO_N) "Compiling $$mo: $(ECHO_C)"; \ + $(MSGFMT) --statistics -c -o $$mo $$po; \ done; \ done install-nls: - @if test -n "$(LINGUAS)"; then \ + @if test "$(NLS)" = "enabled"; then \ cd $(top_srcdir); \ for pot in $(POTFILES); do \ podir=`dirname $$pot`; \ domain=`basename $$pot .pot`; \ echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \ - set -- $(LINGUAS); \ - while test $$# != 0; do \ - echo $(ECHO_N) " $$1$(ECHO_C)"; \ - $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$1/LC_MESSAGES; \ - $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $$podir/$$1.mo $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/$$domain.mo; \ - shift; \ + for mo in $$podir/*.mo; do \ + lang=`basename $$mo .mo`; \ + echo $(ECHO_N) " $$lang$(ECHO_C)"; \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \ + $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $$mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \ done; \ echo ""; \ done; \ diff --git a/configure b/configure index 501ec558c..d814ae3b3 100755 --- a/configure +++ b/configure @@ -680,7 +680,7 @@ password_timeout timeout timedir iolog_dir -LINGUAS +SUDO_NLS LIBINTL LT_STATIC LIBDL @@ -2910,7 +2910,7 @@ AUTH_REG= AUTH_EXCL= AUTH_EXCL_DEF= AUTH_DEF=passwd -LINGUAS= +SUDO_NLS=disabled CHECKSHADOW=true shadow_defs= @@ -16946,8 +16946,7 @@ fi if test "$enable_nls" != "no"; then $as_echo "#define HAVE_LIBINTL_H 1" >>confdefs.h - # List of available translations - LINGUAS="eu fi uk zh_CN" + SUDO_NLS=enabled fi fi diff --git a/configure.in b/configure.in index 2849cd647..5d9990e3a 100644 --- a/configure.in +++ b/configure.in @@ -65,7 +65,7 @@ AC_SUBST([CONFIGURE_ARGS]) AC_SUBST([LIBDL]) AC_SUBST([LT_STATIC]) AC_SUBST([LIBINTL]) -AC_SUBST([LINGUAS]) +AC_SUBST([SUDO_NLS]) dnl dnl Variables that get substituted in docs (not overridden by environment) dnl @@ -171,7 +171,7 @@ AUTH_REG= AUTH_EXCL= AUTH_EXCL_DEF= AUTH_DEF=passwd -LINGUAS= +SUDO_NLS=disabled dnl dnl Other vaiables @@ -2213,8 +2213,7 @@ if test "$enable_nls" != "no"; then fi if test "$enable_nls" != "no"; then AC_DEFINE(HAVE_LIBINTL_H) - # List of available translations - LINGUAS="eu fi uk zh_CN" + SUDO_NLS=enabled fi fi -- 2.40.0