From: Bruno Haible Date: Sat, 27 Apr 2019 09:00:35 +0000 (+0200) Subject: libgettextpo: Don't rely on the undocumented variable libgettextpo_program_name. X-Git-Tag: v0.20~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea6866673ff5892e49c25c1140656ec1531d05d;p=thirdparty%2Fgettext.git libgettextpo: Don't rely on the undocumented variable libgettextpo_program_name. * gnulib-local/lib/xerror.c: If IN_LIBGETTEXTPO is defined, include getprogname.h instead of progname.h and define program_name as a macro. * gnulib-local/lib/error-progname.c: Likewise. * gettext-tools/src/po-xerror.c: Likewise. * autogen.sh (GNULIB_MODULES_LIBGETTEXTPO): Remove progname. Pass --avoid=progname to gnulib-tool invocation for libgettextpo. --- diff --git a/autogen.sh b/autogen.sh index 2de683b71..1e0ed8978 100755 --- a/autogen.sh +++ b/autogen.sh @@ -297,7 +297,6 @@ if ! $skip_gnulib; then markup minmax open - progname relocatable-lib sigpipe stdbool @@ -332,7 +331,7 @@ if ! $skip_gnulib; then realloc-posix ' $GNULIB_TOOL --dir=gettext-tools --source-base=libgettextpo --m4-base=libgettextpo/gnulib-m4 --macro-prefix=gtpo --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local --local-symlink \ - --import $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER || exit $? + --import --avoid=progname $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER || exit $? # Overwrite older versions of .m4 files with the up-to-date version. cp gettext-runtime/m4/gettext.m4 gettext-tools/gnulib-m4/gettext.m4 cp gettext-runtime/m4/intl.m4 gettext-tools/gnulib-m4/intl.m4 diff --git a/gettext-tools/src/po-xerror.c b/gettext-tools/src/po-xerror.c index 63bf89c82..d916d2a37 100644 --- a/gettext-tools/src/po-xerror.c +++ b/gettext-tools/src/po-xerror.c @@ -1,5 +1,5 @@ /* Error handling during reading and writing of PO files. - Copyright (C) 2005-2007, 2013 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2013, 2019 Free Software Foundation, Inc. Written by Bruno Haible , 2005. This program is free software: you can redistribute it and/or modify @@ -28,13 +28,18 @@ #include #include "message.h" -#include "progname.h" #include "error-progname.h" #include "xalloc.h" #include "xerror.h" #include "error.h" #include "xvasprintf.h" #include "po-error.h" +#if IN_LIBGETTEXTPO +# include "getprogname.h" +# define program_name getprogname () +#else +# include "progname.h" +#endif #include "gettext.h" #define _(str) gettext (str) diff --git a/gnulib-local/lib/error-progname.c b/gnulib-local/lib/error-progname.c index 25e3cb205..cc2fefef6 100644 --- a/gnulib-local/lib/error-progname.c +++ b/gnulib-local/lib/error-progname.c @@ -1,5 +1,5 @@ /* Use of program name in error-reporting functions. - Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006, 2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -23,7 +23,12 @@ #include -#include "progname.h" +#if IN_LIBGETTEXTPO +# include "getprogname.h" +# define program_name getprogname () +#else +# include "progname.h" +#endif /* Indicates whether errors and warnings get prefixed with program_name. diff --git a/gnulib-local/lib/xerror.c b/gnulib-local/lib/xerror.c index 8e180de80..532cbc862 100644 --- a/gnulib-local/lib/xerror.c +++ b/gnulib-local/lib/xerror.c @@ -1,5 +1,5 @@ /* Multiline error-reporting functions. - Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006, 2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -26,9 +26,14 @@ #include #include "error.h" -#include "progname.h" #include "error-progname.h" #include "mbswidth.h" +#if IN_LIBGETTEXTPO +# include "getprogname.h" +# define program_name getprogname () +#else +# include "progname.h" +#endif /* Emit a multiline warning to stderr, consisting of MESSAGE, with the first line prefixed with PREFIX and the remaining lines prefixed with