bug-gawk
[Top][All Lists]
Advanced

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

Re: MinGw port of gawkextlib


From: Andrew J. Schorr
Subject: Re: MinGw port of gawkextlib
Date: Tue, 17 May 2022 08:51:32 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, May 17, 2022 at 03:36:59PM +0300, Eli Zaretskii wrote:
> Why the assumption that gawkapi.h and the Gawk executable are under
> the same PREFIX?

Because that's what gawk's "make install" does.

> That might be so on Unix, where installation trees
> are standardized, but not on Windows.  gawkapi.h should be where the C
> compiler looks for includes files, whereas the gawk executable should
> be somewhere on PATH.  On Windows, it is customary to have many
> different directories on PATH, and some people even go to the extreme
> of installing every package's executables in a separate bin directory
> that they add to PATH.

They are welcome to do that, as long as they can remember where they
installed gawk.

> > I think the idea is that if somebody chooses to install gawk in
> > a non-standard location, then yes, the burden is on that user to
> > remember what the --prefix argument was that he/she used to install gawk.
> 
> Everything is basically "non-standard" on Windows in this regard.

Ugh.

> But there's one more aspect of this to be aware of.  The problem when
> building Gawk extensions with MinGW is that the build and the test
> suite run using MSYS tools, and those tools include an MSYS build of
> Gawk.  MSYS tools have a separate installation tree, and their Gawk is
> in /bin/gawk, which is at the beginning of the MSYS PATH.
> 
> But one cannot ask the MSYS Gawk to load and run extensions built for
> the MinGW Gawk, even if both MSYS and MinGW Gawk's are of the same
> version -- they are binary-incompatible and use different C runtimes.
> So whenever I must force the use of the MiNGW Gawk, as in this case, I
> have no choice but to override the location of the Gawk executable.
> Which is why I used that option in the first place.

That sounds complicated.

> The other files related to Gawk, such as gawkapi.h etc., don't need to
> have their places overridden, since they pertain to the GCC
> installation, and GCC is a MinGW program, not an MSYS program, so it
> follows the MinGW installation tree.
> 
> IOW, the --with-gawk= option was perhaps introduced with Unix users in
> mind, where it is reasonable to expect both the executable and the
> headers/libraries to share the same root prefix, that is not so on
> Windows when using MinGW and MSYS.  If this means you prefer a
> separate configure-time option for this MinGW-specific issue, I'm okay
> with that.  I just want to express my opinion that using --with-gawk
> and documenting it as providing the "prefix of the Gawk installation"
> will be more confusing and easier to make mistakes than my suggestion.

It sounds like MinGW is a very complicated platform. I'm glad that you can
get it to work. If others can't, we'll have to deal with that as it
happens. It sounds like it will be impossible to create a system that
works for everyone under all circumstances. It's not clear to me how
many potential MinGW gawkextlib users there are in the world. Maybe not
so many that we should be spending so much time trying to anticipate their
every need...

Regards,
Andy




reply via email to

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