]> granicus.if.org Git - sudo/commitdiff
No longer need to specify LINGUAS in configure, "make install-nls"
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 18 Jun 2011 17:11:27 +0000 (13:11 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 18 Jun 2011 17:11:27 +0000 (13:11 -0400)
now just installs all the .mo files it finds.

Makefile.in
configure
configure.in

index f71664ed8fccd4eb49ada70f3efb75b96240363e..adb3863c1a94994972b5bae3ee80859c8df66d93 100644 (file)
@@ -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; \
index 501ec558c217f667fb5e779a2b2a4d8b60c4680b..d814ae3b37defa3f8273731a834aed830c766aec 100755 (executable)
--- 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
 
index 2849cd647a3a9905f626f1de3db0e4aa6c3864a5..5d9990e3ae51b993741f0c8441d20ba3459f5e7c 100644 (file)
@@ -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