Skip to content

Commit d4f8d1a

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 75561d0 commit d4f8d1a

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
@@ -452,6 +452,7 @@ lib = lib
452452
# DESTDIR =
453453
pathsep = :
454454

455+
localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
455456
mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
456457
infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
457458
htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
@@ -1619,6 +1620,7 @@ bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
16191620
mandir_relative_SQ = $(subst ','\'',$(mandir_relative))
16201621
infodir_relative_SQ = $(subst ','\'',$(infodir_relative))
16211622
localedir_SQ = $(subst ','\'',$(localedir))
1623+
localedir_relative_SQ = $(subst ','\'',$(localedir_relative))
16221624
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
16231625
template_dir_SQ = $(subst ','\'',$(template_dir))
16241626
htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
@@ -2052,7 +2054,7 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
20522054

20532055
gettext.sp gettext.s gettext.o: GIT-PREFIX
20542056
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
2055-
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'
2057+
-DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'
20562058

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

0 commit comments

Comments
 (0)