bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use UTF-8 active code page for Windows host.


From: Costas Argyris
Subject: Re: [PATCH] Use UTF-8 active code page for Windows host.
Date: Mon, 27 Mar 2023 23:04:52 +0100

Thanks for looking into this, and good to hear that you are feeling better!

I still can't get Basic.mk to work, so not much to say on that...

Should we fail here?  Or should we build without UTF-8 support since we
don't have a resource compiler?  I think that's what the configure
version does, right?

You are right, that was an inconsistency on my part, sorry about that.
It's true that the configure version is optional on this, whereas
build_w32.bat errors out.

I think the answer depends on what is going to be the policy regarding
Make on Windows and UTF-8.    If we want to claim that Make on Windows
has gone UTF-8, matching fully the Unix-based platforms, then it has to
be an error if it can't be built as such.    My personal opinion is that this
is the way forward, because it may be confusing if we end up in a
situation where some users have a UTF-8 version of Make and some
others don't.    I think just go full UTF-8 like the other systems.

Of course, users on versions of Windows earlier than the target version
that supports this feature still won't get UTF-8, but that would be because
of their version of Windows, not because of the way Make was built.

That is, I am more inclined to make the configure version also error
out if windres was not found, than to make build_w32.bat optional.

This is mostly based on the fact that windres is part of binutils which is
pretty much ubiquitous because gcc itself relies on its tools (most
notably the assembler and linker).    So if someone is building with
gcc, they will almost certainly already have windres.    For building
with MSVC that's a non-issue because MSVC comes bundled with its
own resource compiler, so it is always going to be there.

So I think it is reasonable to expect that there is always going to be a
resource compiler available.    Even if not, say, when building with tcc,
it is always possible to error out with a message saying to install binutils.

For this (and the GCC version) shouldn't we be testing for failure and
failing the build if it doesn't work?


This is done by the existing CompileDone subroutine.    The code you
flagged and the GCC version right under it (and the TCC version for
that matter) calls CompileDone as their last command which is an
existing function that checks for the presence of the compiled object
file and errors out if it wasn't found.

On Mon, 27 Mar 2023 at 21:35, Paul Smith <psmith@gnu.org> wrote:
I apologize for being incommunicado: for the last week I've been
fighting the mother of all head colds.  The only good thing I can say
about it is that it was not COVID.

I'm sort of back on my feet.


On Sat, 2023-03-25 at 23:12 +0000, Costas Argyris wrote:
> and then from README.W32 -> Building with (MinGW-)
> GCC using GNU Make:
>
> make -f Basic.mk
> or
> make -f Basic.mk TOOLCHAIN=gcc

This makefile environment relies on the value of the MAKE_HOST variable
being some supported value.  Since I never try to build with minGW, I
have no idea what the MAKE_HOST variable will be set to and that
probably means it's not working.  Definitely the makefiles should
behave better, rather than just silently failing to find the
configuration and failing later.

It will work if you use a GNU make built using build_w32.bat (or
anyway, it does for me).  Also, that script will copy Build.mk to
Makefile so once you run it you can just run the make executable you
just built, without needing "-f Basic.mk", if you want.

Regarding the patch:

+:FindWindres
+:: Show the resource compiler version that we found
+echo.
+call %RC% --version
+if not ERRORLEVEL 1 goto Build
+echo No %RC% found.
+exit 1

Should we fail here?  Or should we build without UTF-8 support since we
don't have a resource compiler?  I think that's what the configure
version does, right?  This is up to you and Eli, I can see both sides.

+:: MSVC Resource Compile
+if "%VERBOSE%" == "Y" echo on
+call %RC% /fo %OUTDIR%\%1.%O% %1.rc
+@echo off
+goto CompileDone

For this (and the GCC version) shouldn't we be testing for failure and
failing the build if it doesn't work?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]