New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we build awk under Windows? #186
Comments
I have no idea. I don't work with Windows systems. perhaps some other contributor will reach out to you. [i will leave this issue open for a few days] |
After some experiments, I partially succeeded. Here is the instruction:
As the result, I'm getting:
Any hints? |
given all the unix stuff awk uses, i think you'll want to use cygwin rather than visual c++. (otherwise you're going to have to implement all the unixy stuff yourself. which is easy enough for strncasecmp() or srandom()/random(), but not for popen()/pclose(), the wait() stuff, or fcntl().) |
With MSYS2 and MINGW64 one can build a native windows awk. Native means that it uses the msvcrt.dll already available in windows and does not need extra dll's. Some changes to the source are required to accomplish this. One sees most tests are ok. The only one failing is system-status.awk. But this uses the "kill" command, which is not available in windows. I am busy adapting the T.* tests to be able to run with the windows native awk. Two issues I have found during testing:
|
This is brilliant!
right before
because otherwise I got "-bash: gcc: command not found". Looking at the diff (the "awk_win32.diff.gz"), I believe it is worth to include these changes into the official master branch since they either fix variable types or Windows-specific things under the corresponding #ifdef. |
You can avoid setting the path by choosing the right option from the MSYS2 start menu: The "oldawk" vs "nawk" is concerning the tests and is not relevant for building awk. The executable which is built is 64 bit. |
The 32-bit build is compatible with Windows XP! (Just tested that under VirtualBox). |
The patch above is for version 20221215. |
I hope everyone is happy with the contributions on this discussion. closing the issue. |
Ideally I'd like to build awk under Windows using the Visual Studio Developer Command Prompt to produce a native build... but how?
The text was updated successfully, but these errors were encountered: