From: Bruno Haible Date: Tue, 2 Oct 2018 13:25:53 +0000 (+0200) Subject: Fix conflict between different uses of GETTEXTLIBDIR. X-Git-Tag: v0.20~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cf0ff0e000f3cd804f60800e2d9853529a9a321;p=thirdparty%2Fgettext.git Fix conflict between different uses of GETTEXTLIBDIR. Rationale: The programs installed in $(prefix)/lib/gettext/ are at different locations before installation: some are in the source tree, some are in the build tree. * gettext-tools/src/msginit.c (project_id, project_id_version): Test GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR. (plural_forms): Test GETTEXTLIBDIR_BUILDDIR, not GETTEXTLIBDIR. * gettext-tools/tests/msginit-3: Set GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR. * gettext-tools/tests/msginit-4: Set both GETTEXTLIBDIR_SRCDIR and GETTEXTLIBDIR_BUILDDIR. --- diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index 64aaea2dc..e9316aebd 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -875,7 +875,7 @@ project_id (const char *header) return old_field; } - gettextlibdir = getenv ("GETTEXTLIBDIR"); + gettextlibdir = getenv ("GETTEXTLIBDIR_SRCDIR"); if (gettextlibdir == NULL || gettextlibdir[0] == '\0') gettextlibdir = relocate (LIBDIR "/gettext"); @@ -949,7 +949,7 @@ project_id_version (const char *header) if (old_field != NULL && strcmp (old_field, "PACKAGE VERSION") != 0) return old_field; - gettextlibdir = getenv ("GETTEXTLIBDIR"); + gettextlibdir = getenv ("GETTEXTLIBDIR_SRCDIR"); if (gettextlibdir == NULL || gettextlibdir[0] == '\0') gettextlibdir = relocate (LIBDIR "/gettext"); @@ -1360,7 +1360,7 @@ plural_forms () size_t linelen; int exitstatus; - gettextlibdir = getenv ("GETTEXTLIBDIR"); + gettextlibdir = getenv ("GETTEXTLIBDIR_BUILDDIR"); if (gettextlibdir == NULL || gettextlibdir[0] == '\0') gettextlibdir = relocate (LIBDIR "/gettext"); diff --git a/gettext-tools/tests/msginit-3 b/gettext-tools/tests/msginit-3 index 7ce27eb18..222359590 100755 --- a/gettext-tools/tests/msginit-3 +++ b/gettext-tools/tests/msginit-3 @@ -37,7 +37,8 @@ msgstr "" EOF : ${MSGINIT=msginit} -GETTEXTLIBDIR="$abs_top_srcdir"/src ${MSGINIT} -l ga_IE --no-translator -o mi-test3.tmp 2>mi-test3.err +GETTEXTLIBDIR_SRCDIR="$abs_top_srcdir"/src \ +${MSGINIT} -l ga_IE --no-translator -o mi-test3.tmp 2>mi-test3.err test $? = 0 || { cat mi-test3.err 1>&2; Exit 1; } grep "Project-Id-Version: gt-msginit " mi-test3.tmp 2>&1 >/dev/null || Exit 1 diff --git a/gettext-tools/tests/msginit-4 b/gettext-tools/tests/msginit-4 index c37f3f51d..ac58dfebe 100755 --- a/gettext-tools/tests/msginit-4 +++ b/gettext-tools/tests/msginit-4 @@ -44,7 +44,9 @@ msgstr "" EOF : ${MSGINIT=msginit} -GETTEXTLIBDIR="$top_builddir"/src GETTEXTCLDRDIR="$abs_srcdir" \ +GETTEXTLIBDIR_SRCDIR="$abs_top_srcdir"/src \ +GETTEXTLIBDIR_BUILDDIR="$top_builddir"/src \ +GETTEXTCLDRDIR="$abs_srcdir" \ ${MSGINIT} -i mi-test4.pot -l foo --no-translator --no-wrap -o mi-test4.tmp 2>mi-test4.err test $? = 0 || { cat mi-test4.err 1>&2; Exit 1; }