Recent gettext to version 0.20 or later
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 2 Jan 2021 09:57:23 +0000 (10:57 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 2 Jan 2021 09:57:23 +0000 (10:57 +0100)
INSTALL
NEWS
acinclude.m4
configure.ac
po/automake.mk

diff --git a/INSTALL b/INSTALL
index 96191b9782e7a0c8ae1a1a6bf73442d81914eaed..5984cc609937a6fc573b43aae6901c369eb19553 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -68,18 +68,11 @@ The following packages are required to install PSPP:
       If you don't have a version already, you can install GNU
       libiconv (http://www.gnu.org/software/libiconv/).
 
       If you don't have a version already, you can install GNU
       libiconv (http://www.gnu.org/software/libiconv/).
 
-    * libintl, from GNU gettext (http://www.gnu.org/software/gettext).
-      GNU libc includes an integrated libintl, so there is no need to
-      separately install libintl on a GNU/Linux system.
-
     * zlib (http://www.zlib.net/).
 
     * libxml2 (http://xmlsoft.org/).
 
     * zlib (http://www.zlib.net/).
 
     * libxml2 (http://xmlsoft.org/).
 
-    * metainfo.its, provided by the appstream package. This is required
-      by xgettext version lower then 0.20 to extract the translation
-      strings from the org.fsf.pspp.metainfo.xml.in file. This is only
-      required for building. It is not a runtime requirement.
+    * gettext version 0.20 or later.
 
 The following packages are required to enable PSPP's graphing
 features.  If you cannot arrange to install them, you must run
 
 The following packages are required to enable PSPP's graphing
 features.  If you cannot arrange to install them, you must run
diff --git a/NEWS b/NEWS
index 491168199b88abc86fcd3d98178c4e49b2960f45..5ddd5bf3f566b64dcb5d43bf7bbdbb448dd39517 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
 PSPP NEWS -- history of user-visible changes.
 PSPP NEWS -- history of user-visible changes.
-Copyright (C) 1996-2000, 2008-2016, 2017, 2019, 2020 Free Software Foundation, Inc.
+Copyright (C) 1996-2000, 2008-2016, 2017, 2019, 2020, 2021 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
 See the end for copying conditions.
 
 Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
@@ -21,6 +21,8 @@ Changes from 1.4.1 to 1.5.2:
  * The user manual, in its Info and HTML versions, now includes
    graphical output examples and screenshots.
 
  * The user manual, in its Info and HTML versions, now includes
    graphical output examples and screenshots.
 
+ * gettext 0.20 or later is required for building.
+
  * Output improvements:
 
    - New drivers for output to TeX source files and to PNG files.
  * Output improvements:
 
    - New drivers for output to TeX source files and to PNG files.
index 49bb3b8ed4e7e480ccc647e002e6eecf2e4768e3..14f746effa78da7462eef88f712011374a7131f8 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2005, 2006, 2007, 2009, 2014, 2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2006, 2007, 2009, 2014, 2015, 2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -352,3 +352,23 @@ AC_DEFUN([PSPP_CHECK_DOT],
        pspp_cv_dot=no
      fi])
    AM_CONDITIONAL([HAVE_DOT], [test "$pspp_cv_dot" = yes])])
        pspp_cv_dot=no
      fi])
    AM_CONDITIONAL([HAVE_DOT], [test "$pspp_cv_dot" = yes])])
+
+
+dnl Check that xgettext is sufficiently recent
+dnl Before calling this function the variable XGETTEXT must point to the xgettext binary
+AC_DEFUN([PSPP_CHECK_XGETTEXT],
+ [AC_CACHE_CHECK([whether gettext is sufficiently recent],
+   [pspp_cv_progrecent_xgettext],
+   [pspp_cv_progrecent_xgettext=maybe
+    ver=`$ac_cv_prog_XGETTEXT --version | sed -n -e '/xgettext/s/[[^0-9]]*\([[0-9\.]][[0-9\.]]*\).*/\1/p'`
+    major=${ver%%.[[0-9]][[0-9]]*}
+    majmin=${ver%.[[0-9]][[0-9]]*}
+    minor=${majmin##[0-9]*.}
+    if test "$major" -lt 0; then
+      pspp_cv_progrecent_xgettext=no;
+    elif test "$minor" -lt 20; then
+      pspp_cv_progrecent_xgettext=no
+    else
+      pspp_cv_progrecent_xgettext=yes
+    fi])])
+
index d68d1bf5f8922e101aab62edd1a5b046448f5c8e..dfa5625c7ce1448eadc5e9724c9a587ccbf2d47c 100644 (file)
@@ -1,5 +1,5 @@
 dnl PSPP - a program for statistical analysis.
 dnl PSPP - a program for statistical analysis.
-dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2017, 2021 Free Software Foundation, Inc.
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@ CFLAGS="$CFLAGS -DGCC_LINT"
 dnl Disable automatic po/ support, because PSPP provides its own po/ support.
 AC_PROVIDE([AM_PO_SUBDIRS])
 AM_GNU_GETTEXT([external], [need-ngettext])
 dnl Disable automatic po/ support, because PSPP provides its own po/ support.
 AC_PROVIDE([AM_PO_SUBDIRS])
 AM_GNU_GETTEXT([external], [need-ngettext])
+
 LIBS="$LIBINTL $LIBS"
 AC_CHECK_PROGS([MSGFMT], [msgfmt])
 if test "x$MSGFMT" = x; then
 LIBS="$LIBINTL $LIBS"
 AC_CHECK_PROGS([MSGFMT], [msgfmt])
 if test "x$MSGFMT" = x; then
@@ -76,18 +77,12 @@ AC_CHECK_PROGS([XGETTEXT], [xgettext])
 if test "x$XGETTEXT" = x; then
   PSPP_REQUIRED_PREREQ([xgettext (is usually provided with gettext)])
 fi
 if test "x$XGETTEXT" = x; then
   PSPP_REQUIRED_PREREQ([xgettext (is usually provided with gettext)])
 fi
-dnl appstream required for metainfo.its
-dnl if metainfo.its is not there, then the following small
-dnl file will not produce an outputfile
-$as_echo '<?xml version="1.0" encoding="UTF-8"?>' > test.metainfo.xml.in
-$as_echo '<component type="desktop">' >> test.metainfo.xml.in
-$as_echo '<name>Hallo</name>' >> test.metainfo.xml.in
-$as_echo '</component>' >> test.metainfo.xml.in
-xgettext -o mifc.po test.metainfo.xml.in
-if ! test -f ./mifc.po  ; then
-  PSPP_OPTIONAL_PREREQ([org.fsf.metainfo.xml will not be translated. Install gettext >=0.20 or appstream.])
+
+PSPP_CHECK_XGETTEXT
+
+if test "$pspp_cv_progrecent_xgettext"  != "yes"; then
+   PSPP_REQUIRED_PREREQ([xgettext version 0.20 or greater])
 fi
 fi
-rm -f mifc.po test.metainfo.xml.in
 
 dnl Checks for libraries.
 AC_SYS_LARGEFILE
 
 dnl Checks for libraries.
 AC_SYS_LARGEFILE
index 0e83674ca8da9c40c270ffe63e9e8da93513fcfb..6c465a183e84dfa56ac9ee76b619cb75c6e303f8 100644 (file)
@@ -1,5 +1,5 @@
 # PSPP - a program for statistical analysis.
 # PSPP - a program for statistical analysis.
-# Copyright (C) 2017, 2020 Free Software Foundation, Inc.
+# Copyright (C) 2017, 2020, 2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -66,8 +66,7 @@ $(POTFILE): $(ALL_TRANSLATABLE_FILES) Makefile
        $(AM_V_at)test -z "$(UI_FILES)" || $(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=Glade -o $@,tmp
        $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.metainfo.xml.in -o $@,tmp
        $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.desktop.in -o $@,tmp
        $(AM_V_at)test -z "$(UI_FILES)" || $(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=Glade -o $@,tmp
        $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.metainfo.xml.in -o $@,tmp
        $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.fsf.pspp.desktop.in -o $@,tmp
-       $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: .*/d' $@,tmp > $@
-       rm -f $@,tmp
+       $(AM_V_at)mv $@,tmp $@
 
 $(LOCALPOFILES) $(POFILES): $(POTFILE)
        $(AM_V_GEN)$(MSGMERGE) --previous --quiet $(top_srcdir)/$@ $? -o $@,tmp
 
 $(LOCALPOFILES) $(POFILES): $(POTFILE)
        $(AM_V_GEN)$(MSGMERGE) --previous --quiet $(top_srcdir)/$@ $? -o $@,tmp
@@ -75,10 +74,8 @@ $(LOCALPOFILES) $(POFILES): $(POTFILE)
                touch $@,tmp ; \
                msgcat --use-first $(top_srcdir)/$@,aux $@,tmp -o $@,tmp; \
        fi ;
                touch $@,tmp ; \
                msgcat --use-first $(top_srcdir)/$@,aux $@,tmp -o $@,tmp; \
        fi ;
-       $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: /d' $@,tmp > $@,tmp2
-       $(RM) $@,tmp
-       $(MSGFMT) -c $@,tmp2 -o - > /dev/null
-       mv $@,tmp2 $@
+       $(MSGFMT) -c $@,tmp -o - > /dev/null
+       mv $@,tmp $@
 
 SUFFIXES += .po .gmo
 .po.gmo:
 
 SUFFIXES += .po .gmo
 .po.gmo: