From: John Darrington Date: Sat, 2 Jan 2021 09:57:23 +0000 (+0100) Subject: Recent gettext to version 0.20 or later X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=210739b77d0f943b5073375fe39d1f09723adb2c Recent gettext to version 0.20 or later --- diff --git a/INSTALL b/INSTALL index 96191b9782..5984cc6099 100644 --- 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/). - * 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/). - * 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 diff --git a/NEWS b/NEWS index 491168199b..5ddd5bf3f5 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 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. @@ -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. + * gettext 0.20 or later is required for building. + * Output improvements: - New drivers for output to TeX source files and to PNG files. diff --git a/acinclude.m4 b/acinclude.m4 index 49bb3b8ed4..14f746effa 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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. @@ -352,3 +352,23 @@ AC_DEFUN([PSPP_CHECK_DOT], 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])]) + diff --git a/configure.ac b/configure.ac index d68d1bf5f8..dfa5625c7c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ 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 @@ -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]) + 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 -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 '' > test.metainfo.xml.in -$as_echo '' >> test.metainfo.xml.in -$as_echo 'Hallo' >> test.metainfo.xml.in -$as_echo '' >> 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 -rm -f mifc.po test.metainfo.xml.in dnl Checks for libraries. AC_SYS_LARGEFILE diff --git a/po/automake.mk b/po/automake.mk index 0e83674ca8..6c465a183e 100644 --- a/po/automake.mk +++ b/po/automake.mk @@ -1,5 +1,5 @@ # 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 @@ -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)$(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 @@ -75,10 +74,8 @@ $(LOCALPOFILES) $(POFILES): $(POTFILE) 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: