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

2023-03-21 Thread Costas Argyris
If so, could you please post it again, rebased on the current Git
master?

There is an issue here:I noticed that when I was trying to build
(cross-compile) Make for Windows using a gcc + mingw-w64
cross-compiler (using Autotools, not build_w32.bat), there was a
big difference depending on whether I was using the Make source
code from git or the tarball.

When trying from git, which was my first attempt, I was getting
compilation warnings which were turning themselves into errors,
so I never managed to build.

When I used the sources extracted from the tarball though, this
simply wasn't the case so I was able to cross-compile just fine.

Then the problem was how to track my changes, since I don't
have git any more.What I did just to get a patch posted was
to simply 'git init' a repository in the extracted sources just so
I could use 'git diff' and so forth.That way, I created the patch
I originally posted.

The problem now is that in order to rebase on the current Git
master, I'd have to use Git, so I'll fall back to the original problem
of not being able to build because of the warnings being treated
as errors.

Is this a known issue?Or is it just that not many people are
cross-compiling for Windows using gcc and autotools (i.e. not
using build_w32.bat)?

That being said, I haven't tried to build the Git source code
using build_w32.bat, so for all I know maybe that doesn't
lead to the warnings/errors I got with autotools (mostly because
that would be a native compile, as opposed to the cross-compile
I am doing with autotools).

And would you please consider working on changing build_w32.bat as
well?

Absolutely, I haven't forgotten about this.I haven't looked into
that file at all though, so I don't know how it configures its Makefiles,
how it detects the toolchain etc, so I may need some help to speed
things up.But definitely planning to do so in the coming days, or
weekend at worst.

On Tue, 21 Mar 2023 at 03:23, Eli Zaretskii  wrote:

> > From: Costas Argyris 
> > Date: Mon, 20 Mar 2023 21:47:27 +
> > Cc: bug-make@gnu.org, Paul Smith 
> >
> > Any thoughts for next steps then?
>
> If the patch ready to be installed?
>
> If so, could you please post it again, rebased on the current Git
> master?
>
> And would you please consider working on changing build_w32.bat as
> well?
>
> Thanks.
>


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

2023-03-21 Thread Eli Zaretskii
> From: Costas Argyris 
> Date: Tue, 21 Mar 2023 12:52:54 +
> Cc: bug-make@gnu.org, Paul Smith 
> 
> > If so, could you please post it again, rebased on the current Git
> > master?
> 
> There is an issue here:I noticed that when I was trying to build
> (cross-compile) Make for Windows using a gcc + mingw-w64
> cross-compiler (using Autotools, not build_w32.bat), there was a
> big difference depending on whether I was using the Make source
> code from git or the tarball.
> 
> When trying from git, which was my first attempt, I was getting
> compilation warnings which were turning themselves into errors,
> so I never managed to build.
> 
> When I used the sources extracted from the tarball though, this
> simply wasn't the case so I was able to cross-compile just fine.
> 
> Then the problem was how to track my changes, since I don't
> have git any more.What I did just to get a patch posted was
> to simply 'git init' a repository in the extracted sources just so
> I could use 'git diff' and so forth.That way, I created the patch
> I originally posted.
> 
> The problem now is that in order to rebase on the current Git
> master, I'd have to use Git, so I'll fall back to the original problem
> of not being able to build because of the warnings being treated
> as errors.

If this gives you so much trouble, just post the diffs against the
last release's tarball, and I will take it from there.

> Is this a known issue?

I'm not aware of it, but then I don't cross-build Make, and rarely
build it from Git anyway.

> Or is it just that not many people are
> cross-compiling for Windows using gcc and autotools (i.e. not
> using build_w32.bat)?

Not sure.  I think the MSYS2 folks do use the configury, but they use
it on Windows, not on GNU/Linux (i.e., they build natively, not by
cross-compiling).

> That being said, I haven't tried to build the Git source code
> using build_w32.bat, so for all I know maybe that doesn't
> lead to the warnings/errors I got with autotools (mostly because
> that would be a native compile, as opposed to the cross-compile
> I am doing with autotools).

You can submit diffs against the last released version here as well.

> > And would you please consider working on changing build_w32.bat as
> > well?
> 
> Absolutely, I haven't forgotten about this.I haven't looked into
> that file at all though, so I don't know how it configures its Makefiles,
> how it detects the toolchain etc, so I may need some help to speed
> things up.But definitely planning to do so in the coming days, or
> weekend at worst.

Thanks.  Please don't hesitate to ask questions.



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

2023-03-21 Thread Costas Argyris
You can submit diffs against the last released version here as well.

In that case, I am simply re-attaching the patch I originally sent in
this thread, because that was already developed and built on 4.4.1
tarball which is still the latest AFAICT.

Just reminding that these changes are in Makefile.am and configure.ac
so you would have to build using that approach to actually get a
UTF-8 Make on Windows host.

The other two files of the patch, utf8.manifest and utf8.rc will be
useful for the build_w32.bat approach as well because they will
be reused by it (I don't see a reason why not).

I'm not aware of it, but then I don't cross-build Make, and rarely
build it from Git anyway.

I think it's more of a 'build from Git' problem than a cross-compile
problem.
There is a maintMakefile in the root which only exists in the Git repository
and not in the tarball:

https://git.savannah.gnu.org/cgit/make.git/tree/maintMakefile

On line 32 it sets -Werror so I think that's what I am facing.

In that case, as I said, my patch was already from the 4.4.1 tarball
so it should be OK.

On Tue, 21 Mar 2023 at 13:32, Eli Zaretskii  wrote:

> > From: Costas Argyris 
> > Date: Tue, 21 Mar 2023 12:52:54 +
> > Cc: bug-make@gnu.org, Paul Smith 
> >
> > > If so, could you please post it again, rebased on the current Git
> > > master?
> >
> > There is an issue here:I noticed that when I was trying to build
> > (cross-compile) Make for Windows using a gcc + mingw-w64
> > cross-compiler (using Autotools, not build_w32.bat), there was a
> > big difference depending on whether I was using the Make source
> > code from git or the tarball.
> >
> > When trying from git, which was my first attempt, I was getting
> > compilation warnings which were turning themselves into errors,
> > so I never managed to build.
> >
> > When I used the sources extracted from the tarball though, this
> > simply wasn't the case so I was able to cross-compile just fine.
> >
> > Then the problem was how to track my changes, since I don't
> > have git any more.What I did just to get a patch posted was
> > to simply 'git init' a repository in the extracted sources just so
> > I could use 'git diff' and so forth.That way, I created the patch
> > I originally posted.
> >
> > The problem now is that in order to rebase on the current Git
> > master, I'd have to use Git, so I'll fall back to the original problem
> > of not being able to build because of the warnings being treated
> > as errors.
>
> If this gives you so much trouble, just post the diffs against the
> last release's tarball, and I will take it from there.
>
> > Is this a known issue?
>
> I'm not aware of it, but then I don't cross-build Make, and rarely
> build it from Git anyway.
>
> > Or is it just that not many people are
> > cross-compiling for Windows using gcc and autotools (i.e. not
> > using build_w32.bat)?
>
> Not sure.  I think the MSYS2 folks do use the configury, but they use
> it on Windows, not on GNU/Linux (i.e., they build natively, not by
> cross-compiling).
>
> > That being said, I haven't tried to build the Git source code
> > using build_w32.bat, so for all I know maybe that doesn't
> > lead to the warnings/errors I got with autotools (mostly because
> > that would be a native compile, as opposed to the cross-compile
> > I am doing with autotools).
>
> You can submit diffs against the last released version here as well.
>
> > > And would you please consider working on changing build_w32.bat as
> > > well?
> >
> > Absolutely, I haven't forgotten about this.I haven't looked into
> > that file at all though, so I don't know how it configures its Makefiles,
> > how it detects the toolchain etc, so I may need some help to speed
> > things up.But definitely planning to do so in the coming days, or
> > weekend at worst.
>
> Thanks.  Please don't hesitate to ask questions.
>
From f042d4b82111624dfe84bb85758c9b61c76ece5f Mon Sep 17 00:00:00 2001
From: Costas Argyris 
Date: Sat, 18 Mar 2023 14:13:21 +
Subject: [PATCH] Use UTF-8 active code page for Windows host.

This allows the make process on Windows to work in UTF-8 in multiple levels:

1) Accept a Makefile that is encoded in UTF-8 (with or without the BOM, since it already gets ignored anyway).
2) Accept a UTF-8 path (input -f argument) to a Makefile (that could itself be encoded in UTF-8, as per #1).
3) Launch make from a current directory that has UTF-8 characters.

and any combination of the above, since the entire make process will use UTF-8.

This is already the case in Linux-based systems, but on Windows this change is required in order to support Unicode because the "A" APIs currently used will assume the legacy system code page, destroying any UTF-8 input.

This change sets the code page to be used by the "A" APIs to the UTF-8 code page, thereby eliminating the need to update all calls of "A" functions to "W" functions to support Unicode.

That is, the source code can stay the same with the "A" functions

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

2023-03-21 Thread Henrik Carlqvist
On Tue, 21 Mar 2023 15:08:52 +
Costas Argyris  wrote:
> I am simply re-attaching the patch I originally sent in
> this thread, because that was already developed and built on 4.4.1
> tarball which is still the latest AFAICT.

Yes, at the time of this writing version 4.4.1 is the latest release of make
and that version with tag 4.4.1 is also the latest commit to master on the git
repo.

regards Henrik



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

2023-03-21 Thread Paul Smith
On Tue, 2023-03-21 at 12:52 +, Costas Argyris wrote:
> When trying from git, which was my first attempt, I was getting
> compilation warnings which were turning themselves into errors,
> so I never managed to build.
> 
> When I used the sources extracted from the tarball though, this
> simply wasn't the case so I was able to cross-compile just fine.

FYI when you build from Git, the "maintainer mode" is enabled by
default.  This includes extra runtime checks which make "make" slower,
and it also includes extreme compiler warning options, and also adds
the -Werror to turn those into failures (when you're using autotools).

You can disable this mode, even when compiling from Git, if you need
to.  Instructions for building from Git should be available in the
README.git file (this is only part of a Git checkout, it's not
available in the release).

However as Eli says it's usually not a big deal to apply patches from a
source release, to the Git repository ourselves.



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

2023-03-21 Thread Costas Argyris
Yes I eventually found out about the maintainer mode by searching
for where -Werror is coming from, that's how I ended up using the
tarball (because there is no maintainer mode there).

Didn't know about README.git though - this does have a lot of info
indeed, thanks!

On Tue, 21 Mar 2023 at 17:24, Paul Smith  wrote:

> On Tue, 2023-03-21 at 12:52 +, Costas Argyris wrote:
> > When trying from git, which was my first attempt, I was getting
> > compilation warnings which were turning themselves into errors,
> > so I never managed to build.
> >
> > When I used the sources extracted from the tarball though, this
> > simply wasn't the case so I was able to cross-compile just fine.
>
> FYI when you build from Git, the "maintainer mode" is enabled by
> default.  This includes extra runtime checks which make "make" slower,
> and it also includes extreme compiler warning options, and also adds
> the -Werror to turn those into failures (when you're using autotools).
>
> You can disable this mode, even when compiling from Git, if you need
> to.  Instructions for building from Git should be available in the
> README.git file (this is only part of a Git checkout, it's not
> available in the release).
>
> However as Eli says it's usually not a big deal to apply patches from a
> source release, to the Git repository ourselves.
>