Skip to content

Commit 0b81bf4

Browse files
committed
gettext: use a GIT_LOCALE_PATH relative to $(prefix)
On Windows, we simply pass a POSIX path to bindtextdomain(), relying on the current libintl-8.dll implementation to handle that gracefully by resolving the path relative to the "root" directory inferred from the location of the .dll file itself. However, not only does this rely on the custom patches of the gettext library as shipped with MSYS2 (gettext's own source code is not prepared to handle POSIX paths on Windows), it also means that Git itself cannot use the `podir` variable at all because it does not handle absolute POSIX paths in system_path() correctly, leaving them as-is. This patch fixes that behavior by always using a GIT_LOCALE_PATH relative to the (runtime) prefix. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 15edb00 commit 0b81bf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ lib = lib
445445
# DESTDIR =
446446
pathsep = :
447447

448+
localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
448449
mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
449450
infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
450451
htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
@@ -1603,6 +1604,7 @@ bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
16031604
mandir_relative_SQ = $(subst ','\'',$(mandir_relative))
16041605
infodir_relative_SQ = $(subst ','\'',$(infodir_relative))
16051606
localedir_SQ = $(subst ','\'',$(localedir))
1607+
localedir_relative_SQ = $(subst ','\'',$(localedir_relative))
16061608
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
16071609
template_dir_SQ = $(subst ','\'',$(template_dir))
16081610
htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
@@ -2039,7 +2041,7 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
20392041

20402042
gettext.sp gettext.s gettext.o: GIT-PREFIX
20412043
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
2042-
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'
2044+
-DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'
20432045

20442046
http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \
20452047
-DCURL_DISABLE_TYPECHECK

0 commit comments

Comments
 (0)