Comments (7)
For what it's worth, this is everything I needed to change in order to get upstream Bison 3.5 to build under Windows using Mingw-w64: https://github.com/reactos/RosBE/blob/master/Patches/bison-3.5-reactos-fix-win32-build.patch
The resulting binary then always needs the BISON_PKGDATADIR and M4 environment variables to be set, but apart from that, it's working fine. And I could use the very same source package for Windows and Linux builds of Bison (which is why winflexbison was no option).
I'm well aware that this patch can't be directly included, but I leave it here as an inspiration.
Happy holidays everyone!
from winflexbison.
@ColinFinck the patch is a good start but not correct in all places:
- instead of the additional check for
WIN32
check forHAVE_SYS_IOCTL_H
/HAVE TERMIOS_H
(for your non-windows build set those viaCPPFLAGS
during configure, or even better, add them to the configure script - instead of commenting the winsock define use the existing guard (if you really have the file but don't need / want to include it [btw: why?], then adjust config.h after you've run configure and remove the define
HAVE_WINSOCK2_H
there
from winflexbison.
@ColinFinck the patch is a good start but not correct in all places:
As I said, I know pretty well that this patch can't be included into Bison in its current state.
However, I needed a source to build Bison under Windows and Linux now, and this patch makes it possible for me and anyone who's interested.
I hope it can serve as an inspiration for a real patch and I'd highly appreciate if someone could continue from here :)
* instead of the additional check for `WIN32` check for `HAVE_SYS_IOCTL_H` / `HAVE TERMIOS_H`
Agreed, it's cleaner. But I tried this and gave up, because currently sys/ioctl.h and termios.h are not checked in the configure
script and thus their HAVE_
constants are not available.
I wanted to keep the differences to vanilla Bison minimal, so I decided for a WIN32
check instead.
* instead of commenting the winsock define use the existing guard (if you really have the file but don't need / want to include it [btw: why?], then adjust config.h after you've run configure and remove the define `HAVE_WINSOCK2_H` there
Everyone compiling for Windows has this file, so it's always detected and included. However, including winsock2.h pulls in the entire set of Windows headers. This clashes with many definitions inside Bison (like accept
and CHAR
).
There is no reason why Bison should ever need any Winsock functions or other MS headers, thus it's safe to comment out the #include <winsock2.h>
in gnulib for a Bison distribution. I would actually opt for removing this line from upstream gnulib entirely, expecting it to cause more harm than good for most applications. But @ebblake added it in coreutils/gnulib@b5e7a0d to fix something else. Someone should check with him.
Adjusting config.h after running configure
sounds like an even worse hack to me. It especially breaks the nice configure
, make
, make install
scheme.
from winflexbison.
@donmac703 please check new version win_flex_bison-2.5.22.zip works on your grammar files.
from winflexbison.
For what it's worth, this is everything I needed to change in order to get upstream Bison 3.5 to build under Windows using Mingw-w64
@ColinFinck Thank you for sharing your work with us.
The main intention of win_flex_bison package was to completely avoid using unix tools like M4 and fork function. Mingw-w64 tries to mimic this functionality on windows.
win_flex_bison uses different approach - by deep code refactoring give users minimal self-contained executables compatible with original flex/bison tools.
There was no goal to keep code similar as much as possible.
from winflexbison.
Hi Lexxmark,
I have not had much time to focus on this, but initial indications show that the release is working correctly and reflecting the upstream changes.
Thanks for getting this release done.
from winflexbison.
done with https://github.com/lexxmark/winflexbison/releases/tag/v2.5.22
from winflexbison.
Related Issues (20)
- Bison-3.7.2 HOT 2
- v2.5.23 not working on Windows XP HOT 25
- Can not fix file via --update HOT 16
- Crash on invalid input HOT 6
- Visual Studio - win_bison creates tab.h file exceeding compiler limits HOT 8
- Update to bison 3.7.4 HOT 10
- Trouble compiling a *.l file using CMake HOT 7
- %option c++ is not compatible with %option noyywrap - linker error: multiple definition HOT 5
- Install guide lines? HOT 3
- Loss of data conversion in Flex scanner. HOT 5
- Update to Bison 3.8.1 HOT 11
- Missing LICENSE/COPYING file in repository toplevel HOT 6
- Cannot compile Bison input in C++ mode HOT 2
- Visual Studio dependencies and the provided CustomBuildRules HOT 3
- Could this project build with gcc HOT 2
- Runtime error when running multiple flex processes HOT 19
- D language support fixes reported upstream
- Using api.prefix{ ... } breaks yyerror()
- Chocolatey for 2.5.25 (Bison 3.8) HOT 1
- BSD license and GPL license missing from the binary package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winflexbison.