fix flex/bison support; fz2 now compiles on windows

This commit is contained in:
laurent.perron@gmail.com
2014-05-31 20:37:50 +00:00
parent 9470182216
commit fb224dcaa3
5 changed files with 22 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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

Binary file not shown.