From 8b59414ce98ec2f35d2a1a3d0abaf3c46f00499d Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 5 Aug 2015 12:08:14 +0200 Subject: [PATCH] finally? fixed the wasaparse bison mess by writing a local version of ylwrap --- .hgignore | 1 - src/Makefile.am | 7 ++++--- src/configure.ac | 2 +- src/ylwrap | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100755 src/ylwrap diff --git a/.hgignore b/.hgignore index 86e851d3..945534cb 100644 --- a/.hgignore +++ b/.hgignore @@ -29,7 +29,6 @@ src/missing src/config.log src/config.status src/configure -src/ylwrap src/Makefile src/autom4te.cache src/common/autoconfig.h diff --git a/src/Makefile.am b/src/Makefile.am index 9623d4ea..0c7f1c09 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -236,10 +236,8 @@ utils/workqueue.h \ utils/x11mon.cpp \ utils/x11mon.h -BUILT_SOURCES = query/wasaparse.cpp query/wasaparse.hpp +BUILT_SOURCES = query/wasaparse.cpp AM_YFLAGS = -d -CLEANFILES = query/wasaparse.cpp query/wasaparse.hpp \ - query/location.hh query/position.hh query/stack.hh # We use -release: the lib is only shared # between recoll programs from the same release. @@ -541,5 +539,8 @@ install-data-hook: rdocdir = $(pkgdatadir)/doc rdoc_DATA = doc/user/usermanual.html doc/user/docbook-xsl.css +doc/user/usermanual.html: + $(MAKE) -C doc/user + dist_man1_MANS = doc/man/recoll.1 doc/man/recollq.1 doc/man/recollindex.1 dist_man5_MANS = doc/man/recoll.conf.5 diff --git a/src/configure.ac b/src/configure.ac index 114e16cf..c97b92bb 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -520,7 +520,7 @@ test "X$m_prefix" = "XNONE" && m_prefix=/usr/local m_datadir=${m_prefix}/share RECOLL_DATADIR=${m_datadir}/recoll -RCLVERSION=`cat VERSION` +RCLVERSION=$PACKAGE_VERSION RCLLIBVERSION=$RCLVERSION AC_SUBST(RECOLL_DATADIR) diff --git a/src/ylwrap b/src/ylwrap new file mode 100755 index 00000000..59db5508 --- /dev/null +++ b/src/ylwrap @@ -0,0 +1,48 @@ +#! /bin/sh + +# ylwrap - wrapper for lex/yacc invocations. Local version, the +# autotools scriptversion=2015-08-05.09; # UTC doesnt work for us +# because it does not move location.hh position.hh stack.hh into the +# appropriate directory (which is a bug, but it's simpler to rewrite a +# simple version for our needs than to fix the original). + +fatal() { + echo $* 1>&2 + exit 1 +} +usage() { + fatal "Usage: ylwrap query/wasaparse.ypp" +} + +test $# -ge 1 || usage + +toptmpdir=/tmp/rclylwrap$$ +tmpdir=${toptmpdir}/tmp +mkdir -p "${tmpdir}" + +cleanup() { + rm -rf "${toptmpdir}"/tmp/* + rmdir "${tmpdir}" + rmdir "${toptmpdir}" +} + +trap cleanup 0 2 15 + +# First arg is the input file + +input=$1 +inputdir=`dirname $1` +curdir=`pwd` || exit 1 +absinput="${curdir}/${input}" + +(cd "${tmpdir}"; bison -d -y $absinput) +ls $tmpdir + +for f in location.hh position.hh stack.hh; do + cmp -s "${tmpdir}"/$f "${inputdir}"/$f || cp -p "${tmpdir}"/$f "${inputdir}" +done + +cmp -s "${tmpdir}"/y.tab.c "${inputdir}"/wasaparse.cpp || \ + cp -p "${tmpdir}"/y.tab.c "${inputdir}"/wasaparse.cpp +cmp -s "${tmpdir}"/y.tab.h "${inputdir}"/wasaparse.hpp || \ + cp -p "${tmpdir}"/y.tab.h "${inputdir}"/wasaparse.hpp