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: Fri, 13 May 2022 14:05:18 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 13, 2022 at 04:59:09PM +0300, Eli Zaretskii wrote:
> I don't think this the right question, because when one builds and
> tests a package using the Posix environment (the configure script, the
> shell fragments in Makefiles, the shell scripts of the test suite,
> etc.), one must use MSYS, which emulates Posix on Windows, and has
> special features for invoking native MS-Windows programs under that
> environment.  One such feature is converting ':' to ';' in PATH-style
> variables; another feature is conversion of /d/foo/bar Posix-style
> file names into d:\foo\bar Windows-style file names.
> 
> So basically, when the gawkextlib test suite runs, we have two
> "platforms" coexisting simultaneously: the MSYS "platform", which uses
> ':', and the MinGW (a.k.a. "native MS-Windows") platform that uses
> ';'.  In particular, when the MinGW build of Gawk is invoked by the
> test suite, as it should be, it will report Windows style file names
> and semi-colon-separated AWKLIBPATH.
> 
> I think it is easier to ask MinGW users to run the test suite with a
> special argument, like
> 
>   make check PATHSEP=';'
> 
> or somesuch.

Hmmm. Actually, the autoconf magic defines PATH_SEPARATOR for
us in m4/progtest.m4. So it's easy enough to replace the ":"
with "$(PATH_SEPARATOR)" instead in the definition of AWK
(although you're saying that doesn't actually matter because MSYS bash
does this for us, but it still seems more elegant to use it).

But you're saying that this doesn't fix the problem because the value of
AWKLIBPATH reported by gawk will contain colons, and then the MSYS bash will
mangle the value by converting the colons to semi-colons. I'm guessing
that ENVIRON["AWKLIBPATH"] contains colons only in MinGW, so might
this fix the problem (where I'm using gawk gensub to replace
the pattern "<drive letter>:/" with "/<drive letter>/")?

AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} 
AWKLIBPATH=../.libs$(PATH_SEPARATOR)`$(GAWKPROG) 'BEGIN {print 
gensub(/\<([[:alpha:]]):\//, "/\\\1/", "g", ENVIRON["AWKLIBPATH"])}'` 
PATH=$(GEBINPFX)$$PATH LD_LIBRARY_PATH=$(GELIBPFX)$$LD_LIBRARY_PATH 
DYLD_LIBRARY_PATH=$(GELIBPFX)$$DYLD_LIBRARY_PATH $(VALGRIND) $(GAWKPROG)

There's a bit of a quoting nightmare there with escaped backslashes, do
I don't know if this will actually work. But it seemed like it might
in my tests.

Also, can you please send me the actual output from this command on a MinGW
MSYS setup?
   gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'
because I'm just guessing about what I'm dealing with. From your "sed" command,
it seems that the path looks something like "d:/lib/path", which surprises me,
because I would have expected backslashes instead of forward slashes.

I've attached my current patch to test.makefile. With this patch, everything
builds OK on Linux.

Thanks,
Andy

Attachment: test.makefile.patch
Description: Text document


reply via email to

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