diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index b8a560a209..1ace49eb30 100644 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -900,10 +900,10 @@ FLATZINC_LIB_OBJS=\ $(OBJ_DIR)/flatzinc/parser.$O\ $(OBJ_DIR)/flatzinc/registry.$O -$(GEN_DIR)/flatzinc/flatzinc.yy.cc: $(SRC_DIR)/flatzinc/flatzinc.lex +$(GEN_DIR)/flatzinc/flatzinc.yy.cc: $(SRC_DIR)/flatzinc/flatzinc.lex $(FLEX) $(FLEX) -o$(GEN_DIR)/flatzinc/flatzinc.yy.cc $(SRC_DIR)/flatzinc/flatzinc.lex -$(GEN_DIR)/flatzinc/flatzinc.tab.cc: $(SRC_DIR)/flatzinc/flatzinc.yy +$(GEN_DIR)/flatzinc/flatzinc.tab.cc: $(SRC_DIR)/flatzinc/flatzinc.yy $(BISON) $(BISON) -t -o $(GEN_DIR)/flatzinc/flatzinc.tab.cc -d $< $(GEN_DIR)/flatzinc/flatzinc.tab.hh: $(GEN_DIR)/flatzinc/flatzinc.tab.cc diff --git a/makefiles/Makefile.third_party.win b/makefiles/Makefile.third_party.win index 6407891689..74de95aede 100644 --- a/makefiles/Makefile.third_party.win +++ b/makefiles/Makefile.third_party.win @@ -7,6 +7,7 @@ CBC_TAG = 2.8.7 ZLIB_TAG = 1.2.8 ZLIB_ARCHIVE_TAG = 128 SWIG_TAG = 2.0.11 +BISON_FLEX_TAG = 2.5.2 # Build extra dependencies (GLPK, SCIP) from archive only if the archive is present. # The archive should be glpk-4.53.tar.gz @@ -308,6 +309,18 @@ ifeq ("$(VisualStudioVersion)", "12.0") svn revert dependencies/solutions/Scip/scip/scip.vcxproj endif +# Install bison and flex in one package. +install_bison: dependencies\install\bin\win_bison.exe + +dependencies\install\bin\win_flex.exe: dependencies\install\bin\win_bison.exe + +dependencies\install\bin\win_bison.exe: dependencies\archives\win_flex_bison-$(BISON_FLEX_TAG).zip + tools\unzip -d dependencies/install\bin dependencies\archives\win_flex_bison-$(BISON_FLEX_TAG).zip + tools\touch.exe dependencies\install\bin/win_bison.exe + +dependencies\archives\win_flex_bison-$(BISON_FLEX_TAG).zip: + tools\wget -P dependencies\archives http://sourceforge.net/projects/winflexbison/files/win_flex_bison-$(BISON_FLEX_TAG).zip + # Clean everything. clean_third_party: -$(DEL) Makefile.local diff --git a/makefiles/Makefile.win b/makefiles/Makefile.win index 421334474f..e68b55730b 100644 --- a/makefiles/Makefile.win +++ b/makefiles/Makefile.win @@ -35,8 +35,8 @@ MKDIR = md COPY = copy TOUCH = tools\touch.exe SED = tools\sed.exe -BISON = tools\bison.exe -FLEX = tools\flex.exe +BISON = dependencies\install\bin\win_bison.exe +FLEX = dependencies\install\bin\win_flex.exe # Compilation macros. DEBUG=/O2 -DNDEBUG diff --git a/src/flatzinc2/parser.lex b/src/flatzinc2/parser.lex index d143b54577..806a21d7b3 100644 --- a/src/flatzinc2/parser.lex +++ b/src/flatzinc2/parser.lex @@ -13,6 +13,11 @@ #include "base/strtoint.h" #include "flatzinc2/parser.tab.hh" using operations_research::atoi64; +#if defined(_MSC_VER) +#define YY_NO_UNISTD_H +#include "io.h" +#define isatty _isatty +#endif %} /* Rules that parse the bottom-line string tokens of a .fz file and diff --git a/tools/bison.exe b/tools/bison.exe deleted file mode 100644 index a56f1cb363..0000000000 Binary files a/tools/bison.exe and /dev/null differ