* Re: MS-DOS port broken again
2022-02-11 2:24 ` MS-DOS port broken again Po Lu
@ 2022-02-11 7:47 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2022-02-11 7:47 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Date: Fri, 11 Feb 2022 10:24:59 +0800
>
> After setting up a system to build the MS-DOS port automatically every
> two months (which I'm quite proud of), it's broken again:
>
> ../lib/libgnu.a(regex.o): In function `build_wcs_buffer':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:238: undefined reference to `_mbrtowc'
> ../lib/libgnu.a(regex.o): In function `build_wcs_upper_buffer':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:382: undefined reference to `_mbrtowc'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:385: undefined reference to `_towupper'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:390: undefined reference to `_wcrtomb'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:382: undefined reference to `_mbrtowc'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:296: undefined reference to `_mbsinit'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:312: undefined reference to `_mbrtowc'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:300: undefined reference to `_towupper'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:317: undefined reference to `_towupper'
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:322: undefined reference to `_wcrtomb'
> ../lib/libgnu.a(regex.o): In function `re_string_context_at':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:916: undefined reference to `_iswalnum'
> ../lib/libgnu.a(regex.o): In function `re_string_reconstruct':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:735: undefined reference to `_mbrtowc'
> ../lib/libgnu.a(regex.o): In function `re_string_skip_chars':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:503: undefined reference to `_mbrtowc'
> ../lib/libgnu.a(regex.o): In function `re_string_reconstruct':
> c:/djgpp/emacs-29.0.50/lib/regex_internal.c:755: undefined reference to `_iswalnum'
> ../lib/libgnu.a(regex.o): In function `re_compile_fastmap_iter':
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:309: undefined reference to `_mbrtowc'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:367: undefined reference to `_mbrtowc'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:381: undefined reference to `_wcrtomb'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:385: undefined reference to `_towlower'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:385: undefined reference to `_wcrtomb'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:309: undefined reference to `_towlower'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:309: undefined reference to `_wcrtomb'
> ../lib/libgnu.a(regex.o): In function `peek_token':
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:1892: undefined reference to `_iswalnum'
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:1781: undefined reference to `_iswalnum'
> ../lib/libgnu.a(regex.o): In function `parse_byte':
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:2627: undefined reference to `_btowc'
> ../lib/libgnu.a(regex.o): In function `build_charclass':
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:3481: undefined reference to `_wctype'
> ../lib/libgnu.a(regex.o): In function `re_compile_internal':
> c:/djgpp/emacs-29.0.50/lib/regcomp.c:873: undefined reference to `_btowc'
> ../lib/libgnu.a(regex.o): In function `check_node_accept_bytes':
> c:/djgpp/emacs-29.0.50/lib/regexec.c:3713: undefined reference to `_iswctype'
>
> It seems as if gnulib gained a hard dependency on mbrtowc, towupper, and
> other related functions.
AFAIR, Gnulib tossed support for DJGPP long ago.
> The rest of these functions can be defined as macros, but I have no idea
> what to do with mbrtowc, nor can I find any documentation on the format
> of shift state accepted by DJGPP.
DJGPP doesn't support multibyte characters, so you should be able to
write a trivial macro to use mbtowc instead of mbrtowc, and similarly
for other "stateful" conversion functions. IOW, the mbstate argument
to any of these functions has no meaning in DJGPP, and can be freely
ignored (which is why you didn't find any documentation of its
internal format). The mbstate structure is declared in the DJGPP
headers, but that's just a formality (and nice to have to compile
sources which reference it).
As to where to put these macros: since Gnulib includes src/config.h,
and src/config.h includes src/conf_post.h, I would place these macros
in the MSDOS section of conf_post.h.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread