bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Gawk compile error Mingw32


From: Vincent Belaïche
Subject: Re: [bug-gawk] Gawk compile error Mingw32
Date: Wed, 26 Oct 2016 23:00:09 +0200

Dear Mr Robbins and Eli,

Sorry for so much time has ellapsed before I do some feedback. In fact I
admit that I have been somehow impolite, just opening a discussion and then
abandonning the ship as I had found a workaround to live with an older
AWK version.

Finally, I am coming back to this as awk 3.1.7 is definitely not fun
enough to me : no function pointers (aka indirect calls), no BEGINFILE,
nor ENDFILE rules... so I definitely would like a 4.1.** flavour under
MSW.

So I have tried what you recommended both, getting gawk-4.1-stable, and
the build works fine with Mingw32 over MSYS (after some M4
update...). However please note that there is some warning given by
bison :

 $ make awkgram.c
-| bison -o awkgram.c ../awkgram.y
-| ../awkgram.y: conflicts: 36 shift/reduce

(this is with the modified Makefile from my email subjected "Re:
[bug-gawk] Suggestion on pc/Makefile", hence the ../, however that does
not change this that you get this warning anyway).

Unfortunately this does not make me happy : sorry for I was not explicit
enough in my original email, but in fact I did not want to build a
Window native application, but an MSYS application.

My problem is that I would like to test existence of a file FILE in an
AWK script I would like to write something like

 if(system("test -f FILE") == 0)
    ... file exists processing ...
 else
    ... file does not exist processing ...

because this way would be portable to Linux. This would work also this
way I presume with MSYS AWK, but with a MSW AWK the system call does not
use the sh command interpreter, so you would need to write something
like this in MSDOS:

 if(system("dir /A:A FILE > NUL 2> NUL") == 0)
    ... file exists processing ...
 else
    ... file does not exist processing ...

Even this may not work if file contains / file separators, please
remember that the MSDOS 'dir' command supports only \ file separators,
so it would certainly be safer to write it like this :

 if(system("dir /A:A " gensub("/","\\\\","g",FILE) " > NUL 2> NUL") == 0)
    ... file exists processing ...
 else
    ... file does not exist processing ...


So, well, you see, an MSYS AWK would make it so much easier... but doing
this:

export MSYSTEM=MSYS
./configure
make

does not work.

VBR,
        Vincent.

Le 08/04/2016 à 06:35, Aharon Robbins a écrit :
> Mr. Belaiche,
>
> After doing the git clone, you need to do
>
>       git checkout gawk-4.1-stable
>
> Your output shows that you're trying to build in the 'master' branch.
>
> For MinGW, I don't think you should be running configure. See the instructions
> at https://www.gnu.org/software/gawk/manual/html_node/PC-Compiling.html. In
> particular this paragraph:
>
>       To build gawk for MS-DOS and Windows32, copy the files in the pc
>       directory (except for ChangeLog) to the directory with the rest
>       of the gawk sources, then invoke make with the appropriate target
>       name as an argument to build gawk. The Makefile copied from the
>       pc directory contains a configuration section with comments and
>       may need to be edited in order to work with your make utility.
>
> I hope this helps.
>
> Thanks,
>
> Arnold


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus




reply via email to

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