]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Set of languages moved from configure.in to po/LINGUAS.
authorBruno Haible <bruno@clisp.org>
Fri, 3 Aug 2001 12:18:40 +0000 (12:18 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 3 Aug 2001 12:18:40 +0000 (12:18 +0000)
ChangeLog
configure.in
doc/ChangeLog
doc/gettext.texi
m4/ChangeLog
m4/gettext.m4
misc/ChangeLog
misc/automake.diff [new file with mode: 0644]
po/ChangeLog
po/LINGUAS [new file with mode: 0644]

index a14985bc80a22f32fd4a72f2f6d2eac7ef0c6edd..ed72ebfe92066266b0df29bb9caf8ba134c0f864 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * configure.in (ALL_LINGUAS): Remove assignment.
+
 2001-08-02  Bruno Haible  <haible@clisp.cons.org>
 
        * README: Change bug report address to <bug-gnu-gettext@gnu.org>.
index 3b800880c22a6eb0e52b3949eb06e4bcb1060a10..a063fcb499bb119e481f1dd0369ed016f2f04088 100644 (file)
@@ -1,14 +1,11 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.13)
-AC_REVISION($Revision: 1.36 $)
+AC_REVISION($Revision: 1.37 $)
 AC_INIT(src/msgfmt.c)
 AM_INIT_AUTOMAKE(gettext, 0.11)
 RELEASE_DATE=2001-05-23      dnl in "date +%Y-%m-%d" format
 AM_CONFIG_HEADER(config.h)
 
-dnl Set of available languages.
-ALL_LINGUAS="cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh"
-
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
index 7de23f062ad6578db3e2bec07b5bfbc6710f512c..77c020b23cfb875dcf4923625a6b538e0d78cbc3 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.texi (po/LINGUAS): New node.
+       (configure.in): Remove paragraph about ALL_LINGUAS.
+
 2001-08-02  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext.texi (Introduction): Change bug report address to
index c5569513a484ce6be79334be8de741892d36e94f..62441f6bf0f3dd0e5c46b94843b759a17cc1be40 100644 (file)
@@ -5022,6 +5022,7 @@ its own functionality.
 
 @menu
 * po/POTFILES.in::              @file{POTFILES.in} in @file{po/}
+* po/LINGUAS::                  @file{LINGUAS} in @file{po/}
 * configure.in::                @file{configure.in} at top level
 * config.guess::                @file{config.guess}, @file{config.sub} at top level
 * aclocal::                     @file{aclocal.m4} at top level
@@ -5030,7 +5031,7 @@ its own functionality.
 * src/Makefile::                @file{Makefile.in} in @file{src/}
 @end menu
 
-@node po/POTFILES.in, configure.in, Adjusting Files, Adjusting Files
+@node po/POTFILES.in, po/LINGUAS, Adjusting Files, Adjusting Files
 @subsection @file{POTFILES.in} in @file{po/}
 
 The @file{po/} directory should receive a file named
@@ -5062,7 +5063,31 @@ list those source files containing strings marked for translation
 of your whole distribution, rather than the location of the
 @file{POTFILES.in} file itself.
 
-@node configure.in, config.guess, po/POTFILES.in, Adjusting Files
+@node po/LINGUAS, configure.in, po/POTFILES.in, Adjusting Files
+@subsection @file{LINGUAS} in @file{po/}
+
+The @file{po/} directory should also receive a file named
+@file{LINGUAS}.  This file contains the list of available translations.
+It is a whitespace separated list.  Hash-marked comments and white lines
+are ignored.  Here is an example file:
+
+@example
+@group
+# Set of available languages.
+de fr
+@end group
+@end example
+
+@noindent
+This example means that German and French PO files are available, so
+that these languages are currently supported by your package.  If you
+want to further restrict, at installation time, the set of installed
+languages, this should not be done by modifying the @file{LINGUAS} file,
+but rather by using the @code{LINGUAS} environment variable
+(@pxref{Installers}).
+
+
+@node configure.in, config.guess, po/LINGUAS, Adjusting Files
 @subsection @file{configure.in} at top level
 
 @enumerate
@@ -5085,23 +5110,6 @@ and @samp{@value{VERSION}} by its version numbers, exactly as they
 should appear in the packaged @code{tar} file name of your distribution
 (@file{gettext-@value{VERSION}.tar.gz}, here).
 
-@item Declare the available translations.
-
-This is done by defining @code{ALL_LINGUAS} to the white separated,
-quoted list of available languages, in a single line, like this:
-
-@example
-ALL_LINGUAS="de fr"
-@end example
-
-@noindent
-This example means that German and French PO files are available, so
-that these languages are currently supported by your package.  If you
-want to further restrict, at installation time, the set of installed
-languages, this should not be done by modifying @code{ALL_LINGUAS} in
-@file{configure.in}, but rather by using the @code{LINGUAS} environment
-variable (@pxref{Installers}).
-
 @item Check for internationalization support.
 
 Here is the main @code{m4} macro for triggering internationalization
index 0a7fe965338db24e8147b1907b416d2e146ba4c0..590cb273ab962c9a4fcac520db7b84cb76ac3f16 100644 (file)
@@ -1,3 +1,10 @@
+2001-07-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_GNU_GETTEXT): Remove computation of CATALOGS.
+       (AM_WITH_NLS): Compute ALL_LINGUAS, GMOFILES, POFILES, CATALOGS while
+       creating po/Makefile from po/Makefile.in. Remove computation of
+       GMOFILES, POFILES during configure.
+
 2001-07-22  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext.m4 (AM_WITH_NLS): Simplify the logic. Use the same tests
index 43fdd040a8b553bfd265689918229e38c39d9b7f..1b3a59f7469de4cc4df42df8b1da48faff19516b 100644 (file)
@@ -64,38 +64,6 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
    AM_LC_MESSAGES
    AM_WITH_NLS([$1],[$2],[$3])
 
-   if test "x$CATOBJEXT" != "x"; then
-     if test "x$ALL_LINGUAS" = "x"; then
-       LINGUAS=
-     else
-       AC_MSG_CHECKING(for catalogs to be installed)
-       NEW_LINGUAS=
-       for presentlang in $ALL_LINGUAS; do
-         useit=no
-         for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
-           # Use the presentlang catalog if desiredlang is
-           #   a. equal to presentlang, or
-           #   b. a variant of presentlang (because in this case,
-           #      presentlang can be used as a fallback for messages
-           #      which are not translated in the desiredlang catalog).
-           case "$desiredlang" in
-             "$presentlang"*) useit=yes;;
-           esac
-         done
-         if test $useit = yes; then
-           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
-         fi
-       done
-       LINGUAS=$NEW_LINGUAS
-       AC_MSG_RESULT($LINGUAS)
-     fi
-
-     dnl Construct list of names of catalog files to be constructed.
-     if test -n "$LINGUAS"; then
-       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
-     fi
-   fi
-
    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
    dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
    dnl Try to locate is.
@@ -288,12 +256,62 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
             rm -f "$ac_dir/POTFILES"
             test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
             sed -e "/^#/d" -e "/^[     ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
+            # ALL_LINGUAS, GMOFILES, POFILES depend on $ac_dir but don't
+            # depend on user-specified configuration parameters.
+            if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+              # The LINGUAS file contains the set of available languages.
+              if test -n "$ALL_LINGUAS"; then
+                test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+              fi
+              ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+              # Hide the ALL_LINGUAS assigment from automake.
+              eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            fi
+            GMOFILES=
+            POFILES=
+            for lang in $ALL_LINGUAS; do
+              GMOFILES="$GMOFILES $lang.gmo"
+              POFILES="$POFILES $lang.po"
+            done
+            # CATALOGS depends on both $ac_dir and the user's LINGUAS
+            # environment variable.
+            INST_LINGUAS=
+            if test -n "$ALL_LINGUAS"; then
+              for presentlang in $ALL_LINGUAS; do
+                useit=no
+                for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
+                  # Use the presentlang catalog if desiredlang is
+                  #   a. equal to presentlang, or
+                  #   b. a variant of presentlang (because in this case,
+                  #      presentlang can be used as a fallback for messages
+                  #      which are not translated in the desiredlang catalog).
+                  case "$desiredlang" in
+                    "$presentlang"*) useit=yes;;
+                  esac
+                done
+                if test $useit = yes; then
+                  INST_LINGUAS="$INST_LINGUAS $presentlang"
+                fi
+              done
+            fi
+            CATALOGS=
+            if test -n "$INST_LINGUAS"; then
+              for lang in $INST_LINGUAS; do
+                CATALOGS="$CATALOGS $lang.gmo"
+              done
+            fi
             test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
-            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+            sed -e "/POTFILES =/r $ac_dir/POTFILES" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@POFILES@|$POFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
           fi
           ;;
         esac
-      done])
+      done],
+     [# Capture the value of obsolete $ALL_LINGUAS because we need it to
+      # compute GMOFILES, POFILES, CATALOGS. But hide it from automake.
+      eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
+      # Capture the value of $LINGUAS because we need it to compute CATALOGS.
+      LINGUAS="$LINGUAS"
+     ])
 
 
     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
@@ -333,23 +351,12 @@ changequote([,])dnl
       INTLBISON=:
     fi
 
-    dnl These rules are solely for the distribution goal.  While doing this
-    dnl we only have to keep exactly one list of the available catalogs
-    dnl in configure.in.
-    for lang in $ALL_LINGUAS; do
-      GMOFILES="$GMOFILES $lang.gmo"
-      POFILES="$POFILES $lang.po"
-    done
-
     dnl Make all variables we use known to autoconf.
     AC_SUBST(BUILD_INCLUDED_LIBINTL)
     AC_SUBST(USE_INCLUDED_LIBINTL)
-    AC_SUBST(CATALOGS)
     AC_SUBST(CATOBJEXT)
-    AC_SUBST(GMOFILES)
     AC_SUBST(INTLLIBS)
     AC_SUBST(INTLOBJS)
-    AC_SUBST(POFILES)
     AC_SUBST(POSUB)
 
     dnl For backward compatibility. Some configure.ins may be using this.
index 458deaf5357016e295e258cd2fcbf634fd11dd01..017f1b5397380686b10ef915f07117d683d8a566 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * automake.diff: New file.
+
 2001-08-02  Bruno Haible  <haible@clisp.cons.org>
 
        * gettextize.in: Change bug report address to
diff --git a/misc/automake.diff b/misc/automake.diff
new file mode 100644 (file)
index 0000000..f6850ca
--- /dev/null
@@ -0,0 +1,20 @@
+*** automake.bak       Sun Jun 10 16:24:20 2001
+--- automake   Sun Jul 22 16:51:04 2001
+***************
+*** 3313,3319 ****
+      }
+      else
+      {
+!      &am_error ("AM_GNU_GETTEXT in configure.in but \`ALL_LINGUAS' not defined");
+      }
+  }
+  
+--- 3313,3320 ----
+      }
+      else
+      {
+!      &am_error ("AM_GNU_GETTEXT in configure.in but po/LINGUAS doesn't exist and \`ALL_LINGUAS' not defined")
+!          if ! -f "po/LINGUAS";
+      }
+  }
+  
index 59e3b1d71f0993b5ebf156d63a2b731345e14248..3f94a4d66d983e31fbab8d0fd6eb98bab678e715 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * LINGUAS: New file, extracted from toplevel configure.in.
+
 2001-07-22  Bruno Haible  <haible@clisp.cons.org>
 
        * Makefile.in.in: Ensure @CATALOGS@ is not used if NLS is disabled.
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644 (file)
index 0000000..fa48b91
--- /dev/null
@@ -0,0 +1,2 @@
+# Set of available languages.
+cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh