Changeset: c0dae2eba165 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0dae2eba165
Modified Files:
NT/rules.msc
buildtools/autogen/autogen/am.py
buildtools/autogen/autogen/msc.py
buildtools/conf/rules.mk
configure.ag
Branch: Nov2019
Log Message:
Use bison in bison mode; store generated files in tar ball.
Instead of working around the yacc compatibility that AC_PROG_YACC
imposes, just use bison properly. Also, if bison cannot be found,
just reuse the generated files from the tar ball.
diffs (100 lines):
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -186,7 +186,7 @@ libpy3_CFLAGS = -DHAVE_LIBPY3 "-I$(PYTHO
# PYTHON may be either a version 2 or a version 3
# here we let %Path% determine which version we get
PYTHON = python
-YACC = bison
+BISON = bison
ARCHIVER = lib /nologo
GENDLL =
diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -150,6 +150,8 @@ def am_find_srcs(target, deps, am, cond)
am['CLEAN'].append(pf)
b, ext = split_filename(pf)
if ext in automake_ext:
+ if ext in ['tab.c', 'tab.h']:
+ dist = True
return dist, pf
return dist, ""
diff --git a/buildtools/autogen/autogen/msc.py
b/buildtools/autogen/autogen/msc.py
--- a/buildtools/autogen/autogen/msc.py
+++ b/buildtools/autogen/autogen/msc.py
@@ -326,12 +326,14 @@ def msc_dep(fd, tar, deplist, msc):
fd.write(getsrc)
x, de = split_filename(deplist[0])
of = b + '.' + de
- fd.write('\t$(YACC) $(YFLAGS) $(AM_YFLAGS) "%s"\n' % of)
+ fd.write('\t$(BISON) -o %s.tmpc.c --defines=%s.tab.h $(YFLAGS)
$(AM_YFLAGS) %s\n' % (b, b, of))
+ fd.write('\trm -f %s.tmpc.c\n' % b)
elif ext == "tab.c":
fd.write(getsrc)
x, de = split_filename(deplist[0])
of = b + '.' + de
- fd.write('\t$(YACC) $(YFLAGS) $(AM_YFLAGS) "%s"\n' % of)
+ fd.write('\t$(BISON) -o %s.tab.c --defines=%s.tmph.h $(YFLAGS)
$(AM_YFLAGS) %s\n' % (b, b, of))
+ fd.write('\trm -f %s.tmph.h\n' % b)
elif ext in ("obj", "tab.obj"):
target, name = msc_find_target(tar, msc)
if name[0] == '_':
diff --git a/buildtools/conf/rules.mk b/buildtools/conf/rules.mk
--- a/buildtools/conf/rules.mk
+++ b/buildtools/conf/rules.mk
@@ -10,18 +10,12 @@ CP=cp
MV=mv
%.tab.c: %.y
- touch waiting.$$$$ && until ln waiting.$$$$ waiting 2>/dev/null; do
sleep 1; done && rm waiting.$$$$
- $(YACC) $(YFLAGS) $(AM_YFLAGS) $< || { $(RM) waiting ; exit 1 ; }
- if [ -f y.tab.c ]; then $(MV) y.tab.c $*.tab.c ; fi
- [ ! -f y.tab.h ] || $(RM) y.tab.h
- $(RM) waiting
+ $(BISON) -o $*.tab.c --defines=$*.tmph.h $(YFLAGS) $(AM_YFLAGS) $<
+ rm -f $*.tmph.h
%.tab.h: %.y
- touch waiting.$$$$ && until ln waiting.$$$$ waiting 2>/dev/null; do
sleep 1; done && rm waiting.$$$$
- $(YACC) $(YFLAGS) $(AM_YFLAGS) $< || { $(RM) waiting ; exit 1 ; }
- if [ -f y.tab.h ]; then $(MV) y.tab.h $*.tab.h ; fi
- [ ! -f y.tab.c ] || $(RM) y.tab.c
- $(RM) waiting
+ $(BISON) -o $*.tmpc.c --defines=$*.tab.h $(YFLAGS) $(AM_YFLAGS) $<
+ rm -f $*.tmpc.c
%.def: %.syms
case `(uname -s) 2> /dev/null || echo unknown` in CYGWIN*) cat $<;; *)
sed '/DllMain/d;s/=.*//' $<;; esac > $@
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1113,25 +1113,7 @@ XPYTHON_LIBDIR=`$translatepath "$QPYTHON
QXPYTHON_LIBDIR=`AS_ECHO(["$XPYTHON_LIBDIR"]) | sed 's/\\\\/\\\\\\\\/g'`
AC_SUBST([QXPYTHON_LIBDIR])
-AC_PROG_YACC
-AS_CASE([$YACC],
- [bison*],
- [
- # Ubuntu still comes with an ancient bison that uses defines
- # without checking if they are defined. This triggers a warning
- # from gcc with -Wundef. If we have a bison < 2.4.3, then
- # disable the warning.
- BISON_VER=`$YACC --version | head -n1 | sed -e 's/^.* //'`
- AS_VERSION_COMPARE([$BISON_VER],
- [2.4.3],
- [X_CFLAGS=`AS_ECHO(["${X_CFLAGS}"]) | sed -e
's/-Wundef//g'`])
- ],
- [
- # in embedded mode, we ship the bison-generated files
- AS_VAR_IF([enable_embedded], [no],
- [AC_MSG_ERROR([MonetDB/SQL requires bison])],
- [AC_MSG_WARN([ignoring missing bison in embedded
configuration])])
- ])
+AC_CHECK_PROG([BISON], [bison], [bison], [:])
INSTALL_BACKUP=""
AC_MSG_CHECKING([$INSTALL --backup option])
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list