]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix conflict between different uses of GETTEXTLIBDIR.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Oct 2018 13:25:53 +0000 (15:25 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 5 Oct 2018 21:44:05 +0000 (23:44 +0200)
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.

gettext-tools/src/msginit.c
gettext-tools/tests/msginit-3
gettext-tools/tests/msginit-4

index 64aaea2dc4f21dc1f61c765c3486317c7d398602..e9316aebd30d10d5bb49ccd9af45ea5735c43dae 100644 (file)
@@ -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");
 
index 7ce27eb18d8dc3ccdf69f2abdab03ba62b95b7a4..2223595907fe1e0a48cd12fe2136b22edb712fd7 100755 (executable)
@@ -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
index c37f3f51d62357ae5a9f8f683e3ae9cfb20db6ee..ac58dfebe89b13cc6268fcab34e263c6f04129a4 100755 (executable)
@@ -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; }