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: Thu, 27 Oct 2016 14:38:40 +0200

Answers embedded below...

Le 27/10/2016 à 09:04, address@hidden a écrit :
> Hi.
>
>> 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 normal. The awk grammar is weird; I don't think it can be
> written without shift/reduce conflicts.
>
>> 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 ...
>
> See 
> https://www.gnu.org/software/gawk/manual/html_node/File-Checking.html#File-Checking
>
> You can do it portably with
>
>       if ((getline junk < "FILE") < 0)
>               ... file does not exist processing (or can't be accessed)
>       else {
>               close("FILE")
>               ... files does exist processing
>       }
>

OK, I have tried this and it makes the job. Thank you !

> Can you use the MinGW binary that Eli builds?  Do you have to
> compile gawk yourself?  (See https://sourceforge.net/projects/ezwinports/)
>

No, I don't have to compile gawk myself, I would be quite happy to have
a binary. I have downloaded Eli's gawk binary, but it is a native MSW
application, not an MSYS application. It is easy to test that it outputs
CRLF EOLs, not LF EOL's, and that the the 'system(...)'  function calls
cmd.exe, not sh.

I am currently using MSYS as some *nixy environment to develop a LaTeX
package (http://gna.org/projects/lettre_observatoire) named
lettre. There are makefiles and M4 scripts to build the .dtx archive, to
generate the deliverables zips, to make the non-regression tests,
etc... I don't want to use any MSW specific tools, because they are not
portable, not guaranteed to be maintained over time, and I would like to
remain free to continue developing this package under any platform in
the future.

So, under MSW I have two choices :

1) either use MSYS, and the cost for that is that it means that I need
  utilities (like awk) compiled for MSYS. The latest MSYS awk is 3.1.7
  which is quite fustrating to use when you know all the goodies of
  4.1.*

2) either use DJPP, then I can use native MSW utilities, but the cost
   for using DJPP is I must pay attention not to use any explicit ':'
   file separators.

Using DJPP would be quite fine for lettre because anyway there aren't
any abosolute paths or filename separators in all the scripts which I am
using. However for historical reasons I am using MSYS.

Maybe this use of MSYS which I do is not so good an idea as the primary
objective of MSYS is to use automake tools under MSW, for which a good
old 3.1.7 AWK is far enough, and it is time for me to install DJPP on my
machine --- so using Eli's port would be the final answer. Many people
tell me why don't I simply go to Linux, but that would be another pages
long email to explain.

On the other hand, I like that MSYS puts more contrains on one to use
only LF EOL's.

Currently I have just overwritten my MSYS awk (3.1.7) by the just built
MSW native awk (4.1.1). It is fine for lettre development, and currently
I don't have any example that this could raise a problem to me, but in
theory it breaks MSYS, ie there certainly exists some SW build using AWK
for which my MSYS won't work any longer (OK, when I get to that point,
I'll just need overwrite awk.exe by gawk-3.1.7.exe).

> Thanks,
>
> Arnold

Thank you so much for all, and sorry for the lengthy email, it was just
to give a clue why I am bothering you again.

  Vincent.

---
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]