Skip to content

Commit d9a9113

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 8fd1e69 commit d9a9113

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
@@ -488,6 +488,7 @@ lib = lib
488488
# DESTDIR =
489489
pathsep = :
490490

491+
localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
491492
mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
492493
infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
493494
htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
@@ -1735,6 +1736,7 @@ bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
17351736
mandir_relative_SQ = $(subst ','\'',$(mandir_relative))
17361737
infodir_relative_SQ = $(subst ','\'',$(infodir_relative))
17371738
localedir_SQ = $(subst ','\'',$(localedir))
1739+
localedir_relative_SQ = $(subst ','\'',$(localedir_relative))
17381740
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
17391741
template_dir_SQ = $(subst ','\'',$(template_dir))
17401742
htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
@@ -2171,7 +2173,7 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
21712173

21722174
gettext.sp gettext.s gettext.o: GIT-PREFIX
21732175
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
2174-
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'
2176+
-DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'
21752177

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

0 commit comments

Comments
 (0)