[frog] 102/103: Imported Upstream version 0.12.18

Joost van Baal joostvb at moszumanska.debian.org
Wed Sep 3 17:12:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

joostvb pushed a commit to branch master
in repository frog.

commit c12dc1cf459629f6496cd4be3bc25896a7fefcd8
Author: Joost van Baal-Ilić <joostvb at nusku.mdcc.cx>
Date:   Wed Sep 3 18:57:52 2014 +0200

    Imported Upstream version 0.12.18
---
 AUTHORS                           |    2 +
 ChangeLog                         |  419 +++++++++
 INSTALL                           |   12 +-
 Makefile.am                       |    7 +-
 Makefile.in                       |  425 +++++----
 NEWS                              |   13 +-
 aclocal.m4                        |  724 +++++++++------
 bootstrap => bootstrap.sh         |   16 +-
 compile                           |  347 +++++++
 config.guess                      |  184 ++--
 config.h.in                       |   21 +
 config.sub                        |  106 ++-
 configure                         | 1216 +++++++++++++++++--------
 configure.ac                      |   19 +-
 depcomp                           |  487 ++++++----
 docs/Makefile.in                  |  134 ++-
 frog.pc.in                        |   12 +
 include/Makefile.in               |  278 +++---
 include/frog/Frog.h               |   34 +-
 include/frog/Makefile.in          |  179 +++-
 include/frog/Parser.h             |   28 +-
 include/frog/cgn_tagger_mod.h     |    5 +-
 include/frog/iob_tagger_mod.h     |    4 +-
 include/frog/mblem_mod.h          |    5 +-
 include/frog/mbma_mod.h           |  245 +++--
 include/frog/mwu_chunker_mod.h    |    4 +-
 include/frog/ner_tagger_mod.h     |    4 +-
 include/frog/ucto_tokenizer_mod.h |    4 +-
 install-sh                        |   35 +-
 ltmain.sh                         |    4 +-
 m4/Makefile.in                    |  104 ++-
 m4/ax_lib_readline.m4             |  107 +++
 m4/ax_pthread.m4                  |   90 +-
 missing                           |  414 +++------
 py-compile                        |   23 +-
 scripts/Makefile.in               |  135 ++-
 src/Frog-util.cxx                 |   21 +-
 src/Frog.cxx                      |  823 +++++++++++------
 src/Makefile.am                   |    5 +-
 src/Makefile.in                   |  702 ++++++++++----
 src/Parser.cxx                    |   47 +-
 src/cgn_tagger_mod.cxx            |  110 ++-
 src/iob_tagger_mod.cxx            |   65 +-
 src/mblem_mod.cxx                 |  153 ++--
 src/mblem_prog.cxx                |    9 +-
 src/mbma_mod.cxx                  | 1822 +++++++++++++++++++++++++++++--------
 src/mbma_prog.cxx                 |   50 +-
 src/mwu_chunker_mod.cxx           |   45 +-
 src/ner_tagger_mod.cxx            |   62 +-
 src/tst.sh                        |    2 +-
 src/ucto_tokenizer_mod.cxx        |   47 +-
 test-driver                       |  139 +++
 tests/Makefile.in                 |  104 ++-
 tests/tst.ok                      |    2 +-
 54 files changed, 7135 insertions(+), 2919 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 28bc86d..2cd033a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,6 +15,7 @@ their way into Frog:
 Sander Canisius (CSI-DP)
 Jakub Zavrel (MBT)
 
+Supporters:
 People who contributed to Frog by suggesting improvements, 
 filing bug reports, asking the right questions etc.:
 
@@ -22,6 +23,7 @@ Walter Daelemans
 Micha Hulsbosch
 Emmanuel Keuleers
 Martin Reynaart
+Erik Tjong Kim Sang
 Frederik Vaassen
 
 and many others.
diff --git a/ChangeLog b/ChangeLog
index 4b6bfbf..06a7687 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,422 @@
+2014-06-04 08:46  sloot
+
+	* [r17286] src/mbma_mod.cxx: small fix for 'ge' prefix
+
+2014-06-02 14:56  sloot
+
+	* [r17273] src/mbma_mod.cxx: no debug lines please
+
+2014-06-02 14:53  sloot
+
+	* [r17272] src/mbma_mod.cxx: bug fix
+
+2014-06-02 09:38  sloot
+
+	* [r17271] configure.ac, src/Frog.cxx: added readline support
+
+2014-06-02 08:48  sloot
+
+	* [r17270] src/mbma_mod.cxx: avoit creation of empty nodes when
+	  --daring
+	  still very ugly code
+
+2014-05-28 12:00  sloot
+
+	* [r17269] include/frog/mbma_mod.h, src/mbma_mod.cxx: added more
+	  heuristic hackery to improve bracketing.
+	  Als fixed a bug that made mbma loop on some words
+
+2014-05-27 15:21  sloot
+
+	* [r17267] src/mbma_mod.cxx: fix for nonDaring
+
+2014-05-27 15:17  sloot
+
+	* [r17266] include/frog/mbma_mod.h, src/mbma_mod.cxx: when daring,
+	  reduce the failing morphemes
+
+2014-05-26 11:56  sloot
+
+	* [r17252] src/Frog.cxx: oesp
+
+2014-05-08 11:02  sloot
+
+	* [r17220] src/Frog.cxx: removed debug line
+
+2014-05-08 10:57  sloot
+
+	* [r17219] src/Frog.cxx: fix
+
+2014-05-01 15:44  sloot
+
+	* [r17195] src/Frog.cxx, src/mbma_mod.cxx: failed nodes are labeled
+	  as such in Morphemes
+
+2014-05-01 12:12  sloot
+
+	* [r17191] src/Frog.cxx: Frog can now run interactive too!
+
+2014-05-01 10:40  sloot
+
+	* [r17190] src/Frog.cxx: -o option now also works for multiple
+	  files
+	  -t may be left out, allowing multiple inputfiles
+
+2014-05-01 09:14  sloot
+
+	* [r17189] src/Frog.cxx: attempt to clean up the logic a bit
+
+2014-04-30 16:11  sloot
+
+	* [r17187] src/Frog.cxx: start using CL_Options from libticcutils
+
+2014-04-30 12:40  sloot
+
+	* [r17179] src/tst.sh: prop set
+
+2014-04-30 12:37  sloot
+
+	* [r17178] src/tst.sh: numb change
+
+2014-04-30 12:29  sloot
+
+	* [r17176] src/Makefile.am, src/tst.sh: fixed 'make check'
+
+2014-04-30 10:20  sloot
+
+	* [r17167] tests/tst.ok: modified testresult
+
+2014-04-30 10:17  sloot
+
+	* [r17166] Makefile.am: fixed 'make dist'
+
+2014-04-15 07:03  sloot
+
+	* [r17124] src/mbma_mod.cxx: fixed bracketed morphmes (missing
+	  description)
+
+2014-03-18 15:41  sloot
+
+	* [r17046] Makefile.am, configure.ac, frog.pc.in, src/mbma_mod.cxx:
+	  better sanity check.
+	  create a frog.pc
+
+2014-03-18 11:05  sloot
+
+	* [r17043] include/frog/mbma_mod.h, src/mbma_mod.cxx,
+	  src/mbma_prog.cxx: added --daring mode to the mbma program too
+
+2014-03-17 16:30  sloot
+
+	* [r17037] src/Frog.cxx, src/mbma_mod.cxx: when doDaring, the Frog
+	  output shows NESTED brackets now.
+
+2014-03-17 14:54  sloot
+
+	* [r17036] src/mbma_mod.cxx: oesp. Debugging off please!
+
+2014-03-17 14:53  sloot
+
+	* [r17035] include/frog/mbma_mod.h, src/mbma_mod.cxx: modified
+	  morpheme output in Daring mode
+
+2014-03-13 17:14  sloot
+
+	* [r17033] include/frog/mbma_mod.h, src/mbma_mod.cxx: a lot of
+	  refactoring to avoid memory leaks
+
+2014-03-13 14:12  sloot
+
+	* [r17032] include/frog/mbma_mod.h, src/mbma_mod.cxx: CLEX tag is
+	  own Folia tagset
+
+2014-03-13 13:31  sloot
+
+	* [r17031] configure.ac: we need most recent libfolia!
+
+2014-03-13 13:28  sloot
+
+	* [r17029] include/frog/mbma_mod.h, src/Frog.cxx, src/mbma_mod.cxx:
+	  added a --daring mode to frog
+	  this enables nested morphological analysis
+
+2014-03-12 15:18  sloot
+
+	* [r17026] include/frog/mbma_mod.h, src/mbma_mod.cxx: more
+	  refactoring
+
+2014-03-12 14:49  sloot
+
+	* [r17023] include/frog/mbma_mod.h, src/mbma_mod.cxx: al lot of
+	  refactoring concering bracketing
+
+2014-03-12 09:03  sloot
+
+	* [r17022] src/mbma_mod.cxx: ok, nice cleanup
+
+2014-03-11 17:38  sloot
+
+	* [r17021] src/mbma_mod.cxx: save state.
+
+2014-03-11 16:59  sloot
+
+	* [r17020] src/mbma_mod.cxx: removed some slack
+
+2014-03-11 16:49  sloot
+
+	* [r17019] src/mbma_mod.cxx: save current state of the art
+
+2014-03-11 15:22  sloot
+
+	* [r17018] src/mbma_mod.cxx: save current state of work on
+	  Bracketing
+
+2014-03-04 15:44  sloot
+
+	* [r17001] src/mbma_mod.cxx: save current work on brackets (not
+	  called)
+
+2014-02-27 17:43  sloot
+
+	* [r16990] src/mbma_mod.cxx: save experimental and buggy work on
+	  mbma barcketing. (not called)
+
+2014-02-05 16:15  sloot
+
+	* [r16927] include/frog/mbma_mod.h, src/mbma_mod.cxx: save new
+	  Bracketing stuff (disabled yet)
+
+2014-02-05 11:26  sloot
+
+	* [r16924] src/mbma_mod.cxx: save current status.
+
+2014-02-03 10:22  sloot
+
+	* [r16910] include/frog/mbma_mod.h, src/mbma_mod.cxx: save current
+	  status
+
+2014-01-28 13:52  sloot
+
+	* [r16884] src/Frog.cxx: use new TimblServer stuff
+
+2014-01-27 10:46  sloot
+
+	* [r16877] include/frog/mbma_mod.h, src/mbma_mod.cxx: more cleanup
+	  and comment added
+
+2014-01-23 16:04  sloot
+
+	* [r16875] include/frog/mbma_mod.h, src/mbma_mod.cxx: more cleanup
+
+2014-01-23 15:43  sloot
+
+	* [r16874] include/frog/mbma_mod.h, src/mbma_mod.cxx: cleanup and
+	  refactoring
+
+2014-01-23 14:19  sloot
+
+	* [r16872] include/frog/mbma_mod.h, src/mbma_mod.cxx: save current
+	  state. Still messy and t bug-to-bug compatible
+
+2014-01-21 17:22  sloot
+
+	* [r16867] include/frog/mbma_mod.h, src/mbma_mod.cxx: cleanup
+
+2014-01-21 17:04  sloot
+
+	* [r16866] include/frog/mbma_mod.h, src/mbma_mod.cxx: save current
+	  work
+
+2014-01-21 14:24  sloot
+
+	* [r16865] include/frog/mbma_mod.h, src/mbma_mod.cxx: save current
+	  state. getting closer...
+
+2014-01-21 11:51  sloot
+
+	* [r16861] include/frog/mbma_mod.h, src/Frog.cxx, src/mbma_mod.cxx:
+	  save intermediate result
+	  this seesm to work
+
+2014-01-16 16:45  sloot
+
+	* [r16860] include/frog/mbma_mod.h, src/mbma_mod.cxx: save work on
+	  new implementation
+
+2014-01-16 14:07  sloot
+
+	* [r16859] include/frog/mbma_mod.h, src/mbma_mod.cxx: more
+	  refactoring
+
+2014-01-16 12:32  sloot
+
+	* [r16858] include/frog/mbma_mod.h, src/mbma_mod.cxx: again some
+	  refactoring in the process of getiing it alright
+
+2014-01-06 10:00  sloot
+
+	* [r16815] include/frog/Frog.h, include/frog/Parser.h,
+	  include/frog/cgn_tagger_mod.h, include/frog/iob_tagger_mod.h,
+	  include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  include/frog/mwu_chunker_mod.h, include/frog/ner_tagger_mod.h,
+	  include/frog/ucto_tokenizer_mod.h, src/Frog-util.cxx,
+	  src/Frog.cxx, src/Parser.cxx, src/cgn_tagger_mod.cxx,
+	  src/iob_tagger_mod.cxx, src/mblem_mod.cxx, src/mblem_prog.cxx,
+	  src/mbma_mod.cxx, src/mbma_prog.cxx, src/mwu_chunker_mod.cxx,
+	  src/ner_tagger_mod.cxx, src/ucto_tokenizer_mod.cxx: Happy
+	  Newyear!
+
+2013-12-11 09:31  sloot
+
+	* [r16760] src/mbma_mod.cxx: changed warning in something less
+	  disturbing.
+
+2013-12-11 08:48  sloot
+
+	* [r16759] include/frog/mbma_mod.h, src/mbma_mod.cxx: small
+	  refactoring, in the process of better understanding
+
+2013-10-24 10:53  sloot
+
+	* [r16645] src/mbma_mod.cxx, src/ucto_tokenizer_mod.cxx: make
+	  '-pedantic' happy
+
+2013-10-24 10:38  sloot
+
+	* [r16643] include/frog/Parser.h: disabled the last Py_XDECREF()
+	  call in the program.
+	  In some cases is crashes. Don't know why, Don't now when.
+	  It shouldn't matter a lot, because we already terminate Frog.
+
+2013-10-17 12:42  sloot
+
+	* [r16619] bootstrap, bootstrap.sh, configure.ac: modernized
+
+2013-10-02 09:03  mvgompel
+
+	* [r16551] src/Frog.cxx: be more verbose in exception
+
+2013-08-22 12:57  sloot
+
+	* [r16483] src/mbma_mod.cxx: numb refeactoring
+
+2013-08-20 12:42  sloot
+
+	* [r16481] src/mbma_mod.cxx: readded hack
+
+2013-08-15 10:25  sloot
+
+	* [r16439] src/Frog.cxx: some emptyness removed :)
+
+2013-08-15 10:19  sloot
+
+	* [r16438] AUTHORS: credits added
+
+2013-08-15 10:17  sloot
+
+	* [r16437] src/Frog.cxx: be more picky on commandline errors
+
+2013-08-15 09:49  sloot
+
+	* [r16436] src/Frog.cxx: typo
+
+2013-08-08 16:06  sloot
+
+	* [r16422] src/mbma_mod.cxx: disable the gross hach for now
+
+2013-08-08 07:53  sloot
+
+	* [r16421] include/frog/mbma_mod.h, src/mbma_mod.cxx: fix Unicode
+	  problem.
+	  improved debug logging
+	  added a gross hack while inserting/deleting. It works sort off
+
+2013-08-08 07:51  sloot
+
+	* [r16420] src/mbma_prog.cxx: fix
+
+2013-08-08 07:51  sloot
+
+	* [r16419] src/ucto_tokenizer_mod.cxx: make sure to make a fresh
+	  start for every 'line'
+
+2013-07-31 07:43  sloot
+
+	* [r16403] src/mbma_mod.cxx: probably we want PN == N...
+
+2013-07-30 09:24  sloot
+
+	* [r16399] src/Frog.cxx: small improvement in debugging
+
+2013-06-12 14:55  sloot
+
+	* [r16232] src/mblem_mod.cxx: only strip suffixes from
+	  SPEC(deeleigen). Not from SPEC(vreemd) etc.
+
+2013-06-12 14:16  sloot
+
+	* [r16228] src/mblem_mod.cxx: removed debug line
+
+2013-06-12 14:15  sloot
+
+	* [r16227] src/mblem_mod.cxx: Fix suffixes for SPEC(deeleigen) tags
+
+2013-06-10 13:36  sloot
+
+	* [r16221] src/mblem_mod.cxx: small fix
+
+2013-06-10 12:31  sloot
+
+	* [r16220] src/mbma_mod.cxx: some refactoring.
+	  Als fixing a bug in code that is not used atm :)
+
+2013-06-10 09:55  sloot
+
+	* [r16217] src/mblem_mod.cxx: improved debugging (avoid output
+	  mangling)
+
+2013-06-10 09:34  sloot
+
+	* [r16216] src/mbma_mod.cxx, src/mbma_prog.cxx: be a bit more picky
+	  about lowercasing all words.
+
+2013-06-04 08:37  sloot
+
+	* [r16170] src/mblem_mod.cxx, src/mbma_mod.cxx: better debug info
+
+2013-06-03 12:33  sloot
+
+	* [r16164] include/frog/Frog.h, include/frog/cgn_tagger_mod.h,
+	  include/frog/mblem_mod.h, include/frog/mbma_mod.h,
+	  src/Frog-util.cxx, src/cgn_tagger_mod.cxx, src/mblem_mod.cxx,
+	  src/mbma_mod.cxx: added configurable character filters to CGN
+	  tagger, MBLEM annd MBMA
+
+2013-04-09 15:42  sloot
+
+	* [r15973] configure.ac, src/Frog.cxx: added support for BZ2 and GZ
+	  files (XML input and output only)
+
+2013-04-04 15:33  sloot
+
+	* [r15948] configure.ac: Bump version after release
+
+2013-04-04 12:22  sloot
+
+	* [r15946] docs/Makefile.am: oesp!
+
+2013-04-03 16:00  sloot
+
+	* [r15926] src/Makefile.am: increment library version
+
+2013-04-03 14:04  sloot
+
+	* [r15912] include/frog/Frog.h, include/frog/ucto_tokenizer_mod.h,
+	  src/Frog.cxx, src/Parser.cxx, src/cgn_tagger_mod.cxx,
+	  src/iob_tagger_mod.cxx, src/mblem_mod.cxx, src/mblem_prog.cxx,
+	  src/mbma_mod.cxx, src/mbma_prog.cxx, src/mwu_chunker_mod.cxx,
+	  src/ner_tagger_mod.cxx: changed folia include path!
+
 2013-04-03 13:15  sloot
 
 	* [r15906] NEWS, configure.ac: NEWS
diff --git a/INSTALL b/INSTALL
index a1e89e1..2099840 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
 Inc.
 
    Copying and distribution of this file, with or without modification,
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
@@ -309,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
 Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+an Autoconf limitation.  Until the limitation is lifted, you can use
+this workaround:
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+     CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
 
 `configure' Invocation
 ======================
@@ -367,4 +368,3 @@ operates.
 
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
-
diff --git a/Makefile.am b/Makefile.am
index b077511..d23b652 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,14 @@
-# $Id: Makefile.am 14570 2012-03-28 12:25:43Z sloot $
+# $Id: Makefile.am 17166 2014-04-30 10:17:38Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/Makefile.am $
 
 ACLOCAL_AMFLAGS = -I m4 --install
 
 SUBDIRS = src include scripts m4 docs tests
 
-EXTRA_DIST = bootstrap AUTHORS TODO NEWS
+EXTRA_DIST = bootstrap.sh AUTHORS TODO NEWS
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = frog.pc
 
 ChangeLog: $(top_srcdir)/NEWS
 	svn update; svn2cl --include-rev
diff --git a/Makefile.in b/Makefile.in
index 92331b4..6f9c16e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,9 +14,55 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 14570 2012-03-28 12:25:43Z sloot $
+# $Id: Makefile.am 17166 2014-04-30 10:17:38Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/Makefile.am $
+
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -37,14 +82,16 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-	TODO config.guess config.sub depcomp install-sh ltmain.sh \
-	missing py-compile
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/config.h.in $(srcdir)/frog.pc.in COPYING TODO \
+	compile config.guess config.sub depcomp install-sh missing \
+	py-compile ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -56,24 +103,93 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = frog.pc
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+DATA = $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
@@ -84,6 +200,7 @@ am__remove_distdir = \
       && rm -rf "$(distdir)" \
       || { sleep 5 && rm -rf "$(distdir)"; }; \
   else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -111,12 +228,14 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -162,7 +281,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -207,6 +325,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -280,7 +400,9 @@ ucto_CFLAGS = @ucto_CFLAGS@
 ucto_LIBS = @ucto_LIBS@
 ACLOCAL_AMFLAGS = -I m4 --install
 SUBDIRS = src include scripts m4 docs tests
-EXTRA_DIST = bootstrap AUTHORS TODO NEWS
+EXTRA_DIST = bootstrap.sh AUTHORS TODO NEWS
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = frog.pc
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -321,8 +443,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -334,6 +456,8 @@ $(srcdir)/config.h.in:  $(am__configure_deps)
 
 distclean-hdr:
 	-rm -f config.h stamp-h1
+frog.pc: $(top_builddir)/config.status $(srcdir)/frog.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -343,24 +467,48 @@ clean-libtool:
 
 distclean-libtool:
 	-rm -f libtool config.lt
+install-pkgconfigDATA: $(pkgconfig_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+	done
+
+uninstall-pkgconfigDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -375,57 +523,12 @@ $(RECURSIVE_TARGETS):
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -441,12 +544,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -458,15 +556,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -475,9 +569,31 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
@@ -513,13 +629,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -548,40 +661,42 @@ distdir: $(DISTFILES)
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-lzip: distdir
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
-	$(am__remove_distdir)
-
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-xz: distdir
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -592,8 +707,6 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
 	*.tar.lz*) \
 	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
@@ -605,18 +718,19 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && ../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -639,7 +753,7 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
@@ -671,9 +785,12 @@ distcleancheck: distclean
 	       exit 1; } >&2
 check-am: all-am
 check: check-recursive
-all-am: Makefile config.h
+all-am: Makefile $(DATA) config.h
 installdirs: installdirs-recursive
 installdirs-am:
+	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
 install: install-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
@@ -726,7 +843,7 @@ info: info-recursive
 
 info-am:
 
-install-data-am:
+install-data-am: install-pkgconfigDATA
 
 install-dvi: install-dvi-recursive
 
@@ -772,26 +889,26 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
-	dist-zip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags tags-recursive uninstall uninstall-am
+uninstall-am: uninstall-pkgconfigDATA
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-cscope clean-generic \
+	clean-libtool cscope cscopelist-am ctags ctags-am dist \
+	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
+	dist-xz dist-zip distcheck distclean distclean-generic \
+	distclean-hdr distclean-libtool distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-pkgconfigDATA \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-pkgconfigDATA
 
 
 ChangeLog: $(top_srcdir)/NEWS
diff --git a/NEWS b/NEWS
index ec684a4..2eefe8d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
+0.12.18 - 2014-06
+ * a lot of changes in the MBMA module. It now can produce nested morphemes
+     using the --daring option of frog. Still experimental!
+ * Frog can now run interactive with readline support too.
+ * -t option is optional, multiple inputfiles are supported
+ * -o works for multiple files
+
 0.12.17 - 2013-04-03
  * the servermode now kan handle multiline input (non XML only).
-   Can be switched of with the -n option. 
+   Can be switched of with the -n option.
  * A lot of refactoring regarding FoLiA stuff
  * start using ticcutils
  * the -Q option now works
@@ -79,7 +86,7 @@
 
 0.12.6 - 2011-12-22
   * merged with the foliabased branch. So now we use the folia based Tokenizer.
-    folia XML is now the main interface between the modules in Frog. 
+    folia XML is now the main interface between the modules in Frog.
 
 0.12.5 - 2011-10-10
   * is released
@@ -106,7 +113,7 @@
 
 0.12.0 - 2011-03-21
 { Ko vd Sloot ]
-* decapped progs and man 
+* decapped progs and man
 
 0.11.1 - 2011-03-20
 
diff --git a/aclocal.m4 b/aclocal.m4
index cf5b2bd..f3d389a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,8 +1,7 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -12,33 +11,31 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -54,24 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -90,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -116,22 +111,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -150,16 +142,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -169,7 +159,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -182,12 +172,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -195,8 +186,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -236,16 +227,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -254,8 +245,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -263,7 +254,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -311,7 +302,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -321,9 +312,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
@@ -338,20 +333,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -364,7 +357,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -376,21 +369,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -408,7 +399,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -418,18 +409,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 16
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -442,7 +436,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -471,31 +465,40 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
@@ -506,34 +509,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-		  [_AM_DEPENDENCIES(CC)],
-		  [define([AC_PROG_CC],
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-		  [_AM_DEPENDENCIES(CXX)],
-		  [define([AC_PROG_CXX],
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-		  [_AM_DEPENDENCIES(OBJC)],
-		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -555,15 +602,12 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -577,16 +621,14 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -602,14 +644,12 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
-
 # AM_MAKE_INCLUDE()
 # -----------------
 # Check to see how make treats includes.
@@ -627,7 +667,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -654,15 +694,12 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -670,11 +707,10 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -687,54 +723,22 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
@@ -744,7 +748,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 # --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
 # ------------------------
@@ -758,14 +762,59 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
-# 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
 
 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # ---------------------------------------------------------------------------
@@ -794,7 +843,7 @@ AC_DEFUN([AM_PATH_PYTHON],
   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
   dnl supported. (2.0 was released on October 16, 2000).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
+[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
 
   AC_ARG_VAR([PYTHON], [the Python interpreter])
@@ -810,10 +859,11 @@ AC_DEFUN([AM_PATH_PYTHON],
     dnl A version check is needed.
     if test -n "$PYTHON"; then
       # If the user set $PYTHON, use it and don't search something else.
-      AC_MSG_CHECKING([whether $PYTHON version >= $1])
+      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
-			      [AC_MSG_RESULT(yes)],
-			      [AC_MSG_ERROR(too old)])
+			      [AC_MSG_RESULT([yes])],
+			      [AC_MSG_RESULT([no])
+			       AC_MSG_ERROR([Python interpreter is too old])])
       am_display_PYTHON=$PYTHON
     else
       # Otherwise, try each interpreter until we find one that satisfies
@@ -862,6 +912,25 @@ AC_DEFUN([AM_PATH_PYTHON],
     [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
   AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
 
+  # Just factor out some code duplication.
+  am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x.  See automake bug#10227.
+try:
+    import sysconfig
+except ImportError:
+    can_use_sysconfig = 0
+else:
+    can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+    from platform import python_implementation
+    if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
+        can_use_sysconfig = 0
+except ImportError:
+    pass"
 
   dnl Set up 4 directories:
 
@@ -878,7 +947,14 @@ AC_DEFUN([AM_PATH_PYTHON],
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
+     am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -913,7 +989,14 @@ AC_DEFUN([AM_PATH_PYTHON],
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
+     am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -961,14 +1044,12 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
 sys.exit(sys.hexversion < minverhex)"
   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_RUN_LOG(COMMAND)
 # -------------------
 # Run COMMAND, save the exit status in ac_status, and log it.
@@ -982,22 +1063,16 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -1008,32 +1083,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -1043,46 +1126,118 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1096,18 +1251,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -1117,82 +1270,121 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([m4/ac_python_devel.m4])
 m4_include([m4/ax_icu_check.m4])
+m4_include([m4/ax_lib_readline.m4])
 m4_include([m4/ax_pthread.m4])
 m4_include([m4/libtool.m4])
 m4_include([m4/ltoptions.m4])
diff --git a/bootstrap b/bootstrap.sh
similarity index 90%
rename from bootstrap
rename to bootstrap.sh
index 2570f0f..a6d82b7 100644
--- a/bootstrap
+++ b/bootstrap.sh
@@ -1,5 +1,5 @@
-# $Id: bootstrap 15362 2012-10-30 12:37:03Z mvgompel $
-# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/bootstrap $
+# $Id: bootstrap.sh 16619 2013-10-17 12:42:02Z sloot $
+# $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/bootstrap.sh $
 
 # bootstrap - script to bootstrap the distribution rolling engine
 
@@ -22,7 +22,7 @@ automake=automake
 aclocal=aclocal
 
 # if you want to autogenerate a ChangeLog form svn:
-# 
+#
 #  svn2cl, a python script, as used in the GNU Enterprise project.
 #    By jcater (Jason Cater), contributions by reinhard (Reinhard Müller).
 #    Get it from
@@ -46,16 +46,10 @@ aclocal=aclocal
    found=false
    for d in $acdirs
    do
-      if test -f ${d}ac_define_dir.m4
+      if test -f ${d}pkg.m4
       then
          found=true
          break
-      else
-	if test -f ${d}ax_define_dir.m4
-      	then
-	  found=true
-          break
-        fi
       fi
    done
 
@@ -81,7 +75,7 @@ fi
 
 if $aclocal --version|head -1 |grep ' 1\.[4-8]'; then
     echo "aclocal 1.4-1.8 is active. You should use aclocal 1.9 or later"
-    if test -f /etc/debian_version; then	
+    if test -f /etc/debian_version; then
         echo " sudo apt-get install aclocal1.9"
         echo " sudo update-alternatives --config aclocal"
     fi
diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
index d622a44..b79252d 100755
--- a/config.guess
+++ b/config.guess
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2013-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -801,6 +820,9 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
@@ -852,21 +874,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +901,54 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -950,54 +967,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1227,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1227,19 +1256,21 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1287,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
 	echo neo-tandem-nsk${UNAME_RELEASE}
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,9 +1361,6 @@ EOF
 	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
 eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
diff --git a/config.h.in b/config.h.in
index 2ac55f8..a10231f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,12 +10,21 @@
 /* Define to 1 if you have the `fork' function. */
 #undef HAVE_FORK
 
+/* Define to 1 if you have the <history.h> header file. */
+#undef HAVE_HISTORY_H
+
 /* we want to use ICU */
 #undef HAVE_ICU
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if you have a readline compatible library */
+#undef HAVE_LIBREADLINE
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -37,6 +46,18 @@
 /* Define to 1 if you have the <Python.h> header file. */
 #undef HAVE_PYTHON_H
 
+/* Define to 1 if you have the <readline.h> header file. */
+#undef HAVE_READLINE_H
+
+/* Define if your readline library has \`add_history' */
+#undef HAVE_READLINE_HISTORY
+
+/* Define to 1 if you have the <readline/history.h> header file. */
+#undef HAVE_READLINE_HISTORY_H
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+#undef HAVE_READLINE_READLINE_H
+
 /* Define to 1 if stdbool.h conforms to C99. */
 #undef HAVE_STDBOOL_H
 
diff --git a/config.sub b/config.sub
index c894da4..9633db7 100755
--- a/config.sub
+++ b/config.sub
@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2013-08-10'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,7 +116,7 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
@@ -156,7 +149,7 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
@@ -225,6 +218,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -253,10 +252,12 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| epiphany \
 	| fido | fr30 | frv \
@@ -267,7 +268,7 @@ case $basic_machine in
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -285,16 +286,17 @@ case $basic_machine in
 	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
 	| open8 \
-	| or32 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
@@ -364,13 +366,13 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -383,7 +385,8 @@ case $basic_machine in
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -401,12 +404,13 @@ case $basic_machine in
 	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
 	| orion-* \
@@ -782,11 +786,15 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -822,7 +830,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1013,7 +1021,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1340,21 +1352,21 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1486,9 +1498,6 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
@@ -1537,6 +1546,12 @@ case $basic_machine in
 	c4x-* | tic4x-*)
 		os=-coff
 		;;
+	c8051-*)
+		os=-elf
+		;;
+	hexagon-*)
+		os=-elf
+		;;
 	tic54x-*)
 		os=-coff
 		;;
@@ -1577,6 +1592,9 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/configure b/configure
index 1a5f96e..63591cd 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for frog 0.12.17.
+# Generated by GNU Autoconf 2.69 for frog 0.12.18.
 #
 # Report bugs to <timbl at uvt.nl>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -338,6 +366,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -459,6 +495,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -493,16 +533,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -514,28 +554,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -569,8 +589,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='frog'
 PACKAGE_TARNAME='frog'
-PACKAGE_VERSION='0.12.17'
-PACKAGE_STRING='frog 0.12.17'
+PACKAGE_VERSION='0.12.18'
+PACKAGE_STRING='frog 0.12.18'
 PACKAGE_BUGREPORT='timbl at uvt.nl'
 PACKAGE_URL=''
 
@@ -650,6 +670,8 @@ ICU_CPPSEARCHPATH
 ICU_CXXFLAGS
 ICU_CFLAGS
 ICU_CONFIG
+XML2_LIBS
+XML2_CFLAGS
 pkgconfigpath
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
@@ -659,7 +681,6 @@ PTHREAD_LIBS
 PTHREAD_CC
 ax_pthread_config
 SYSCONFDIR
-LIBTOOL_DEPS
 CXXCPP
 CPP
 OTOOL64
@@ -668,6 +689,7 @@ LIPO
 NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
+RANLIB
 ac_ct_AR
 AR
 DLLTOOL
@@ -696,7 +718,6 @@ build_vendor
 build_cpu
 build
 LIBTOOL
-RANLIB
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
@@ -714,6 +735,10 @@ CPPFLAGS
 LDFLAGS
 CXXFLAGS
 CXX
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -778,6 +803,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 enable_dependency_tracking
 enable_shared
 enable_static
@@ -811,6 +837,8 @@ CXXCPP
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
+XML2_CFLAGS
+XML2_LIBS
 timbl_CFLAGS
 timbl_LIBS
 ticcutils_CFLAGS
@@ -1280,8 +1308,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1367,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures frog 0.12.17 to adapt to many kinds of systems.
+\`configure' configures frog 0.12.18 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1437,7 +1463,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of frog 0.12.17:";;
+     short | recursive ) echo "Configuration of frog 0.12.18:";;
    esac
   cat <<\_ACEOF
 
@@ -1445,8 +1471,12 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -1487,6 +1517,8 @@ Some influential environment variables:
               directories to add to pkg-config's search path
   PKG_CONFIG_LIBDIR
               path overriding pkg-config's built-in search path
+  XML2_CFLAGS C compiler flags for XML2, overriding pkg-config
+  XML2_LIBS   linker flags for XML2, overriding pkg-config
   timbl_CFLAGS
               C compiler flags for timbl, overriding pkg-config
   timbl_LIBS  linker flags for timbl, overriding pkg-config
@@ -1577,10 +1609,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-frog configure 0.12.17
-generated by GNU Autoconf 2.68
+frog configure 0.12.18
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1694,7 +1726,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1954,7 +1986,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2230,8 +2262,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by frog $as_me 0.12.17, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by frog $as_me 0.12.18, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2578,7 +2610,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.11'
+am__api_version='1.14'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2646,7 +2678,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2704,9 +2736,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -2717,32 +2746,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -2754,6 +2791,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2776,12 +2823,12 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -2793,10 +2840,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -2815,7 +2862,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2855,7 +2902,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2906,7 +2953,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
 	     'mkdir (GNU coreutils) '* | \
 	     'mkdir (coreutils) '* | \
@@ -2935,12 +2982,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -2959,7 +3000,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3023,6 +3064,45 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -3045,7 +3125,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='frog'
- VERSION='0.12.17'
+ VERSION='0.12.18'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3073,12 +3153,22 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
@@ -3086,6 +3176,48 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -3126,7 +3258,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3170,7 +3302,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3623,7 +3755,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -3679,8 +3811,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -3715,16 +3847,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -3733,8 +3865,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -3742,7 +3874,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -3801,98 +3933,6 @@ if $cxx_flags_were_set; then
   CXXFLAGS=$CXXFLAGS
 fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
 # use libtool
 case `pwd` in
   *\ * | *\	*)
@@ -4081,7 +4121,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4121,7 +4161,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4174,7 +4214,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4215,7 +4255,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -4273,7 +4313,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4317,7 +4357,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4513,8 +4553,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4599,6 +4638,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -4610,8 +4708,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -4646,16 +4744,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4664,8 +4762,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -4673,7 +4771,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4749,7 +4847,7 @@ do
     for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      as_fn_executable_p "$ac_path_SED" || continue
 # Check for GNU ac_path_SED and select it if it is found.
   # Check for GNU $ac_path_SED
 case `"$ac_path_SED" --version 2>&1` in
@@ -4825,7 +4923,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4891,7 +4989,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4958,7 +5056,7 @@ do
     for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      as_fn_executable_p "$ac_path_FGREP" || continue
 # Check for GNU ac_path_FGREP and select it if it is found.
   # Check for GNU $ac_path_FGREP
 case `"$ac_path_FGREP" --version 2>&1` in
@@ -5214,7 +5312,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5258,7 +5356,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5677,7 +5775,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5717,7 +5815,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6023,7 +6121,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6063,7 +6161,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6167,7 +6265,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6211,7 +6309,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_AR="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6336,7 +6434,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6376,7 +6474,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6435,7 +6533,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6475,7 +6573,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7110,7 +7208,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7150,7 +7248,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7230,7 +7328,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7270,7 +7368,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7322,7 +7420,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7362,7 +7460,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7414,7 +7512,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7454,7 +7552,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_LIPO="lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7506,7 +7604,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7546,7 +7644,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL="otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7598,7 +7696,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7638,7 +7736,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL64="otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -15348,60 +15446,60 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
-
-	struct s { _Bool s: 1; _Bool t; } s;
-
-	char a[true == 1 ? 1 : -1];
-	char b[false == 0 ? 1 : -1];
-	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-	char d[(bool) 0.5 == true ? 1 : -1];
-	/* See body of main program for 'e'.  */
-	char f[(_Bool) 0.0 == false ? 1 : -1];
-	char g[true];
-	char h[sizeof (_Bool)];
-	char i[sizeof s.t];
-	enum { j = false, k = true, l = false * true, m = true * 256 };
-	/* The following fails for
-	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-	_Bool n[m];
-	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-	/* Catch a bug in an HP-UX C compiler.  See
-	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-	 */
-	_Bool q = true;
-	_Bool *pq = &q;
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
 
 int
 main ()
 {
 
-	bool e = &s;
-	*pq |= q;
-	*pq |= ! q;
-	/* Refer to every declared value, to avoid compiler optimizations.  */
-	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-		+ !m + !n + !o + !p + !q + !pq);
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
 
   ;
   return 0;
@@ -15416,7 +15514,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
-ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+   ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
 if test "x$ac_cv_type__Bool" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
@@ -15426,6 +15524,7 @@ _ACEOF
 
 fi
 
+
 if test $ac_cv_header_stdbool_h = yes; then
 
 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
@@ -15828,6 +15927,17 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
 
 fi
 
+for ac_func in localtime_r
+do :
+  ac_fn_cxx_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r"
+if test "x$ac_cv_func_localtime_r" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LOCALTIME_R 1
+_ACEOF
+
+fi
+done
+
 
 
 
@@ -15918,8 +16028,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
 # --thread-safe: KAI C++
 # pthread-config: use pthread-config program (for GNU Pth library)
 
-case "${host_cpu}-${host_os}" in
-        *solaris*)
+case ${host_os} in
+        solaris*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -15932,11 +16042,42 @@ case "${host_cpu}-${host_os}" in
         ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
         ;;
 
-        *-darwin*)
+        darwin*)
         ax_pthread_flags="-pthread $ax_pthread_flags"
         ;;
 esac
 
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs -Werror to reject unknown flags" >&5
+$as_echo_n "checking if compiler needs -Werror to reject unknown flags... " >&6; }
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo(void);
+int
+main ()
+{
+foo()
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  ax_pthread_extra_flags=
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+
 if test x"$ax_pthread_ok" = xno; then
 for flag in $ax_pthread_flags; do
 
@@ -15969,7 +16110,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ax_pthread_config="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16006,7 +16147,7 @@ $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
         save_LIBS="$LIBS"
         save_CFLAGS="$CFLAGS"
         LIBS="$PTHREAD_LIBS $LIBS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
 
         # Check for various functions.  We must include pthread.h,
         # since some functions may be macros.  (On the Sequent, we
@@ -16097,12 +16238,20 @@ _ACEOF
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
 $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
         flag=no
-        case "${host_cpu}-${host_os}" in
-            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
-            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        case ${host_os} in
+            aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+            osf* | hpux*) flag="-D_REENTRANT";;
+            solaris*)
+            if test "$GCC" = "yes"; then
+                flag="-D_REENTRANT"
+            else
+                # TODO: What about Clang on Solaris?
+                flag="-mt -D_REENTRANT"
+            fi
+            ;;
         esac
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
-$as_echo "${flag}" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag" >&5
+$as_echo "$flag" >&6; }
         if test "x$flag" != xno; then
             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
         fi
@@ -16115,8 +16264,7 @@ else
 
                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-                    #include <pthread.h>
+#include <pthread.h>
 int
 main ()
 {
@@ -16145,9 +16293,20 @@ fi
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        # More AIX lossage: must compile with xlc_r or cc_r
-        if test x"$GCC" != xyes; then
-          for ac_prog in xlc_r cc_r
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != xyes; then
+            case $host_os in
+                aix*)
+                case "x/$CC" in #(
+  x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+    #handle absolute path differently from PATH based program lookup
+                   case "x$CC" in #(
+  x/*) :
+    if as_fn_executable_p ${CC}_r; then :
+  PTHREAD_CC="${CC}_r"
+fi ;; #(
+  *) :
+    for ac_prog in ${CC}_r
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -16165,7 +16324,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_PTHREAD_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16188,15 +16347,19 @@ fi
 
   test -n "$PTHREAD_CC" && break
 done
-test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
-
-        else
-          PTHREAD_CC=$CC
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+ ;;
+esac ;; #(
+  *) :
+     ;;
+esac
+                ;;
+            esac
         fi
-else
-        PTHREAD_CC="$CC"
 fi
 
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
 
 
 
@@ -16319,7 +16482,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16362,7 +16525,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16430,7 +16593,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_pkgconfigpath="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16461,6 +16624,229 @@ if test "$pkgconfigpath" != "NONE"; then
   fi
 fi
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2" >&5
+$as_echo_n "checking for XML2... " >&6; }
+
+if test -n "$XML2_CFLAGS"; then
+    pkg_cv_XML2_CFLAGS="$XML2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.16 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.16 ") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6.16 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XML2_LIBS"; then
+    pkg_cv_XML2_LIBS="$XML2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.16 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.16 ") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6.16 " 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        XML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0 >= 2.6.16 " 2>&1`
+        else
+	        XML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0 >= 2.6.16 " 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$XML2_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (libxml-2.0 >= 2.6.16 ) were not met:
+
+$XML2_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables XML2_CFLAGS
+and XML2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables XML2_CFLAGS
+and XML2_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	XML2_CFLAGS=$pkg_cv_XML2_CFLAGS
+	XML2_LIBS=$pkg_cv_XML2_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+CXXFLAGS="$CXXFLAGS $XML2_CFLAGS"
+LIBS="$XML2_LIBS $LIBS"
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5
+$as_echo_n "checking for a readline compatible library... " >&6; }
+if ${ax_cv_lib_readline+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    ORIG_LIBS="$LIBS"
+    for readline_lib in readline edit editline; do
+      for termcap_lib in "" termcap curses ncurses; do
+        if test -z "$termcap_lib"; then
+          TRY_LIB="-l$readline_lib"
+        else
+          TRY_LIB="-l$readline_lib -l$termcap_lib"
+        fi
+        LIBS="$ORIG_LIBS $TRY_LIB"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ax_cv_lib_readline="$TRY_LIB"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        if test -n "$ax_cv_lib_readline"; then
+          break
+        fi
+      done
+      if test -n "$ax_cv_lib_readline"; then
+        break
+      fi
+    done
+    if test -z "$ax_cv_lib_readline"; then
+      ax_cv_lib_readline="no"
+    fi
+    LIBS="$ORIG_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline" >&5
+$as_echo "$ax_cv_lib_readline" >&6; }
+
+  if test "$ax_cv_lib_readline" != "no"; then
+    LIBS="$LIBS $ax_cv_lib_readline"
+
+$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
+
+    for ac_header in readline.h readline/readline.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5
+$as_echo_n "checking whether readline supports history... " >&6; }
+if ${ax_cv_lib_readline_history+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      ax_cv_lib_readline_history="no"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char add_history ();
+int
+main ()
+{
+return add_history ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ax_cv_lib_readline_history="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline_history" >&5
+$as_echo "$ax_cv_lib_readline_history" >&6; }
+    if test "$ax_cv_lib_readline_history" = "yes"; then
+
+$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h
+
+      for ac_header in history.h readline/history.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    fi
+  fi
+
+
+
 #check for needed dependencies
 useICU=1;
 # inspired by feh-1.3.4/configure.ac.  Tnx Tom Gilbert and feh hackers.
@@ -16499,7 +16885,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -16730,12 +17116,12 @@ if test -n "$ticcutils_CFLAGS"; then
     pkg_cv_ticcutils_CFLAGS="$ticcutils_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.4 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.4 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.5 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.5 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ticcutils_CFLAGS=`$PKG_CONFIG --cflags "ticcutils >= 0.4 " 2>/dev/null`
+  pkg_cv_ticcutils_CFLAGS=`$PKG_CONFIG --cflags "ticcutils >= 0.5 " 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -16747,12 +17133,12 @@ if test -n "$ticcutils_LIBS"; then
     pkg_cv_ticcutils_LIBS="$ticcutils_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.4 \""; } >&5
-  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.4 ") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ticcutils >= 0.5 \""; } >&5
+  ($PKG_CONFIG --exists --print-errors "ticcutils >= 0.5 ") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ticcutils_LIBS=`$PKG_CONFIG --libs "ticcutils >= 0.4 " 2>/dev/null`
+  pkg_cv_ticcutils_LIBS=`$PKG_CONFIG --libs "ticcutils >= 0.5 " 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -16773,14 +17159,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ticcutils >= 0.4 " 2>&1`
+	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ticcutils >= 0.5 " 2>&1`
         else
-	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ticcutils >= 0.4 " 2>&1`
+	        ticcutils_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ticcutils >= 0.5 " 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$ticcutils_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (ticcutils >= 0.4 ) were not met:
+	as_fn_error $? "Package requirements (ticcutils >= 0.5 ) were not met:
 
 $ticcutils_PKG_ERRORS
 
@@ -17038,12 +17424,12 @@ if test -n "$folia_CFLAGS"; then
     pkg_cv_folia_CFLAGS="$folia_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.10\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "folia >= 0.10") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "folia >= 0.11") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_folia_CFLAGS=`$PKG_CONFIG --cflags "folia >= 0.10" 2>/dev/null`
+  pkg_cv_folia_CFLAGS=`$PKG_CONFIG --cflags "folia >= 0.11" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -17055,12 +17441,12 @@ if test -n "$folia_LIBS"; then
     pkg_cv_folia_LIBS="$folia_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.10\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "folia >= 0.10") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"folia >= 0.11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "folia >= 0.11") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_folia_LIBS=`$PKG_CONFIG --libs "folia >= 0.10" 2>/dev/null`
+  pkg_cv_folia_LIBS=`$PKG_CONFIG --libs "folia >= 0.11" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -17081,14 +17467,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        folia_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "folia >= 0.10" 2>&1`
+	        folia_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "folia >= 0.11" 2>&1`
         else
-	        folia_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "folia >= 0.10" 2>&1`
+	        folia_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "folia >= 0.11" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$folia_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (folia >= 0.10) were not met:
+	as_fn_error $? "Package requirements (folia >= 0.11) were not met:
 
 $folia_PKG_ERRORS
 
@@ -17248,8 +17634,8 @@ fi
 
         if test -n "$PYTHON"; then
       # If the user set $PYTHON, use it and don't search something else.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.5" >&5
-$as_echo_n "checking whether $PYTHON version >= 2.5... " >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.5" >&5
+$as_echo_n "checking whether $PYTHON version is >= 2.5... " >&6; }
       prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
 # because we need at least 4 digits for the hex conversion.
@@ -17267,7 +17653,9 @@ sys.exit(sys.hexversion < minverhex)"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  as_fn_error $? "too old" "$LINENO" 5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+			       as_fn_error $? "Python interpreter is too old" "$LINENO" 5
 fi
       am_display_PYTHON=$PYTHON
     else
@@ -17279,7 +17667,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -17323,7 +17711,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -17386,6 +17774,25 @@ $as_echo "$am_cv_python_platform" >&6; }
   PYTHON_PLATFORM=$am_cv_python_platform
 
 
+  # Just factor out some code duplication.
+  am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x.  See automake bug#10227.
+try:
+    import sysconfig
+except ImportError:
+    can_use_sysconfig = 0
+else:
+    can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+    from platform import python_implementation
+    if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
+        can_use_sysconfig = 0
+except ImportError:
+    pass"
 
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
@@ -17399,7 +17806,14 @@ else
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
+     am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pythondir in
      $am_py_prefix*)
        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -17436,7 +17850,14 @@ else
      else
        am_py_exec_prefix=$exec_prefix
      fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
+     am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+    from distutils import sysconfig
+    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
      case $am_cv_python_pyexecdir in
      $am_py_exec_prefix*)
        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -17498,7 +17919,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -17845,7 +18266,7 @@ fi
 done
 
 
-ac_config_files="$ac_config_files Makefile m4/Makefile docs/Makefile scripts/Makefile tests/Makefile src/Makefile include/Makefile include/frog/Makefile"
+ac_config_files="$ac_config_files Makefile frog.pc m4/Makefile docs/Makefile scripts/Makefile tests/Makefile src/Makefile include/Makefile include/frog/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -17956,6 +18377,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -18274,16 +18703,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -18343,28 +18772,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -18385,8 +18802,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by frog $as_me 0.12.17, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by frog $as_me 0.12.18, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -18451,11 +18868,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-frog config.status 0.12.17
-configured by $0, generated by GNU Autoconf 2.68,
+frog config.status 0.12.18
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -18546,7 +18963,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -18961,6 +19378,7 @@ do
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "frog.pc") CONFIG_FILES="$CONFIG_FILES frog.pc" ;;
     "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
     "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
     "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
@@ -19564,7 +19982,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -19577,7 +19995,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -19611,21 +20029,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
diff --git a/configure.ac b/configure.ac
index 6a084ef..feaa6b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,10 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
-# $Id: configure.ac 15906 2013-04-03 13:15:22Z sloot $
+# $Id: configure.ac 17474 2014-08-05 09:55:58Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/configure.ac $
 
 AC_PREREQ(2.59)
-AC_INIT([frog], [0.12.17], [timbl at uvt.nl])
+AC_INIT([frog], [0.12.18], [timbl at uvt.nl])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
@@ -24,10 +24,9 @@ if $cxx_flags_were_set; then
   CXXFLAGS=$CXXFLAGS
 fi
 
-AC_PROG_RANLIB
 # use libtool
 AC_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
+LT_INIT
 
 SYSCONFDIR=$sysconfdir
 AC_SUBST([SYSCONFDIR])
@@ -45,6 +44,7 @@ AC_TYPE_SIZE_T
 
 # Checks for library functions.
 AC_FUNC_FORK
+AC_CHECK_FUNCS([localtime_r])
 
 ACX_PTHREAD([],[AC_MSG_ERROR([We need pthread support!])])
 
@@ -71,6 +71,12 @@ if test "$pkgconfigpath" != "NONE"; then
      export PKG_CONFIG_PATH=""
   fi
 fi
+PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.6.16] )
+CXXFLAGS="$CXXFLAGS $XML2_CFLAGS"
+LIBS="$XML2_LIBS $LIBS"
+
+AX_LIB_READLINE
+
 
 #check for needed dependencies
 useICU=1;
@@ -106,7 +112,7 @@ AC_ARG_WITH(ticcutils,
        [  --with-ticcutils=DIR       use ticcutils installed in <DIR>],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$withval/lib/pkgconfig"],
        [PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$prefix/lib/pkgconfig"])
-PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.4] )
+PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.5] )
 CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
 LIBS="$ticcutils_LIBS $LIBS"
 
@@ -131,7 +137,7 @@ AC_ARG_WITH(folia,
        [PKG_CONFIG_PATH="$withval/lib/pkgconfig:$PKG_CONFIG_PATH"],
        [PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"])
 AC_MSG_NOTICE( [pkg-config search path: $PKG_CONFIG_PATH] )
-PKG_CHECK_MODULES([folia],[folia >= 0.10])
+PKG_CHECK_MODULES([folia],[folia >= 0.11])
 CXXFLAGS="$CXXFLAGS $folia_CFLAGS"
 LIBS="$folia_LIBS $LIBS"
 
@@ -178,6 +184,7 @@ AC_CHECK_HEADERS( [Python.h], , AC_MSG_FAILURE("can't find Python C API") )
 
 AC_OUTPUT([
   Makefile
+  frog.pc
   m4/Makefile
   docs/Makefile
   scripts/Makefile
diff --git a/depcomp b/depcomp
index bd0ac08..4ebd5b3 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2011-12-04.11; # UTC
+scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,9 +27,9 @@ scriptversion=2011-12-04.11; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,8 +39,8 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
   tmpdepfile  Temporary file to use when outputting dependencies.
@@ -57,6 +56,66 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -80,26 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
 fi
 
 if test "$depmode" = msvc7msys; then
-   # This is just like msvc7 but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvc7
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -122,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -131,13 +198,17 @@ gcc3)
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -145,33 +216,31 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
 ## well.  hp depmode also adds that space, but also prefixes the VPATH
 ## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
-      | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -189,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -198,43 +266,41 @@ sgi)
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -247,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -258,44 +322,100 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
 
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -307,8 +427,8 @@ icc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -319,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -332,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -343,77 +461,61 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
-	       s/^ *//
-	       s/ \\*$//
-	       s/$/:/
-	       p
-	     }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
 
 msvc7)
   if test "$libtool" = yes; then
@@ -424,8 +526,7 @@ msvc7)
   "$@" $showIncludes > "$tmpdepfile"
   stat=$?
   grep -v '^Note: including file: ' "$tmpdepfile"
-  if test "$stat" = 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -443,14 +544,15 @@ msvc7)
   p
 }' | $cygpath_u | sort -u | sed -n '
 s/ /\\ /g
-s/\(.*\)/	\1 \\/p
+s/\(.*\)/'"$tab"'\1 \\/p
 s/.\(.*\) \\/\1:/
 H
 $ {
-  s/.*/	/
+  s/.*/'"$tab"'/
   G
   p
 }' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
   rm -f "$tmpdepfile"
   ;;
 
@@ -478,7 +580,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -498,18 +600,18 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -562,11 +664,12 @@ makedepend)
   # makedepend may prepend the VPATH from the source file name to the object.
   # No need to regex-escape $object, excess matching of '.' is harmless.
   sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -583,7 +686,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -602,10 +705,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -637,23 +740,23 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-	set fnord "$@"
-	shift
-	shift
-	;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-	set fnord "$@" "$arg"
-	shift
-	shift
-	;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/docs/Makefile.in b/docs/Makefile.in
index e093494..cc339d4 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,6 +17,51 @@
 # $Id: Makefile.am 15946 2013-04-04 12:22:16Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/docs/Makefile.am $
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -37,10 +81,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = docs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -52,8 +97,25 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -85,9 +147,11 @@ man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
 MANS = $(man1_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -133,7 +197,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -178,6 +241,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -292,9 +357,18 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-man1: $(man1_MANS)
 	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
+	@list1='$(man1_MANS)'; \
+	list2=''; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
 	} | while read p; do \
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; echo "$$p"; \
@@ -322,27 +396,14 @@ uninstall-man1:
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
-	@list='$(MANS)'; if test -n "$$list"; then \
-	  list=`for p in $$list; do \
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-	  if test -n "$$list" && \
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
-	    exit 1; \
-	  else :; fi; \
-	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -480,16 +541,17 @@ uninstall-man: uninstall-man1
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-man1 \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	uninstall uninstall-am uninstall-man uninstall-man1
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man1 install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags-am uninstall uninstall-am uninstall-man \
+	uninstall-man1
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/frog.pc.in b/frog.pc.in
new file mode 100644
index 0000000..2d418a7
--- /dev/null
+++ b/frog.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: frog
+Version: @VERSION@
+Description: Frog stuff
+Requires.private: libxml-2.0
+Libs: -L${libdir} -lfrog
+Libs.private: @LIBS@
+Cflags: -I${includedir}
diff --git a/include/Makefile.in b/include/Makefile.in
index 1789b73..1687d68 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -20,6 +19,51 @@
 
 #AUTOMAKE_OPTIONS = foreign 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -39,10 +83,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = include
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -54,20 +99,58 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
@@ -99,6 +182,7 @@ am__relativize = \
   reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -144,7 +228,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -189,6 +272,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -302,22 +387,25 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -332,57 +420,12 @@ $(RECURSIVE_TARGETS):
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -398,12 +441,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -415,15 +453,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -432,6 +466,21 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -468,13 +517,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -595,22 +641,20 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-generic clean-libtool \
-	ctags ctags-recursive distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/include/frog/Frog.h b/include/frog/Frog.h
index 27932d1..490bc31 100755
--- a/include/frog/Frog.h
+++ b/include/frog/Frog.h
@@ -1,30 +1,30 @@
 /*
-  $Id: Frog.h 15912 2013-04-03 14:04:30Z sloot $
+  $Id: Frog.h 17436 2014-07-09 13:13:35Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/Frog.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
-  
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by  
-  the Free Software Foundation; either version 3 of the License, or  
-  (at your option) any later version.  
-  
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
   frog is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of  
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
-  GNU General Public License for more details.  
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-  You should have received a copy of the GNU General Public License  
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.  
-  
   For questions and suggestions, see:
       http://ilk.uvt.nl/software.html
   or send mail to:
       timbl at uvt.nl
-*/                                                                   
+*/
 
 
 #ifndef FROG_H
@@ -38,17 +38,13 @@
 
 std::string prefix( const std::string&, const std::string& );
 bool existsDir( const std::string& );
-std::string& trim(std::string &str);
 std::string getTime();
 
-void getFileNames( const std::string&, const std::string&, 
+void getFileNames( const std::string&, const std::string&,
 		   std::set<std::string>& );
 
 extern TiCC::LogStream *theErrLog;
 
-extern int tpDebug;
-extern TiCC::Configuration configuration;
-
 class TimerBlock{
 public:
   TiCC::Timer parseTimer;
diff --git a/include/frog/Makefile.in b/include/frog/Makefile.in
index e72bce5..df5d934 100644
--- a/include/frog/Makefile.in
+++ b/include/frog/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +15,51 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,11 +79,12 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = include/frog
-DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(pkginclude_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -51,8 +96,25 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -82,11 +144,29 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
 HEADERS = $(pkginclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -132,7 +212,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -177,6 +256,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -293,8 +374,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
 	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -310,26 +394,15 @@ uninstall-pkgincludeHEADERS:
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -341,15 +414,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -358,6 +427,21 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -497,18 +581,19 @@ uninstall-am: uninstall-pkgincludeHEADERS
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool ctags distclean distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-pkgincludeHEADERS install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkgincludeHEADERS
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-pkgincludeHEADERS install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-pkgincludeHEADERS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/include/frog/Parser.h b/include/frog/Parser.h
index ab504c0..3a6eae9 100644
--- a/include/frog/Parser.h
+++ b/include/frog/Parser.h
@@ -1,12 +1,12 @@
 /*
-  $Id: Parser.h 15572 2013-01-07 14:59:11Z sloot $
+  $Id: Parser.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/Parser.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog.
 
   frog is free software; you can redistribute it and/or modify
@@ -34,12 +34,12 @@
 class PyObjectRef {
  private:
   PyObject* ref;
-  
+
  public:
  PyObjectRef() : ref(0) {}
-  
+
  PyObjectRef(PyObject* obj) : ref(obj) {}
-  
+
   void assign(PyObject* obj) {
     // assume ref == 0, otherwhise call Py_DECREF
     if ( ref ){
@@ -47,13 +47,13 @@ class PyObjectRef {
     }
     ref = obj;
   }
-  
+
   operator PyObject* () {
     return ref;
   }
-  
+
   ~PyObjectRef() {
-    Py_XDECREF(ref);
+    //    Py_XDECREF(ref);
   }
 };
 
@@ -61,18 +61,18 @@ class PythonInterface {
  private:
   PyObjectRef module;
   PyObjectRef mainFunction;
-  
+
  public:
   PythonInterface();
   ~PythonInterface();
-  
+
   void parse( const std::string& depFile,
 	      const std::string& modFile,
 	      const std::string& dirFile,
 	      const std::string& maxDist,
 	      const std::string& inputFile,
 	      const std::string& outputFile);
-};  
+};
 
 struct parseData;
 
@@ -82,9 +82,9 @@ class Parser {
   ~Parser();
   bool init( const TiCC::Configuration& );
   void addDeclaration( folia::Document& doc ) const;
-  void Parse( const std::vector<folia::Word *>&, 
+  void Parse( const std::vector<folia::Word *>&,
 	      const std::string&, const std::string&, TimerBlock& );
-  void prepareParse( const std::vector<folia::Word *>&, 
+  void prepareParse( const std::vector<folia::Word *>&,
 		     const std::string&, parseData& );
   void createParserFile( const parseData& );
  private:
diff --git a/include/frog/cgn_tagger_mod.h b/include/frog/cgn_tagger_mod.h
index e9c9665..31470a0 100644
--- a/include/frog/cgn_tagger_mod.h
+++ b/include/frog/cgn_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: cgn_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
+  $Id: cgn_tagger_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/cgn_tagger_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
@@ -47,6 +47,7 @@ class CGNTagger {
   int debug;
   std::string tagset;
   std::string version;
+  Tokenizer::UnicodeFilter *filter;
 };
 
 #endif // CGN_TAGGER_MOD_H
diff --git a/include/frog/iob_tagger_mod.h b/include/frog/iob_tagger_mod.h
index 32d785b..edf16ec 100644
--- a/include/frog/iob_tagger_mod.h
+++ b/include/frog/iob_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: iob_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
+  $Id: iob_tagger_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/iob_tagger_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
diff --git a/include/frog/mblem_mod.h b/include/frog/mblem_mod.h
index d402c01..899ba32 100755
--- a/include/frog/mblem_mod.h
+++ b/include/frog/mblem_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: mblem_mod.h 15650 2013-02-07 16:13:55Z sloot $
+  $Id: mblem_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mblem_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
@@ -71,6 +71,7 @@ class Mblem {
   std::string tagset;
   std::string cgn_tagset;
   TiCC::LogStream *mblemLog;
+  Tokenizer::UnicodeFilter *filter;
 };
 
 #endif
diff --git a/include/frog/mbma_mod.h b/include/frog/mbma_mod.h
index 7e5ea3d..2d78bdf 100755
--- a/include/frog/mbma_mod.h
+++ b/include/frog/mbma_mod.h
@@ -1,47 +1,174 @@
 /*
-  $Id: mbma_mod.h 15572 2013-01-07 14:59:11Z sloot $
+  $Id: mbma_mod.h 17440 2014-07-10 12:11:27Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mbma_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
-  
+
   This file is part of frog.
 
   frog is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by  
-  the Free Software Foundation; either version 3 of the License, or  
-  (at your option) any later version.  
-                  
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
   frog is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of  
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
-  GNU General Public License for more details.  
-                          
-  You should have received a copy of the GNU General Public License  
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.  
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
   For questions and suggestions, see:
       http://ilk.uvt.nl/software.html
   or send mail to:
       timbl at uvt.nl
 */
-                                    
+
 #ifndef MBMA_MOD_H
 #define MBMA_MOD_H
 
 #include <unicode/translit.h>
 
 class MBMAana;
+class RulePart;
+
+namespace CLEX {
+  enum Type { UNASS, N, A, Q, V, D, O, B, P, Y, I, X, Z, PN, AFFIX, XAFFIX,
+	      NEUTRAL };
+  std::string toString( const Type& t );
+}
 
-struct waStruct {
-  UnicodeString word;
-  std::string act;
-  void clear(){
-    word = "";
-    act = "";
-  }
+enum Status { INFO, STEM, COMPLEX, INFLECTION, DERIVATIONAL };
+
+class BaseBracket {
+public:
+ BaseBracket( CLEX::Type t, const std::vector<CLEX::Type>& R, int flag ):
+  RightHand(R),
+    cls(t),
+    debugFlag(flag)
+
+   {};
+ BaseBracket( CLEX::Type t, int flag ):
+  cls(t), debugFlag(flag)
+  {};
+  virtual ~BaseBracket() {};
+
+  Status stat() const { return status; };
+  virtual UnicodeString morpheme() const { return "";};
+  virtual UnicodeString deepmorphemes() const { return "";};
+  virtual std::string inflection() const { return ""; };
+  virtual std::string original() const { return ""; };
+  virtual int infixpos() const { return -1; };
+  virtual UnicodeString put( bool = false ) const;
+  virtual BaseBracket *append( BaseBracket * ){ abort(); };
+  virtual bool isNested() { return false; };
+  virtual void resolveLead(){ abort(); };
+  virtual void resolveTail(){ abort(); };
+  virtual void resolveMiddle(){ abort(); };
+  virtual folia::Morpheme *createMorpheme( folia::Document *,
+					   const std::string& ) const = 0;
+  virtual folia::Morpheme *createMorpheme( folia::Document *,
+					   const std::string&,
+					   int&,
+					   std::string& ) const = 0;
+  CLEX::Type tag() const { return cls; };
+  void setTag( CLEX::Type t ) { cls = t; };
+  std::vector<CLEX::Type> RightHand;
+ protected:
+  CLEX::Type cls;
+  Status status;
+  int debugFlag;
 };
 
+class BracketLeaf: public BaseBracket {
+public:
+  BracketLeaf( const RulePart&, int );
+  BracketLeaf( CLEX::Type, const UnicodeString&, int );
+  UnicodeString put( bool = false ) const;
+  UnicodeString morpheme() const { return morph; };
+  UnicodeString deepmorphemes() const { return morph; };
+  std::string inflection() const { return inflect; };
+  std::string original() const { return orig; };
+  int infixpos() const { return ifpos; };
+  folia::Morpheme *createMorpheme( folia::Document *,
+				   const std::string& ) const;
+  folia::Morpheme *createMorpheme( folia::Document *,
+				   const std::string&,
+				   int&,
+				   std::string& ) const;
+private:
+  int ifpos;
+  UnicodeString morph;
+  std::string orig;
+  std::string inflect;
+};
+
+class BracketNest: public BaseBracket {
+ public:
+ BracketNest( CLEX::Type t, int flag ): BaseBracket( t, flag ){
+    status = COMPLEX; };
+  BaseBracket *append( BaseBracket *t ){
+    parts.push_back( t );
+    return this;
+  };
+  ~BracketNest();
+  bool isNested() { return true; };
+  UnicodeString put( bool = false ) const;
+  bool testMatch( std::list<BaseBracket*>& result,
+		  const std::list<BaseBracket*>::iterator& rpos,
+		  std::list<BaseBracket*>::iterator& bpos );
+  std::list<BaseBracket*>::iterator resolveAffix( std::list<BaseBracket*>&,
+						  const std::list<BaseBracket*>::iterator& );
+  void resolveNouns();
+  void resolveLead();
+  void resolveTail();
+  void resolveMiddle();
+  UnicodeString deepmorphemes() const;
+  CLEX::Type getFinalTag();
+  folia::Morpheme *createMorpheme( folia::Document *,
+				   const std::string& ) const;
+  folia::Morpheme *createMorpheme( folia::Document *,
+				   const std::string&,
+				   int&,
+				   std::string& ) const;
+  std::list<BaseBracket *> parts;
+};
+
+
+class RulePart {
+public:
+  RulePart( const std::string&, const UChar );
+  bool isBasic() const;
+  void get_ins_del( const std::string& );
+  CLEX::Type ResultClass;
+  std::vector<CLEX::Type> RightHand;
+  UnicodeString ins;
+  UnicodeString del;
+  UnicodeString uchar;
+  UnicodeString morpheme;
+  std::string inflect;
+  int fixpos;
+  int xfixpos;
+  bool participle;
+};
+
+
+class Rule {
+public:
+  Rule( const std::vector<std::string>&, const UnicodeString&, int flag );
+  std::vector<std::string> extract_morphemes() const;
+  std::string getCleanInflect() const;
+  void reduceZeroNodes();
+  BracketNest *resolveBrackets( bool, CLEX::Type& );
+  std::vector<RulePart> rules;
+  int debugFlag;
+};
+
+static std::map<CLEX::Type,std::string> tagNames;
+static std::map<char,std::string> iNames;
+
 class Mbma {
  public:
   Mbma();
@@ -52,82 +179,80 @@ class Mbma {
   void Classify( const UnicodeString& );
   void filterTag( const std::string&, const std::vector<std::string>& );
   std::vector<std::vector<std::string> > getResult() const;
+  void setDaring( bool b ){ doDaring = b; };
+  void clearAnalysis();
  private:
   void cleanUp();
   bool readsettings( const std::string&, const std::string& );
   void fillMaps();
   void init_cgn( const std::string& );
-  void init_filter( );
+  Transliterator * init_trans();
   UnicodeString filterDiacritics( const UnicodeString& ) const;
   void getFoLiAResult( folia::Word *, const UnicodeString& ) const;
   std::vector<std::string> make_instances( const UnicodeString& word );
-  std::string calculate_ins_del( const std::string& in_class, 
-				 std::string& deletestring,
-				 std::string& insertstring,
-				 bool& );
-  std::vector<waStruct> Step1( unsigned int step, 
-			       const UnicodeString& word, 
-			       const std::vector<std::vector<std::string> >& classParts,
-			       const std::string& basictags );
-  void resolve_inflections( std::vector<waStruct>& , const std::string& );
-  MBMAana addInflect( const std::vector<waStruct>& ana,
-		      const std::string&, 
-		      const std::vector<std::string>&  );
-  MBMAana inflectAndAffix( const std::vector<waStruct>& ana );
-  void execute( const UnicodeString& word, 
+  bool performEdits( Rule& );
+  void resolve_inflections( Rule& );
+  CLEX::Type getFinalTag( const std::list<BaseBracket*>& );
+  void execute( const UnicodeString& word,
 		const std::vector<std::string>& classes );
   int debugFlag;
-  void addMorph( folia::MorphologyLayer *, 
+  void addMorph( folia::MorphologyLayer *,
 		 const std::vector<std::string>& ) const;
   void addMorph( folia::Word *, const std::vector<std::string>& ) const;
   void addAltMorph( folia::Word *, const std::vector<std::string>& ) const;
+  void addBracketMorph( folia::Word *,
+			const std::string&,
+			const std::string& ) const;
+  void addBracketMorph( folia::Word *, const BracketNest * ) const;
+  void addAltBracketMorph( folia::Word *, const BracketNest * ) const;
   std::string MTreeFilename;
   Timbl::TimblAPI *MTree;
-  std::map<char,std::string> iNames;  
-  std::map<std::string,std::string> tagNames;  
   std::map<std::string,std::string> TAGconv;
-  std::vector<MBMAana> analysis;
+  std::vector<MBMAana*> analysis;
   std::string version;
   std::string tagset;
   std::string cgn_tagset;
+  std::string clex_tagset;
   TiCC::LogStream *mbmaLog;
   Transliterator *transliterator;
+  Tokenizer::UnicodeFilter *filter;
+  bool doDaring;
 };
 
 class MBMAana {
   friend std::ostream& operator<< ( std::ostream& , const MBMAana& );
   friend std::ostream& operator<< ( std::ostream& , const MBMAana* );
   public:
-  MBMAana() {
-    tag = "";
-    infl = "";
-    description = "";    
-  };
- MBMAana( const std::string& _tag,
-	  const std::string& _infl,
-	  const std::vector<std::string>& _mo, 
-	  const std::string& _des ): 
-  tag(_tag),infl(_infl),morphemes(_mo), description(_des) {};
-  
-  ~MBMAana() {};
-  
+  MBMAana(const Rule&, bool );
+
+  ~MBMAana() { delete brackets; };
+
   std::string getTag() const {
     return tag;
   };
-  
+
+  const Rule& getRule() const {
+    return rule;
+  };
+
+  const BracketNest *getBrackets() const {
+    return brackets;
+  };
+
   std::string getInflection() const {
     return infl;
   };
-  
-  const std::vector<std::string>& getMorph() const {
-    return morphemes;
+
+  const std::vector<std::string> getMorph() const {
+    return rule.extract_morphemes();
   };
-  
+
  private:
   std::string tag;
   std::string infl;
-  std::vector<std::string> morphemes;
-  std::string description; 
+  std::string description;
+  Rule rule;
+  BracketNest *brackets;
 };
 
 #endif
diff --git a/include/frog/mwu_chunker_mod.h b/include/frog/mwu_chunker_mod.h
index 82ab8d2..1dd506d 100755
--- a/include/frog/mwu_chunker_mod.h
+++ b/include/frog/mwu_chunker_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: mwu_chunker_mod.h 15877 2013-04-02 15:57:51Z sloot $
+  $Id: mwu_chunker_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/mwu_chunker_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
   
   This file is part of frog.
diff --git a/include/frog/ner_tagger_mod.h b/include/frog/ner_tagger_mod.h
index 6d361ff..af053e3 100644
--- a/include/frog/ner_tagger_mod.h
+++ b/include/frog/ner_tagger_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: ner_tagger_mod.h 15572 2013-01-07 14:59:11Z sloot $
+  $Id: ner_tagger_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/ner_tagger_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
diff --git a/include/frog/ucto_tokenizer_mod.h b/include/frog/ucto_tokenizer_mod.h
index f2725e7..c5a73c8 100644
--- a/include/frog/ucto_tokenizer_mod.h
+++ b/include/frog/ucto_tokenizer_mod.h
@@ -1,8 +1,8 @@
 /*
-  $Id: ucto_tokenizer_mod.h 15912 2013-04-03 14:04:30Z sloot $
+  $Id: ucto_tokenizer_mod.h 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/include/frog/ucto_tokenizer_mod.h $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
   
   This file is part of frog.
diff --git a/install-sh b/install-sh
index 6781b98..377bb86 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
 	shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
 	      if test -z "$dir_arg" || {
 		   # Check for POSIX incompatibilities with -m.
 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
+		   # other-writable bit of parent directory when it shouldn't.
 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
 		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
 		   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/ltmain.sh b/ltmain.sh
index c2852d8..a356aca 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
+VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 3a37fee..60eefb8 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,6 +17,51 @@
 # $Id: Makefile.am 8582 2011-02-27 11:38:10Z joostvb $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/m4/Makefile.am $
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -37,10 +81,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = m4
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -52,11 +97,30 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -102,7 +166,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -147,6 +210,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -260,11 +325,11 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
@@ -400,15 +465,16 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/m4/ax_lib_readline.m4 b/m4/ax_lib_readline.m4
new file mode 100644
index 0000000..2347ad7
--- /dev/null
+++ b/m4/ax_lib_readline.m4
@@ -0,0 +1,107 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_LIB_READLINE
+#
+# DESCRIPTION
+#
+#   Searches for a readline compatible library. If found, defines
+#   `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
+#   sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
+#   necessary include files and sets `HAVE_READLINE_H' or
+#   `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
+#   'HAVE_HISTORY_H' if the corresponding include files exists.
+#
+#   The libraries that may be readline compatible are `libedit',
+#   `libeditline' and `libreadline'. Sometimes we need to link a termcap
+#   library for readline to work, this macro tests these cases too by trying
+#   to link with `libtermcap', `libcurses' or `libncurses' before giving up.
+#
+#   Here is an example of how to use the information provided by this macro
+#   to perform the necessary includes or declarations in a C file:
+#
+#     #ifdef HAVE_LIBREADLINE
+#     #  if defined(HAVE_READLINE_READLINE_H)
+#     #    include <readline/readline.h>
+#     #  elif defined(HAVE_READLINE_H)
+#     #    include <readline.h>
+#     #  else /* !defined(HAVE_READLINE_H) */
+#     extern char *readline ();
+#     #  endif /* !defined(HAVE_READLINE_H) */
+#     char *cmdline = NULL;
+#     #else /* !defined(HAVE_READLINE_READLINE_H) */
+#       /* no readline */
+#     #endif /* HAVE_LIBREADLINE */
+#
+#     #ifdef HAVE_READLINE_HISTORY
+#     #  if defined(HAVE_READLINE_HISTORY_H)
+#     #    include <readline/history.h>
+#     #  elif defined(HAVE_HISTORY_H)
+#     #    include <history.h>
+#     #  else /* !defined(HAVE_HISTORY_H) */
+#     extern void add_history ();
+#     extern int write_history ();
+#     extern int read_history ();
+#     #  endif /* defined(HAVE_READLINE_HISTORY_H) */
+#       /* no history */
+#     #endif /* HAVE_READLINE_HISTORY */
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Ville Laurikari <vl at iki.fi>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 6
+
+AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
+AC_DEFUN([AX_LIB_READLINE], [
+  AC_CACHE_CHECK([for a readline compatible library],
+                 ax_cv_lib_readline, [
+    ORIG_LIBS="$LIBS"
+    for readline_lib in readline edit editline; do
+      for termcap_lib in "" termcap curses ncurses; do
+        if test -z "$termcap_lib"; then
+          TRY_LIB="-l$readline_lib"
+        else
+          TRY_LIB="-l$readline_lib -l$termcap_lib"
+        fi
+        LIBS="$ORIG_LIBS $TRY_LIB"
+        AC_TRY_LINK_FUNC(readline, ax_cv_lib_readline="$TRY_LIB")
+        if test -n "$ax_cv_lib_readline"; then
+          break
+        fi
+      done
+      if test -n "$ax_cv_lib_readline"; then
+        break
+      fi
+    done
+    if test -z "$ax_cv_lib_readline"; then
+      ax_cv_lib_readline="no"
+    fi
+    LIBS="$ORIG_LIBS"
+  ])
+
+  if test "$ax_cv_lib_readline" != "no"; then
+    LIBS="$LIBS $ax_cv_lib_readline"
+    AC_DEFINE(HAVE_LIBREADLINE, 1,
+              [Define if you have a readline compatible library])
+    AC_CHECK_HEADERS([readline.h readline/readline.h])
+    AC_CACHE_CHECK([whether readline supports history],
+                   ax_cv_lib_readline_history, [
+      ax_cv_lib_readline_history="no"
+      AC_TRY_LINK_FUNC(add_history, ax_cv_lib_readline_history="yes")
+    ])
+    if test "$ax_cv_lib_readline_history" = "yes"; then
+      AC_DEFINE(HAVE_READLINE_HISTORY, 1,
+                [Define if your readline library has \`add_history'])
+      AC_CHECK_HEADERS([history.h readline/history.h])
+    fi
+  fi
+])dnl
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index a6bf596..d383ad5 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -82,7 +82,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 16
+#serial 21
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [
@@ -103,8 +103,8 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
-        AC_MSG_RESULT($ax_pthread_ok)
+        AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
+        AC_MSG_RESULT([$ax_pthread_ok])
         if test x"$ax_pthread_ok" = xno; then
                 PTHREAD_LIBS=""
                 PTHREAD_CFLAGS=""
@@ -145,8 +145,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
 # --thread-safe: KAI C++
 # pthread-config: use pthread-config program (for GNU Pth library)
 
-case "${host_cpu}-${host_os}" in
-        *solaris*)
+case ${host_os} in
+        solaris*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -159,11 +159,25 @@ case "${host_cpu}-${host_os}" in
         ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
         ;;
 
-        *-darwin*)
+        darwin*)
         ax_pthread_flags="-pthread $ax_pthread_flags"
         ;;
 esac
 
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+                  [AC_MSG_RESULT([yes])],
+                  [ax_pthread_extra_flags=
+                   AC_MSG_RESULT([no])])
+CFLAGS="$save_CFLAGS"
+
 if test x"$ax_pthread_ok" = xno; then
 for flag in $ax_pthread_flags; do
 
@@ -178,7 +192,7 @@ for flag in $ax_pthread_flags; do
                 ;;
 
                 pthread-config)
-                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
                 if test x"$ax_pthread_config" = xno; then continue; fi
                 PTHREAD_CFLAGS="`pthread-config --cflags`"
                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
@@ -193,7 +207,7 @@ for flag in $ax_pthread_flags; do
         save_LIBS="$LIBS"
         save_CFLAGS="$CFLAGS"
         LIBS="$PTHREAD_LIBS $LIBS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
 
         # Check for various functions.  We must include pthread.h,
         # since some functions may be macros.  (On the Sequent, we
@@ -219,7 +233,7 @@ for flag in $ax_pthread_flags; do
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        AC_MSG_RESULT($ax_pthread_ok)
+        AC_MSG_RESULT([$ax_pthread_ok])
         if test "x$ax_pthread_ok" = xyes; then
                 break;
         fi
@@ -245,54 +259,70 @@ if test "x$ax_pthread_ok" = xyes; then
                 [attr_name=$attr; break],
                 [])
         done
-        AC_MSG_RESULT($attr_name)
+        AC_MSG_RESULT([$attr_name])
         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+            AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
                                [Define to necessary symbol if this constant
                                 uses a non-standard name on your system.])
         fi
 
         AC_MSG_CHECKING([if more special flags are required for pthreads])
         flag=no
-        case "${host_cpu}-${host_os}" in
-            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
-            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        case ${host_os} in
+            aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
+            osf* | hpux*) flag="-D_REENTRANT";;
+            solaris*)
+            if test "$GCC" = "yes"; then
+                flag="-D_REENTRANT"
+            else
+                # TODO: What about Clang on Solaris?
+                flag="-mt -D_REENTRANT"
+            fi
+            ;;
         esac
-        AC_MSG_RESULT(${flag})
+        AC_MSG_RESULT([$flag])
         if test "x$flag" != xno; then
             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
         fi
 
         AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
-            ax_cv_PTHREAD_PRIO_INHERIT, [
-                AC_LINK_IFELSE([
-                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+            [ax_cv_PTHREAD_PRIO_INHERIT], [
+                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+                                                [[int i = PTHREAD_PRIO_INHERIT;]])],
                     [ax_cv_PTHREAD_PRIO_INHERIT=yes],
                     [ax_cv_PTHREAD_PRIO_INHERIT=no])
             ])
         AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
-            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+            [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
 
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        # More AIX lossage: must compile with xlc_r or cc_r
-        if test x"$GCC" != xyes; then
-          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
-        else
-          PTHREAD_CC=$CC
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != xyes; then
+            case $host_os in
+                aix*)
+                AS_CASE(["x/$CC"],
+                  [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+                  [#handle absolute path differently from PATH based program lookup
+                   AS_CASE(["x$CC"],
+                     [x/*],
+                     [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+                     [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+                ;;
+            esac
         fi
-else
-        PTHREAD_CC="$CC"
 fi
 
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
 
 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
 if test x"$ax_pthread_ok" = xyes; then
-        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
         :
 else
         ax_pthread_ok=no
diff --git a/missing b/missing
index 86a8fc3..db98974 100755
--- a/missing
+++ b/missing
@@ -1,11 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-01-06.13; # UTC
+scriptversion=2013-10-28.13; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -26,68 +25,40 @@ scriptversion=2012-01-06.13; # UTC
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -99,228 +70,141 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-	   sed 's/\.am$/.in/' |
-	   while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo "#! /bin/sh"
-	echo "# Created by GNU Automake missing as a replacement of"
-	echo "#  $ $@"
-	echo "exit 0"
-	chmod +x $file
-	exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-	case $LASTARG in
-	*.y)
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.c
-	    fi
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.h
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f y.tab.h; then
-	echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-	echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-	case $LASTARG in
-	*.l)
-	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" lex.yy.c
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f lex.yy.c; then
-	echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo ".ab help2man is required to generate this page"
-	exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'autom4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
     ;;
-esac
-
-exit 0
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/py-compile b/py-compile
index 15c834c..46ea866 100755
--- a/py-compile
+++ b/py-compile
@@ -3,8 +3,7 @@
 
 scriptversion=2011-06-08.12; # UTC
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free
-# Software Foundation, Inc.
+# Copyright (C) 2000-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,7 +36,7 @@ me=py-compile
 usage_error ()
 {
   echo "$me: $*" >&2
-  echo "Try \`$me --help' for more information." >&2
+  echo "Try '$me --help' for more information." >&2
   exit 1
 }
 
@@ -117,7 +116,7 @@ else
 fi
 
 $PYTHON -c "
-import sys, os, py_compile
+import sys, os, py_compile, imp
 
 files = '''$files'''
 
@@ -130,12 +129,19 @@ for file in files.split():
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    py_compile.compile(filepath, filepath + 'c', path)
+    if hasattr(imp, 'get_tag'):
+        py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+    else:
+        py_compile.compile(filepath, filepath + 'c', path)
 sys.stdout.write('\n')" || exit $?
 
 # this will fail for python < 1.5, but that doesn't matter ...
 $PYTHON -O -c "
-import sys, os, py_compile
+import sys, os, py_compile, imp
+
+# pypy does not use .pyo optimization
+if hasattr(sys, 'pypy_translation_info'):
+    sys.exit(0)
 
 files = '''$files'''
 sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
@@ -147,7 +153,10 @@ for file in files.split():
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    py_compile.compile(filepath, filepath + 'o', path)
+    if hasattr(imp, 'get_tag'):
+        py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+    else:
+        py_compile.compile(filepath, filepath + 'o', path)
 sys.stdout.write('\n')" 2>/dev/null || :
 
 # Local Variables:
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index fbef9db..5b550d3 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,6 +17,51 @@
 # $Id: Makefile.am 8890 2011-03-16 16:00:25Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/scripts/Makefile.am $
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -37,11 +81,12 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = scripts
-DIST_COMMON = $(frogscripts_PYTHON) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(frogscripts_PYTHON) $(top_srcdir)/py-compile
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -53,8 +98,25 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -84,10 +146,14 @@ am__uninstall_files_from_dir = { \
   }
 am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
 am__installdirs = "$(DESTDIR)$(frogscriptsdir)"
+am__pep3147_tweak = \
+  sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|'
 py_compile = $(top_srcdir)/py-compile
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -133,7 +199,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -178,6 +243,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -294,8 +361,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-frogscriptsPYTHON: $(frogscripts_PYTHON)
 	@$(NORMAL_INSTALL)
-	test -z "$(frogscriptsdir)" || $(MKDIR_P) "$(DESTDIR)$(frogscriptsdir)"
 	@list='$(frogscripts_PYTHON)'; dlist=; list2=; test -n "$(frogscriptsdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(frogscriptsdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(frogscriptsdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
 	  if test -f $$b$$p; then \
@@ -317,21 +387,31 @@ install-frogscriptsPYTHON: $(frogscripts_PYTHON)
 uninstall-frogscriptsPYTHON:
 	@$(NORMAL_UNINSTALL)
 	@list='$(frogscripts_PYTHON)'; test -n "$(frogscriptsdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
+	py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$py_files" || exit 0; \
 	dir='$(DESTDIR)$(frogscriptsdir)'; \
-	filesc=`echo "$$files" | sed 's|$$|c|'`; \
-	fileso=`echo "$$files" | sed 's|$$|o|'`; \
+	pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
+	pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
+	py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \
+	echo "$$py_files_pep3147";\
+	pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \
+	pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \
 	st=0; \
-	for files in "$$files" "$$filesc" "$$fileso"; do \
+	for files in \
+	  "$$py_files" \
+	  "$$pyc_files" \
+	  "$$pyo_files" \
+	  "$$pyc_files_pep3147" \
+	  "$$pyo_files_pep3147" \
+	; do \
 	  $(am__uninstall_files_from_dir) || st=$$?; \
 	done; \
 	exit $$st
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
@@ -470,16 +550,17 @@ uninstall-am: uninstall-frogscriptsPYTHON
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-frogscriptsPYTHON \
-	install-html install-html-am install-info install-info-am \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am uninstall uninstall-am uninstall-frogscriptsPYTHON
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am \
+	install-frogscriptsPYTHON install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-frogscriptsPYTHON
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/Frog-util.cxx b/src/Frog-util.cxx
index 941ee91..ce99967 100755
--- a/src/Frog-util.cxx
+++ b/src/Frog-util.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: Frog-util.cxx 15572 2013-01-07 14:59:11Z sloot $
+  $Id: Frog-util.cxx 16815 2014-01-06 10:00:29Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Frog-util.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog
@@ -90,23 +90,6 @@ void getFileNames( const string& dirName,
 
 #endif
 
-string& trim(string &str)  //3rd party function. TODO: test if utf-8 safe? (MvG)
-{
-    int i,j,start,end;
-
-    //ltrim
-    for (i=0; (str[i]!=0 && str[i]<=32); )
-        i++;
-    start=i;
-
-    //rtrim
-    for(i=0,j=0; str[i]!=0; i++)
-        j = ((str[i]<=32)? j+1 : 0);
-    end=i-j;
-    str = str.substr(start,end-start);
-    return str;
-}
-
 string getTime() {
   time_t Time;
   time(&Time);
diff --git a/src/Frog.cxx b/src/Frog.cxx
index 98b8485..32fb9a6 100755
--- a/src/Frog.cxx
+++ b/src/Frog.cxx
@@ -1,12 +1,12 @@
 /*
-  $Id: Frog.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: Frog.cxx 17459 2014-07-16 15:28:07Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Frog.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -28,10 +28,9 @@
       timbl at uvt.nl
 */
 
-#include "Python.h"
 #include <cstdlib>
 #include <cstdio>
-#include <sys/wait.h> 
+#include <sys/wait.h>
 #include <signal.h>
 #include <string>
 #include <cstring>
@@ -41,15 +40,37 @@
 #include <vector>
 #include <omp.h>
 
+#include "config.h"
+
+#ifdef HAVE_LIBREADLINE
+#  if defined(HAVE_READLINE_READLINE_H)
+#    include <readline/readline.h>
+#  elif defined(HAVE_READLINE_H)
+#    include <readline.h>
+#  endif /* !defined(HAVE_READLINE_H) */
+#endif /* HAVE_LIBREADLINE */
+
+#ifdef HAVE_READLINE_HISTORY
+#  if defined(HAVE_READLINE_HISTORY_H)
+#    include <readline/history.h>
+#  elif defined(HAVE_HISTORY_H)
+#    include <history.h>
+#  endif /* defined(HAVE_READLINE_HISTORY_H) */
+#endif /* HAVE_READLINE_HISTORY */
+
+// Python.h seems to set HAVE_LIBREADLINE so we include this late...
+#include "Python.h"
+
 #include "timbl/TimblAPI.h"
-#include "mbt/MbtAPI.h"
-#include "timblserver/TimblServerAPI.h"
+#include "timblserver/FdStream.h"
+#include "timblserver/ServerBase.h"
 
 // individual module headers
 
-#include "config.h"
 #include "frog/Frog.h"
 #include "ticcutils/Configuration.h"
+#include "ticcutils/StringOps.h"
+#include "ticcutils/CommandLine.h"
 #include "frog/ucto_tokenizer_mod.h"
 #include "frog/mbma_mod.h"
 #include "frog/mblem_mod.h"
@@ -66,7 +87,6 @@ using namespace TiCC;
 LogStream my_default_log( cerr, "frog-", StampMessage ); // fall-back
 LogStream *theErrLog = &my_default_log;  // fill the externals
 
-string TestFileName;
 string testDirName;
 string tmpDirName;
 string outputFileName;
@@ -81,11 +101,12 @@ string outputDirName;
 string xmlDirName;
 set<string> fileNames;
 string ProgName;
-int tpDebug = 0; //0 for none, more for more output
+int debugFlag = 0; //0 for none, more for more output
 unsigned int maxParserTokens = 0; // 0 for unlimited
 bool doTok = true;
 bool doLemma = true;
 bool doMorph = true;
+bool doDaringMorph = false;
 bool doMwu = true;
 bool doIOB = true;
 bool doNER = true;
@@ -106,13 +127,13 @@ string uttmark = "";
         which sets variables global to that namespace
 	to be used in the init() for that namespace
 
-   Further, 
-   each component provides a Test(File) which writes output to 
+   Further,
+   each component provides a Test(File) which writes output to
         File.<componentname>_out
-   and a Classify(Instance) which produces relevant output 
-        as a string return 
-	or somehwere else, 
-   to be determined later, 
+   and a Classify(Instance) which produces relevant output
+        as a string return
+	or somehwere else,
+   to be determined later,
    after pre- and postprocessing raw classification data
 
 */
@@ -127,7 +148,7 @@ void usage( ) {
        << "\t -e <encoding>          specify encoding of the input (default UTF-8)\n"
        << "\t -t <testfile>          Run frog on this file\n"
        << "\t -x <testfile>          Run frog on this FoLiA XML file. Or the files form 'testdir'\n"
-       << "\t --textclass=<cls>      use the specified class to for search text in the the FoLia docs.\n"
+       << "\t --textclass=<cls>      use the specified class to search for text in the the FoLia docs.\n"
        << "\t --testdir=<directory>  All files in this dir will be tested\n"
        << "\t --uttmarker=<mark>     utterances are separated by 'mark' symbols"
        << "\t                        (default none)\n"
@@ -138,20 +159,22 @@ void usage( ) {
        << "\t --skip=[mptncla]    Skip Tokenizer (t), Lemmatizer (l), Morphological Analyzer (a), Chunker (c), Multi-Word Units (m), Named Entity Recognition (n), or Parser (p) \n"
        << "\t============= CONFIGURATION OPTIONS =====================================\n"
        << "\t -c <filename>    Set configuration file (default " << configFileName << ")\n"
-       << "\t============= OUTPUT OPTIONS ============================================\n"      
+       << "\t============= OUTPUT OPTIONS ============================================\n"
        << "\t -o <outputfile>	    Output columned output to file, instead of default stdout\n"
        << "\t -X <xmlfile>          Output also to an XML file in FoLiA format\n"
        << "\t --id=<docid>          Document ID, used in FoLiA output. (Default 'untitled')\n"
        << "\t --outputdir=<dir>     Output to dir, instead of default stdout\n"
        << "\t --xmldir=<dir>        Use 'dir' to output FoliA XML to.\n"
-       << "\t --tmpdir=<directory>  (location to store intermediate files. Default /tmp )\n"      
+       << "\t --tmpdir=<directory>  (location to store intermediate files. Default /tmp )\n"
        << "\t --keep-parser-files=[yes|no] keep intermediate parser files. (last sentence only).\n"
        << "\t============= OTHER OPTIONS ============================================\n"
        << "\t -h. give some help.\n"
        << "\t -V or --version .   Show version info.\n"
        << "\t -d <debug level>    (for more verbosity)\n"
+       << "\t --debug=<module><level>,<module><level>... (eg --debug=l5,n3) \n"
+       << "\t\t Set debug value for Tokenizer (t), Lemmatizer (l), Morphological Analyzer (a), Chunker (c), Multi-Word Units (m), Named Entity Recognition (n), or Parser (p) \n"
        << "\t -S <port>              Run as server instead of reading from testfile\n"
-#ifdef HAVE_OPENMP      
+#ifdef HAVE_OPENMP
        << "\t --threads=<n>       Use a maximun of 'n' threads. Default: all we can get. \n"
 #endif
        << "\t                     (but always 1 for server mode)\n";
@@ -169,22 +192,22 @@ static NERTagger myNERTagger;
 static UctoTokenizer tokenizer;
 
 
-bool parse_args( TimblOpts& Opts ) {
+bool parse_args( TiCC::CL_Options& Opts ) {
   string value;
   bool mood;
-  if ( Opts.Find('V', value, mood ) ||
-       Opts.Find("version", value, mood ) ){
+  if ( Opts.find('V', value, mood ) ||
+       Opts.find("version", value ) ){
     // we already did show what we wanted.
     exit( EXIT_SUCCESS );
   }
-  if ( Opts.Find ('h', value, mood)) {
+  if ( Opts.find ('h', value, mood)) {
     usage();
     exit( EXIT_SUCCESS );
   };
   // is a config file specified?
-  if ( Opts.Find( 'c',  value, mood ) ) {
+  if ( Opts.find( 'c',  value, mood ) ) {
     configFileName = value;
-    Opts.Delete( 'c' );
+    Opts.remove( 'c' );
   };
 
   if ( configuration.fill( configFileName ) ){
@@ -197,20 +220,74 @@ bool parse_args( TimblOpts& Opts ) {
   }
 
   // debug opts
-  if ( Opts.Find ('d', value, mood)) {
-    if ( !stringTo<int>( value, tpDebug ) ){
+  if ( Opts.find ('d', value, mood)) {
+    if ( !stringTo<int>( value, debugFlag ) ){
       *Log(theErrLog) << "-d value should be an integer" << endl;
       return false;
     }
-    Opts.Delete('d');
-  };
-  if ( Opts.Find ('n', value, mood)) {
+    configuration.setatt( "debug", value );
+    Opts.remove('d');
+  }
+  else {
+    configuration.setatt( "debug", "0" );
+  }
+  if ( Opts.find( "debug", value ) ) {
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --debug (did you forget the '='?)" << endl;
+      return false;
+    }
+    value = TiCC::lowercase( value );
+    vector<string> vec;
+    TiCC::split_at( value, vec, "," );
+    for ( size_t i=0; i < vec.size(); ++i ){
+      char mod = vec[i][0];
+      string value = vec[i].substr(1);
+      int dbval = 0;
+      if ( !stringTo<int>( value, dbval ) ){
+	cerr << "expected integer value for --debug=" << mod << value << endl;
+	return false;
+      }
+      switch ( mod ){
+      case 't':
+	configuration.setatt( "debug", value, "tokenizer" );
+	break;
+      case 'l':
+	configuration.setatt( "debug", value, "mblem" );
+	break;
+      case 'a':
+	configuration.setatt( "debug", value, "mbma" );
+	break;
+      case 'm':
+	configuration.setatt( "debug", value, "mwu" );
+	break;
+      case 'c':
+	configuration.setatt( "debug", value, "IOB" );
+	break;
+      case 'n':
+	configuration.setatt( "debug", value, "NER" );
+	break;
+      case 'p':
+	configuration.setatt( "debug", value, "parser" );
+	break;
+      default:
+	cerr << "unknown module '" << mod << "'" << endl;
+	return false;
+      }
+    }
+    Opts.remove("debug");
+  }
+
+  if ( Opts.find ('n', value, mood)) {
     doSentencePerLine = true;
   };
-  if ( Opts.Find ('Q', value, mood)) {
+  if ( Opts.find ('Q', value, mood)) {
     doQuoteDetection = true;
   };
-  if ( Opts.Find( "skip", value, mood)) {
+  if ( Opts.find( "skip", value )) {
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --skip (did you forget the '='?)" << endl;
+      return false;
+    }
     string skip = value;
     if ( skip.find_first_of("tT") != string::npos )
       doTok = false;
@@ -226,14 +303,22 @@ bool parse_args( TimblOpts& Opts ) {
       doNER = false;
     if ( skip.find_first_of("pP") != string::npos )
       doParse = false;
-    Opts.Delete("skip");
+    Opts.remove("skip");
   };
 
-  if ( Opts.Find( "e", value, mood)) {
+  if ( Opts.find( "daring", value ) ) {
+    if ( value.empty() )
+      value = "1";
+    doDaringMorph = stringTo<bool>( value );
+    if ( doDaringMorph ){
+      doMorph = true;
+    }
+  }
+  if ( Opts.find( 'e', value, mood)) {
     encoding = value;
   }
-  
-  if ( Opts.Find( "max-parser-tokens", value, mood ) ){
+
+  if ( Opts.find( "max-parser-tokens", value ) ){
     if ( value.empty() ){
       *Log(theErrLog) << "max-parser-tokens option without value " << endl;
       return false;
@@ -244,19 +329,23 @@ bool parse_args( TimblOpts& Opts ) {
 	return false;
       }
     }
-    Opts.Delete("max-parser-tokens");
+    Opts.remove("max-parser-tokens");
   }
 
-  if ( Opts.Find ('S', value, mood)) {
+  if ( Opts.find ('S', value, mood)) {
     doServer = true;
     listenport= value;
   }
-#ifdef HAVE_OPENMP      
+#ifdef HAVE_OPENMP
   if ( doServer ) {
     // run in one thread in server mode, forking is too expensive for lots of small snippets
     omp_set_num_threads( 1 );
   }
-  else if ( Opts.Find( "threads", value, mood ) ){
+  else if ( Opts.find( "threads", value ) ){
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --threads (did you forget the '='?)" << endl;
+      return false;
+    }
     int num;
     if ( !stringTo<int>( value, num ) || num < 1 ){
       *Log(theErrLog) << "threads value should be a positive integer" << endl;
@@ -266,21 +355,26 @@ bool parse_args( TimblOpts& Opts ) {
   }
 #endif
 
-  if ( Opts.Find( "keep-parser-files", value, mood ) ){
+  if ( Opts.find( "keep-parser-files", value ) ){
     if ( value.empty() ||
-	 value == "true" || value == "TRUE" || value =="yes" || value == "YES" )
+	 stringTo<bool>( value ) ){
       configuration.setatt( "keepIntermediateFiles", "true", "parser" );
-    Opts.Delete("keep-parser-files");
+      Opts.remove("keep-parser-files");
+    }
   }
   tmpDirName = configuration.lookUp( "tmpdir", "global" );
-  if ( Opts.Find ( "tmpdir", value, mood)) {
+  if ( Opts.find ( "tmpdir", value )) {
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --tmpdir (did you forget the '='?)" << endl;
+      return false;
+    }
     tmpDirName = value;
-    Opts.Delete("tmpdir");
+    Opts.remove("tmpdir");
   }
   if ( tmpDirName.empty() ){
     tmpDirName = "/tmp/";
   }
-  else {
+  else if ( tmpDirName[tmpDirName.size()-1] != '/' ){
     tmpDirName += "/";
   }
 #ifdef HAVE_DIRENT_H
@@ -292,10 +386,14 @@ bool parse_args( TimblOpts& Opts ) {
     *Log(theErrLog) << "checking tmpdir: " << tmpDirName << " OK" << endl;
   }
 #endif
-  if ( Opts.Find ( "testdir", value, mood)) {
+  string TestFileName;
+  if ( Opts.find ( "testdir", value )) {
 #ifdef HAVE_DIRENT_H
     doDirTest = true;
     testDirName = value;
+    if ( testDirName[testDirName.size()-1] != '/' ){
+      testDirName += "/";
+    }
     if ( !testDirName.empty() ){
       if ( !existsDir( testDirName ) ){
 	*Log(theErrLog) << "input dir " << testDirName << " not readable" << endl;
@@ -303,26 +401,29 @@ bool parse_args( TimblOpts& Opts ) {
       }
     }
     else {
-      *Log(theErrLog) << "empty testdir name!" << endl;
+      *Log(theErrLog) << "missing a value for --testdir (did you forget the '='?)" << endl;
       return false;
     }
 #else
       *Log(theErrLog) << "--testdir option not supported!" << endl;
 #endif
-    Opts.Delete("testdir");
+    Opts.remove("testdir");
   }
-  else if ( Opts.Find( 't', value, mood )) {
+  else if ( Opts.find( 't', value, mood )) {
     TestFileName = value;
     ifstream is( value.c_str() );
     if ( !is ){
       *Log(theErrLog) << "input stream " << value << " is not readable" << endl;
       return false;
     }
-    Opts.Delete('t');
+    Opts.remove('t');
   };
   wantOUT = false;
-  if ( Opts.Find( "outputdir", value, mood)) {
+  if ( Opts.find( "outputdir", value )) {
     outputDirName = value;
+    if ( outputDirName[outputDirName.size()-1] != '/' ){
+      outputDirName += "/";
+    }
 #ifdef HAVE_DIRENT_H
     if ( !outputDirName.empty() ){
       if ( !existsDir( outputDirName ) ){
@@ -330,22 +431,33 @@ bool parse_args( TimblOpts& Opts ) {
 	return false;
       }
     }
+    else {
+      *Log(theErrLog) << "missing a value for --outputdir (did you forget the '='?)" << endl;
+      return false;
+    }
 #endif
     wantOUT = true;
-    Opts.Delete( "outputdir");
+    Opts.remove( "outputdir");
   }
-  else if ( Opts.Find ('o', value, mood)) {
+  else if ( Opts.find ('o', value, mood)) {
     wantOUT = true;
     outputFileName = value;
-    Opts.Delete('o');
+    Opts.remove('o');
   };
   doXMLout = false;
-  if ( Opts.Find ( "id", value, mood)) {
+  if ( Opts.find ( "id", value )) {
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --id (did you forget the '='?)" << endl;
+      return false;
+    }
     docid = value;
-    Opts.Delete( "id");
-  }  
-  if ( Opts.Find( "xmldir", value, mood)) {
+    Opts.remove( "id");
+  }
+  if ( Opts.find( "xmldir", value )) {
     xmlDirName = value;
+    if ( xmlDirName[xmlDirName.size()-1] != '/' ){
+      xmlDirName += "/";
+    }
 #ifdef HAVE_DIRENT_H
     if ( !xmlDirName.empty() ){
       if ( !existsDir( xmlDirName ) ){
@@ -353,25 +465,29 @@ bool parse_args( TimblOpts& Opts ) {
 	return false;
       }
     }
+    else {
+      *Log(theErrLog) << "missing a value for --xmldir (did you forget the '='?)" << endl;
+      return false;
+    }
 #endif
     doXMLout = true;
-    Opts.Delete( "xmldir");
+    Opts.remove( "xmldir");
   }
-  else if ( Opts.Find ('X', value, mood)) {
+  else if ( Opts.find ('X', value, mood)) {
     doXMLout = true;
     XMLoutFileName = value;
-    Opts.Delete('X');
+    Opts.remove('X');
   }
-  if ( Opts.Find ("KANON", value, mood) ){
+  if ( Opts.find ("KANON", value ) ){
     doKanon = true;
-    Opts.Delete( "KANON" );
+    Opts.remove( "KANON" );
   }
   doXMLin = false;
-  if ( Opts.Find ('x', value, mood)) {
+  if ( Opts.find ('x', value, mood)) {
     doXMLin = true;
     if ( !value.empty() ){
-      if ( ! (xmlDirName.empty() && 
-	      testDirName.empty() && 
+      if ( ! (xmlDirName.empty() &&
+	      testDirName.empty() &&
 	      TestFileName.empty() ) ){
 	*Log(theErrLog) << "-x may not provide a value when --testdir or --xmldir is provided" << endl;
 	return false;
@@ -383,27 +499,31 @@ bool parse_args( TimblOpts& Opts ) {
 	return false;
       }
     }
-    Opts.Delete('x');
+    Opts.remove('x');
   }
-  if ( Opts.Find ( "textclass", value, mood)) {
+  if ( Opts.find ( "textclass", value )) {
     if ( !doXMLin ){
       *Log(theErrLog) << "--textclass is only valid when -x is also present" << endl;
       return false;
     }
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --textclass (did you forget the '='?)" << endl;
+      return false;
+    }
     textclass = value;
-    Opts.Delete( "textclass");
-  }  
-  
-  if ( !outputFileName.empty() && !testDirName.empty() ){
-    *Log(theErrLog) << "useless -o value" << endl;
-    return false;
+    Opts.remove( "textclass");
   }
+
   if ( !XMLoutFileName.empty() && !testDirName.empty() ){
     *Log(theErrLog) << "useless -X value" << endl;
     return false;
   }
-  
-  if ( Opts.Find ("uttmarker", value, mood)) {
+
+  if ( Opts.find ("uttmarker", value )) {
+    if ( value.empty() ){
+      *Log(theErrLog) << "missing a value for --uttmarker (did you forget the '='?)" << endl;
+      return false;
+    }
     uttmark = value;
   }
   if ( !outputDirName.empty() && testDirName.empty() ){
@@ -416,19 +536,34 @@ bool parse_args( TimblOpts& Opts ) {
     else
       getFileNames( testDirName, "", fileNames );
     if ( fileNames.empty() ){
-      *Log(theErrLog) << "error: couln't find any files in directory: " 
+      *Log(theErrLog) << "error: couln't find any files in directory: "
 		      << testDirName << endl;
       return false;
     }
   }
-  if ( !doServer && TestFileName.empty() && fileNames.empty() ){
-    *Log(theErrLog) << "no frogging without input!" << endl;
-    return false;
+  if ( fileNames.empty() ){
+    if ( !TestFileName.empty() ){
+      fileNames.insert( TestFileName );
+    }
+    else {
+      vector<string> mass = Opts.getMassOpts();
+      for (size_t i=0; i < mass.size(); ++i ){
+	fileNames.insert( mass[i] );
+      }
+    }
+  }
+  if ( fileNames.size() > 1 ){
+    if ( !XMLoutFileName.empty() ){
+      *Log(theErrLog) << "'-X " << XMLoutFileName
+		      << "' is invalid for multiple inputfiles." << endl;
+      return false;
+    }
   }
+
   return true;
 }
 
-bool froginit(){  
+bool froginit(){
   // for some modules init can take a long time
   // so first make sure it will not fail on some trivialities
   //
@@ -454,7 +589,7 @@ bool froginit(){
     *Log(theErrLog) << " Parser disabled, because MWU is deselected" << endl;
     doParse = false;
   }
-  
+
   if ( doServer ){
     // we use fork(). omp (GCC version) doesn't do well when omp is used
     // before the fork!
@@ -481,6 +616,8 @@ bool froginit(){
 	if ( stat && doMorph ){
 	  stat = myMbma.init( configuration );
 	  if ( stat ) {
+	    if ( doDaringMorph )
+	      myMbma.setDaring(true);
 	    if ( doMwu ){
 	      stat = myMwu.init( configuration );
 	      if ( stat && doParse ){
@@ -505,6 +642,7 @@ bool froginit(){
     bool tagStat = true;
     bool iobStat = true;
     bool nerStat = true;
+
 #pragma omp parallel sections
     {
 #pragma omp section
@@ -529,19 +667,21 @@ bool froginit(){
       {
 	if ( doMorph ){
 	  mbaStat = myMbma.init( configuration );
+	  if ( doDaringMorph )
+	    myMbma.setDaring(true);
 	}
       }
-#pragma omp section 
+#pragma omp section
       {
 	tagStat = myCGNTagger.init( configuration );
       }
-#pragma omp section 
+#pragma omp section
       {
 	if ( doIOB ){
 	  iobStat = myIOBTagger.init( configuration );
 	}
       }
-#pragma omp section 
+#pragma omp section
       {
 	if ( doNER ){
 	  nerStat = myNERTagger.init( configuration );
@@ -561,30 +701,30 @@ bool froginit(){
 	}
       }
     }   // end omp parallel sections
-    if ( ! ( tokStat && iobStat && nerStat && tagStat && lemStat 
+    if ( ! ( tokStat && iobStat && nerStat && tagStat && lemStat
 	     && mbaStat && mwuStat && parStat ) ){
       *Log(theErrLog) << "Initialization failed for: ";
       if ( ! ( tokStat ) ){
 	*Log(theErrLog) << "[tokenizer] ";
-      }	
+      }
       if ( ! ( tagStat ) ){
 	*Log(theErrLog) << "[tagger] ";
-      }	
+      }
       if ( ! ( iobStat ) ){
 	*Log(theErrLog) << "[IOB] ";
-      }	
+      }
       if ( ! ( nerStat ) ){
 	*Log(theErrLog) << "[NER] ";
-      }	
+      }
       if ( ! ( lemStat ) ){
 	*Log(theErrLog) << "[lemmatizer] ";
-      }	
+      }
       if ( ! ( mbaStat ) ){
 	*Log(theErrLog) << "[morphology] ";
-      }	
+      }
       if ( ! ( mwuStat ) ){
 	*Log(theErrLog) << "[multiword unit] ";
-      }	
+      }
       if ( ! ( parStat ) ){
 	*Log(theErrLog) << "[parser] ";
       }
@@ -611,15 +751,19 @@ vector<Word*> lookup( Word *word, const vector<Entity*>& entities ){
   return vec;
 }
 
-Dependency *lookupDep( const Word *word, 
+Dependency *lookupDep( const Word *word,
 		       const vector<Dependency*>&dependencies ){
-  if ( tpDebug ){
+  if (dependencies.size() == 0 ){
+    return 0;
+  }
+  int dbFlag = stringTo<int>( configuration.lookUp( "debug", "parser" ) );
+  if ( dbFlag ){
     using TiCC::operator<<;
-    *Log( theErrLog ) << "lookup "<< word << " in " << dependencies << endl;
+    *Log( theErrLog ) << "\nDependency-lookup "<< word << " in " << dependencies << endl;
   }
   for ( size_t i=0; i < dependencies.size(); ++i ){
-    if ( tpDebug ){
-      *Log( theErrLog ) << "probeer " << dependencies[i] << endl;
+    if ( dbFlag ){
+      *Log( theErrLog ) << "Dependency try: " << dependencies[i] << endl;
     }
     try {
       vector<DependencyDependent*> dv = dependencies[i]->select<DependencyDependent>();
@@ -627,8 +771,8 @@ Dependency *lookupDep( const Word *word,
 	vector<Word*> v = dv[0]->select<Word>();
 	for ( size_t j=0; j < v.size(); ++j ){
 	  if ( v[j] == word ){
-	    if ( tpDebug ){
-	      *Log(theErrLog) << "\nfound word " << v[j] << endl;
+	    if ( dbFlag ){
+	      *Log(theErrLog) << "\nDependency found word " << v[j] << endl;
 	    }
 	    return dependencies[i];
 	  }
@@ -636,34 +780,35 @@ Dependency *lookupDep( const Word *word,
       }
     }
     catch ( exception& e ){
-      if  (tpDebug > 0) 
-	*Log(theErrLog) << "get Dependency results failed: " 
-			<< e.what() << endl;      
+      if (dbFlag > 0)
+	*Log(theErrLog) << "get Dependency results failed: "
+			<< e.what() << endl;
     }
   }
   return 0;
 }
 
-string lookupNEREntity( const vector<Word *>& mwu, 
+string lookupNEREntity( const vector<Word *>& mwu,
 			const vector<Entity*>& entities ){
   string endresult;
+  int dbFlag = stringTo<int>( configuration.lookUp( "debug", "NER" ) );
   for ( size_t j=0; j < mwu.size(); ++j ){
-    if ( tpDebug ){
+    if ( dbFlag ){
       using TiCC::operator<<;
-      *Log(theErrLog) << "lookup "<< mwu[j] << " in " << entities << endl;
+      *Log(theErrLog) << "\nNER: lookup "<< mwu[j] << " in " << entities << endl;
     }
     string result;
     for ( size_t i=0; i < entities.size(); ++i ){
-      if ( tpDebug ){
-	*Log(theErrLog) << "probeer " << entities[i] << endl;
+      if ( dbFlag ){
+	*Log(theErrLog) << "NER try: " << entities[i] << endl;
       }
       try {
 	vector<Word*> v = entities[i]->select<Word>();
 	bool first = true;
 	for ( size_t k=0; k < v.size(); ++k ){
 	  if ( v[k] == mwu[j] ){
-	    if (tpDebug){
-	      *Log(theErrLog) << "found word " << v[k] << endl;
+	    if (dbFlag){
+	      *Log(theErrLog) << "NER found word " << v[k] << endl;
 	    }
 	    if ( first )
 	      result += "B-" + uppercase(entities[i]->cls());
@@ -676,9 +821,9 @@ string lookupNEREntity( const vector<Word *>& mwu,
 	}
       }
       catch ( exception& e ){
-	if  (tpDebug > 0) 
-	  *Log(theErrLog) << "get NER results failed: " 
-			  << e.what() << endl;      
+	if  (dbFlag > 0)
+	  *Log(theErrLog) << "get NER results failed: "
+			  << e.what() << endl;
       }
     }
     if ( result.empty() )
@@ -692,26 +837,27 @@ string lookupNEREntity( const vector<Word *>& mwu,
 }
 
 
-string lookupIOBChunk( const vector<Word *>& mwu, 
+string lookupIOBChunk( const vector<Word *>& mwu,
 		       const vector<Chunk*>& chunks ){
   string endresult;
+  int dbFlag = stringTo<int>( configuration.lookUp( "debug", "IOB" ) );
   for ( size_t j=0; j < mwu.size(); ++j ){
-    if ( tpDebug ){
+    if ( dbFlag ){
       using TiCC::operator<<;
-      *Log(theErrLog) << "lookup "<< mwu[j] << " in " << chunks << endl;
+      *Log(theErrLog) << "IOB lookup "<< mwu[j] << " in " << chunks << endl;
     }
     string result;
     for ( size_t i=0; i < chunks.size(); ++i ){
-      if ( tpDebug ){
-	*Log(theErrLog) << "probeer " << chunks[i] << endl;
+      if ( dbFlag ){
+	*Log(theErrLog) << "IOB try: " << chunks[i] << endl;
       }
       try {
 	vector<Word*> v = chunks[i]->select<Word>();
 	bool first = true;
 	for ( size_t k=0; k < v.size(); ++k ){
 	  if ( v[k] == mwu[j] ){
-	    if (tpDebug){
-	      *Log(theErrLog) << "found word " << v[k] << endl;
+	    if (dbFlag){
+	      *Log(theErrLog) << "IOB found word " << v[k] << endl;
 	    }
 	    if ( first )
 	      result += "B-" + chunks[i]->cls();
@@ -724,9 +870,9 @@ string lookupIOBChunk( const vector<Word *>& mwu,
 	}
       }
       catch ( exception& e ){
-	if  (tpDebug > 0) 
-	  *Log(theErrLog) << "get Chunks results failed: " 
-			  << e.what() << endl;      
+	if  (dbFlag > 0)
+	  *Log(theErrLog) << "get Chunks results failed: "
+			  << e.what() << endl;
       }
     }
     if ( result.empty() )
@@ -739,7 +885,7 @@ string lookupIOBChunk( const vector<Word *>& mwu,
   return endresult;
 }
 
-void displayMWU( ostream& os, size_t index, 
+void displayMWU( ostream& os, size_t index,
 		 const vector<Word*> mwu ){
   string wrd;
   string pos;
@@ -748,7 +894,7 @@ void displayMWU( ostream& os, size_t index,
   double conf = 1;
   for ( size_t p=0; p < mwu.size(); ++p ){
     Word *word = mwu[p];
-    try { 
+    try {
       wrd += word->str();
       PosAnnotation *postag = word->annotation<PosAnnotation>( );
       pos += postag->cls();
@@ -759,45 +905,71 @@ void displayMWU( ostream& os, size_t index,
       conf *= postag->confidence();
     }
     catch ( exception& e ){
-      if  (tpDebug > 0) 
-	*Log(theErrLog) << "get Postag results failed: " 
-			<< e.what() << endl;            
+      if  (debugFlag > 0)
+	*Log(theErrLog) << "get Postag results failed: "
+			<< e.what() << endl;
     }
-    try { 
-      lemma += word->lemma();
-      if ( p < mwu.size() -1 ){
-	lemma += "_";
+    if ( doLemma ){
+      try {
+	lemma += word->lemma();
+	if ( p < mwu.size() -1 ){
+	  lemma += "_";
+	}
+      }
+      catch ( exception& e ){
+	if  (debugFlag > 0)
+	  *Log(theErrLog) << "get Lemma results failed: "
+			  << e.what() << endl;
       }
     }
-    catch ( exception& e ){
-      if  (tpDebug > 0) 
-	*Log(theErrLog) << "get Lemma results failed: " 
-			<< e.what() << endl;      
-    }
-    try { 
-      vector<MorphologyLayer*> ml = word->annotations<MorphologyLayer>();
-      for ( size_t q=0; q < ml.size(); ++q ){
-	vector<Morpheme*> m = ml[q]->select<Morpheme>();
-	for ( size_t t=0; t < m.size(); ++t ){
-	  morph += "[" + UnicodeToUTF8( m[t]->text() ) + "]";
+    if ( doDaringMorph ){
+      try {
+	vector<MorphologyLayer*> ml = word->annotations<MorphologyLayer>();
+	for ( size_t q=0; q < ml.size(); ++q ){
+	  vector<Morpheme*> m = ml[q]->select<Morpheme>( false );
+	  assert( m.size() == 1 ); // top complex layer
+	  string desc = m[0]->description();
+	  morph = desc;
+	  if ( q < ml.size()-1 )
+	    morph += "/";
+	}
+	if ( p < mwu.size() -1 ){
+	  morph += "_";
 	}
-	if ( q < ml.size()-1 )
-	  morph += "/";
       }
-      if ( p < mwu.size() -1 ){
-	morph += "_";
+      catch ( exception& e ){
+	if  (debugFlag > 0)
+	  *Log(theErrLog) << "get Morph results failed: "
+			  << e.what() << endl;
       }
     }
-    catch ( exception& e ){
-      if  (tpDebug > 0) 
-	*Log(theErrLog) << "get Morph results failed: " 
-			<< e.what() << endl;      
+    else if ( doMorph ){
+      try {
+	vector<MorphologyLayer*> ml = word->annotations<MorphologyLayer>();
+	for ( size_t q=0; q < ml.size(); ++q ){
+	  vector<Morpheme*> m = ml[q]->select<Morpheme>();
+	  for ( size_t t=0; t < m.size(); ++t ){
+	    string txt = UnicodeToUTF8( m[t]->text() );
+	    morph += "[" + txt + "]";
+	  }
+	  if ( q < ml.size()-1 )
+	    morph += "/";
+	}
+	if ( p < mwu.size() -1 ){
+	  morph += "_";
+	}
+      }
+      catch ( exception& e ){
+	if  (debugFlag > 0)
+	  *Log(theErrLog) << "get Morph results failed: "
+			  << e.what() << endl;
+      }
     }
   }
   os << index << "\t" << wrd << "\t" << lemma << "\t" << morph << "\t" << pos << "\t" << std::fixed << conf;
-}  
+}
 
-ostream &showResults( ostream& os, 
+ostream &showResults( ostream& os,
 		      const Sentence* sentence,
 		      bool showParse ){
   vector<Word*> words = sentence->words();
@@ -883,7 +1055,6 @@ ostream &showResults( ostream& os,
 }
 
 bool TestSentence( Sentence* sent,
-		   ostream& outStream,
 		   TimerBlock& timers ){
   vector<Word*> swords;
   if ( doQuoteDetection )
@@ -924,7 +1095,7 @@ bool TestSentence( Sentence* sent,
 	{
 	  if ( doMorph ){
 	    timers.mbmaTimer.start();
-	    if (tpDebug) 
+	    if (debugFlag)
 	      *Log(theErrLog) << "Calling mbma..." << endl;
 	    myMbma.Classify( swords[i] );
 	    timers.mbmaTimer.stop();
@@ -934,7 +1105,7 @@ bool TestSentence( Sentence* sent,
 	{
 	  if ( doLemma ){
 	    timers.mblemTimer.start();
-	    if (tpDebug) 
+	    if (debugFlag)
 	      *Log(theErrLog) << "Calling mblem..." << endl;
 	    myMblem.Classify( swords[i] );
 	    timers.mblemTimer.stop();
@@ -942,7 +1113,7 @@ bool TestSentence( Sentence* sent,
 	}
       } // omp parallel sections
     } //for int i = 0 to num_words
-    
+
     if ( doMwu ){
       if ( swords.size() > 0 ){
 	timers.mwuTimer.start();
@@ -964,6 +1135,7 @@ bool TestSentence( Sentence* sent,
 
 void Test( Document& doc,
 	   ostream& outStream,
+	   bool interactive = false,
 	   const string& xmlOutFile = "" ) {
   TimerBlock timers;
   timers.frogTimer.start();
@@ -978,14 +1150,14 @@ void Test( Document& doc,
     myIOBTagger.addDeclaration( doc );
   if (doNER)
     myNERTagger.addDeclaration( doc );
-  if (doMwu) 
+  if (doMwu)
     myMwu.addDeclaration( doc );
-  if (doParse) 
+  if (doParse)
     myParser.addDeclaration( doc );
 
-  if ( tpDebug > 5 )
+  if ( debugFlag > 5 )
     *Log(theErrLog) << "Testing document :" << doc << endl;
-  
+
   vector<Sentence*> topsentences = doc.sentences();
   vector<Sentence*> sentences;
   if ( doQuoteDetection )
@@ -993,13 +1165,13 @@ void Test( Document& doc,
   else
     sentences = topsentences;
   size_t numS = sentences.size();
-  if ( numS > 0 ) { //process sentences 
-    if  (tpDebug > 0) 
+  if ( numS > 0 ) { //process sentences
+    if  (debugFlag > 0)
       *Log(theErrLog) << "found " << numS << " sentence(s) in document." << endl;
     for ( size_t i = 0; i < numS; i++) {
       /* ******* Begin process sentence  ********** */
       //NOTE- full sentences are passed (which may span multiple lines) (MvG)
-      bool showParse = TestSentence( sentences[i], outStream, timers ); 
+      bool showParse = TestSentence( sentences[i], timers );
       if ( doParse && !showParse ){
 	*Log(theErrLog) << "WARNING!" << endl;
 	*Log(theErrLog) << "Sentence " << i+1 << " isn't parsed because it contains more tokens then set with the --max-parser-tokens=" << maxParserTokens << " option." << endl;
@@ -1009,90 +1181,85 @@ void Test( Document& doc,
       if ( !(doServer && doXMLout) )
 	showResults( outStream, topsentences[i], doParse );
     }
-    if ( doServer && doXMLout )
-      outStream << doc << endl;
-    if ( !xmlOutFile.empty() ){
-      doc.save( xmlOutFile, doKanon );
-      *Log(theErrLog) << "resulting FoLiA doc saved in " << xmlOutFile << endl;
-    }
-  } 
+  }
   else {
-    if  (tpDebug > 0) 
+    if  (debugFlag > 0)
       *Log(theErrLog) << "No sentences found in document. " << endl;
   }
-  
-  timers.frogTimer.stop();  
-  
-  *Log(theErrLog) << "tokenisation took:  " << timers.tokTimer << endl;
-  *Log(theErrLog) << "CGN tagging took:   " << timers.tagTimer << endl;
-  if ( doIOB)
-    *Log(theErrLog) << "IOB chunking took:  " << timers.iobTimer << endl;
-  if ( doNER)
-    *Log(theErrLog) << "NER took:           " << timers.nerTimer << endl;
-  if ( doMorph )
-    *Log(theErrLog) << "MBA took:           " << timers.mbmaTimer << endl;
-  if ( doLemma )
-    *Log(theErrLog) << "Mblem took:         " << timers.mblemTimer << endl;
-  if ( doMwu )
-    *Log(theErrLog) << "MWU resolving took: " << timers.mwuTimer << endl;
-  if ( doParse ){
-    *Log(theErrLog) << "Parsing (prepare) took: " << timers.prepareTimer << endl;
-    *Log(theErrLog) << "Parsing (pairs)   took: " << timers.pairsTimer << endl;
-    *Log(theErrLog) << "Parsing (rels)    took: " << timers.relsTimer << endl;
-    *Log(theErrLog) << "Parsing (dir)     took: " << timers.dirTimer << endl;
-    *Log(theErrLog) << "Parsing (csi)     took: " << timers.csiTimer << endl;
-    *Log(theErrLog) << "Parsing (total)   took: " << timers.parseTimer << endl;
+  if ( doServer && doXMLout )
+    outStream << doc << endl;
+  if ( !xmlOutFile.empty() ){
+    doc.save( xmlOutFile, doKanon );
+    *Log(theErrLog) << "resulting FoLiA doc saved in " << xmlOutFile << endl;
+  }
+
+  timers.frogTimer.stop();
+  if ( !interactive ){
+    *Log(theErrLog) << "tokenisation took:  " << timers.tokTimer << endl;
+    *Log(theErrLog) << "CGN tagging took:   " << timers.tagTimer << endl;
+    if ( doIOB)
+      *Log(theErrLog) << "IOB chunking took:  " << timers.iobTimer << endl;
+    if ( doNER)
+      *Log(theErrLog) << "NER took:           " << timers.nerTimer << endl;
+    if ( doMorph )
+      *Log(theErrLog) << "MBA took:           " << timers.mbmaTimer << endl;
+    if ( doLemma )
+      *Log(theErrLog) << "Mblem took:         " << timers.mblemTimer << endl;
+    if ( doMwu )
+      *Log(theErrLog) << "MWU resolving took: " << timers.mwuTimer << endl;
+    if ( doParse ){
+      *Log(theErrLog) << "Parsing (prepare) took: " << timers.prepareTimer << endl;
+      *Log(theErrLog) << "Parsing (pairs)   took: " << timers.pairsTimer << endl;
+      *Log(theErrLog) << "Parsing (rels)    took: " << timers.relsTimer << endl;
+      *Log(theErrLog) << "Parsing (dir)     took: " << timers.dirTimer << endl;
+      *Log(theErrLog) << "Parsing (csi)     took: " << timers.csiTimer << endl;
+      *Log(theErrLog) << "Parsing (total)   took: " << timers.parseTimer << endl;
+    }
   }
   *Log(theErrLog) << "Frogging in total took: " << timers.frogTimer << endl;
   return;
 }
 
 void Test( const string& infilename,
-	   const string& outName,
-	   const string& xmlOutFile ) {
+	   ostream &os,
+	   const string& xmlOutF ) {
   // stuff the whole input into one FoLiA document.
   // This is not a good idea on the long term, I think (agreed [proycon] )
-  ostream *os;
-  if ( outName.empty() ){
-    os = &cout;
-  }
-  else {
-    os = new ofstream( outName.c_str() );
-    if ( os->bad() ){
-      *Log(theErrLog) << "unable to open outputfile: " << outName << endl;
-      exit( EXIT_FAILURE );
+
+  string xmlOutFile = xmlOutF;
+  if ( doXMLin && !xmlOutFile.empty() ){
+    if ( match_back( infilename, ".gz" ) ){
+      if ( !match_back( xmlOutFile, ".gz" ) )
+	xmlOutFile += ".gz";
+    }
+    else if ( match_back( infilename, ".bz2" ) ){
+      if ( !match_back( xmlOutFile, ".bz2" ) )
+	xmlOutFile += ".bz2";
     }
   }
-  *Log(theErrLog) << "Frogging " << infilename << endl;
   if ( doXMLin ){
     Document doc;
     try {
       doc.readFromFile( infilename );
     }
     catch ( exception &e ){
-      *Log(theErrLog) << "retrieving FoLiA from '" << infilename << "' failed" << endl;
-      if ( !outName.empty() ){
-	delete os;
-      }
+      *Log(theErrLog) << "retrieving FoLiA from '" << infilename << "' failed with exception:" << endl;
+      cerr << e.what() << endl;
       return;
     }
     tokenizer.tokenize( doc );
-    Test( doc, *os, xmlOutFile );
+    Test( doc, os, false, xmlOutFile );
   }
   else {
     ifstream IN( infilename.c_str() );
     Document doc = tokenizer.tokenize( IN );
-    Test( doc, *os, xmlOutFile );
-  }
-  if ( !outName.empty() ){
-    *Log(theErrLog) << "results stored in " << outName << endl;
-    delete os;
+    Test( doc, os, false, xmlOutFile );
   }
 }
 
 void TestServer( Sockets::ServerSocket &conn) {
   //by Maarten van Gompel
-  
+
   try {
     while (true) {
       ostringstream outputstream;
@@ -1109,15 +1276,15 @@ void TestServer( Sockets::ServerSocket &conn) {
 	  // so this is wrong. Just bail out
 	  throw( runtime_error( "read garbage" ) );
 	}
-	if ( tpDebug )
-	  *Log(theErrLog) << "received data [" << result << "]" << endl;	
+	if ( debugFlag )
+	  *Log(theErrLog) << "received data [" << result << "]" << endl;
 	Document doc;
 	try {
 	  doc.readFromString( result );
 	}
 	catch ( std::exception& e ){
 	  *Log(theErrLog) << "FoLiaParsing failed:" << endl
-			  << e.what() << endl;	  
+			  << e.what() << endl;
 	  throw;
 	}
 	*Log(theErrLog) << "Processing... " << endl;
@@ -1138,31 +1305,125 @@ void TestServer( Sockets::ServerSocket &conn) {
 	    data += line + "\n";
 	  }
 	}
-	if (tpDebug)
+	if (debugFlag)
 	  *Log(theErrLog) << "Received: [" << data << "]" << endl;
 	*Log(theErrLog) << "Processing... " << endl;
 	istringstream inputstream(data,istringstream::in);
-	Document doc = tokenizer.tokenize( inputstream ); 
+	Document doc = tokenizer.tokenize( inputstream );
 	Test( doc, outputstream );
       }
       if (!conn.write( (outputstream.str()) ) || !(conn.write("READY\n"))  ){
-	if (tpDebug)
-	  *Log(theErrLog) << "socket " << conn.getMessage() << endl;	
+	if (debugFlag)
+	  *Log(theErrLog) << "socket " << conn.getMessage() << endl;
 	throw( runtime_error( "write to client failed" ) );
       }
-      
+
     }
   }
   catch ( std::exception& e ) {
-    if (tpDebug)
+    if (debugFlag)
       *Log(theErrLog) << "connection lost: " << e.what() << endl;
-  } 
+  }
   *Log(theErrLog) << "Connection closed.\n";
 }
 
+#ifdef HAVE_LIBREADLINE
+void TestInteractive(){
+  const char *prompt = "frog> ";
+  string line;
+  bool eof = false;
+  while ( !eof ){
+    string data;
+    char *input = readline( prompt );
+    if ( !input ){
+      eof = true;
+      break;
+    }
+    line = input;
+    if ( doSentencePerLine ){
+      if ( line.empty() ){
+	continue;
+      }
+      else {
+	data += line + "\n";
+	add_history( input );
+      }
+    }
+    else {
+      if ( !line.empty() ){
+	add_history( input );
+	data = line + "\n";
+      }
+      while ( !eof ){
+	char *input = readline( prompt );
+	if ( !input ){
+	  eof = true;
+	  break;
+	}
+	line = input;
+	if ( line.empty() ){
+	  break;
+	}
+	add_history( input );
+	data += line + "\n";
+      }
+    }
+    if ( !data.empty() ){
+      if ( data[data.size()-1] == '\n' ){
+	data = data.substr( 0, data.size()-1 );
+      }
+      cout << "Processing... '" << data << "'" << endl;
+      istringstream inputstream(data,istringstream::in);
+      Document doc = tokenizer.tokenize( inputstream );
+      Test( doc, cout, true );
+    }
+  }
+  cout << "Done.\n";
+}
+
+#else
+void TestInteractive(){
+  cout << "frog>"; cout.flush();
+  string line;
+  string data;
+  while ( getline( cin, line ) ){
+    string data = line;
+    if ( doSentencePerLine ){
+      if ( line.empty() ){
+	cout << "frog>"; cout.flush();
+	continue;
+      }
+    }
+    else {
+      if ( !line.empty() ){
+	data += "\n";
+      }
+      cout << "frog>"; cout.flush();
+      string line2;
+      while( getline( cin, line2 ) ){
+	if ( line2.empty() )
+	  break;
+	data += line2 + "\n";
+	cout << "frog>"; cout.flush();
+      }
+    }
+    if ( data.empty() ){
+      cout << "ignoring empty input" << endl;
+      cout << "frog>"; cout.flush();
+      continue;
+    }
+    cout << "Processing... " << endl;
+    istringstream inputstream(data,istringstream::in);
+    Document doc = tokenizer.tokenize( inputstream );
+    Test( doc, cout, true );
+    cout << "frog>"; cout.flush();
+  }
+  cout << "Done.\n";
+}
+#endif
 
 int main(int argc, char *argv[]) {
-  cerr << "frog " << VERSION << " (c) ILK 1998 - 2013" << endl;
+  cerr << "frog " << VERSION << " (c) ILK 1998 - 2014" << endl;
   cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
   ProgName = argv[0];
   cerr << "based on [" << Tokenizer::VersionName() << ", "
@@ -1173,56 +1434,81 @@ int main(int argc, char *argv[]) {
   //  cout << "configdir: " << configDir << endl;
   std::ios_base::sync_with_stdio(false);
   try {
-    TimblOpts Opts(argc, argv);
-        
+    TiCC::CL_Options Opts("c:e:o:t:x:X:nQhVd:S:",
+			  "textclass:,testdir:,uttmarker:,max-parser-tokens:,"
+			  "skip:,id:,outputdir:,xmldir:,tmpdir:,daring,debug:,"
+			  "keep-parser-files:,version,threads:,KANON");
+
+    Opts.init(argc, argv);
     if ( parse_args(Opts) ){
       if (  !froginit() ){
 	throw runtime_error( "init failed" );
       }
       if ( !fileNames.empty() ) {
-	string outPath;
-	string xmlPath;
-	if ( !outputDirName.empty() )
-	  outPath = outputDirName + "/";
-	if ( !xmlDirName.empty() )
-	  xmlPath = xmlDirName + "/";
+	string outPath = outputDirName;
+	string xmlPath = xmlDirName;
 	set<string>::const_iterator it = fileNames.begin();
+	ostream *outS = 0;
+	if ( !outputFileName.empty() ){
+	  outS = new ofstream( outputFileName.c_str() );
+	}
 	while ( it != fileNames.end() ){
-	  string testName = testDirName +"/" + *it;
+	  string testName = testDirName;
+	  testName += *it;
 	  string outName;
-	  if ( doXMLin ){
-	    if ( !outPath.empty() )
-	      outName = outPath + *it + ".out";
+	  if ( outS == 0 ){
+	    if ( wantOUT ){
+	      if ( doXMLin ){
+		if ( !outPath.empty() )
+		  outName = outPath + *it + ".out";
+	      }
+	      else
+		outName = outPath + *it + ".out";
+	      outS = new ofstream( outName.c_str() );
+	    }
+	    else {
+	      outS = &cout;
+	    }
 	  }
-	  else
-	    outName = outPath + *it + ".out";
-	  string xmlName;
-	  if ( !xmlDirName.empty() ){
-	    if ( it->rfind(".xml") == string::npos )
-	      xmlName = xmlPath + *it + ".xml";
-	    else
-	      xmlName = xmlPath + *it;
+	  string xmlName = XMLoutFileName;
+	  if ( xmlName.empty() ){
+	    if ( !xmlDirName.empty() ){
+	      if ( it->rfind(".xml") == string::npos )
+		xmlName = xmlPath + *it + ".xml";
+	      else
+		xmlName = xmlPath + *it;
+	    }
+	    else if ( doXMLout )
+	      xmlName = *it + ".xml"; // do not clobber the inputdir!
+	  }
+	  *Log(theErrLog) << "Frogging " << testName << endl;
+	  Test( testName, *outS, xmlName );
+	  if ( !outName.empty() ){
+	    *Log(theErrLog) << "results stored in " << outName << endl;
+	    delete outS;
+	    outS = 0;
 	  }
-	  else if ( doXMLout )
-	    xmlName = *it + ".xml"; // do not clobber the inputdir!
-	  Test( testName, outName, xmlName );
 	  ++it;
 	}
+	if ( !outputFileName.empty() ){
+	  *Log(theErrLog) << "results stored in " << outputFileName << endl;
+	  delete outS;
+	}
       }
-      else if ( doServer ) {  
+      else if ( doServer ) {
 	//first set up some things to deal with zombies
 	struct sigaction action;
 	action.sa_handler = SIG_IGN;
 	sigemptyset(&action.sa_mask);
 #ifdef SA_NOCLDWAIT
 	action.sa_flags = SA_NOCLDWAIT;
-#endif	
-	sigaction(SIGCHLD, &action, NULL); 
-	
+#endif
+	sigaction(SIGCHLD, &action, NULL);
+
 	srand((unsigned)time(0));
-	
+
 	*Log(theErrLog) << "Listening on port " << listenport << "\n";
-	
+
 	try
 	  {
 	    // Create the socket
@@ -1231,14 +1517,14 @@ int main(int argc, char *argv[]) {
 	      throw( runtime_error( "starting server on port " + listenport + " failed" ) );
 	    if ( !server.listen( 5 ) ) {
 	      // maximum of 5 pending requests
-	      throw( runtime_error( "listen(5) failed" ) ); 
+	      throw( runtime_error( "listen(5) failed" ) );
 	    }
 	    while ( true ) {
-	      
+
 	      Sockets::ServerSocket conn;
 	      if ( server.accept( conn ) ){
 		*Log(theErrLog) << "New connection..." << endl;
-		int pid = fork();				
+		int pid = fork();
 		if (pid < 0) {
 		  *Log(theErrLog) << "ERROR on fork" << endl;
 		  throw runtime_error( "FORK failed" );
@@ -1246,7 +1532,7 @@ int main(int argc, char *argv[]) {
 		  //		  server = NULL;
 		  TestServer(conn );
 		  exit(EXIT_SUCCESS);
-		} 
+		}
 	      }
 	      else {
 		throw( runtime_error( "Accept failed" ) );
@@ -1257,13 +1543,10 @@ int main(int argc, char *argv[]) {
 	    *Log(theErrLog) << "Server error:" << e.what() << " Exiting." << endl;
 	    throw;
 	  }
-	
-      } else {
-	if ( doXMLout && XMLoutFileName.empty() )
-	  XMLoutFileName = TestFileName + ".xml";
-	if ( wantOUT && outputFileName.empty() )
-	  outputFileName = TestFileName + ".out";
-	Test( TestFileName, outputFileName, XMLoutFileName );
+      }
+      else {
+	// interactive mode
+	TestInteractive( );
       }
     }
     else {
diff --git a/src/Makefile.am b/src/Makefile.am
index ef334ee..8ce3e31 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,8 @@
-# $Id: Makefile.am 15926 2013-04-03 16:00:02Z sloot $
+# $Id: Makefile.am 17436 2014-07-09 13:13:35Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Makefile.am $
 
 AM_CPPFLAGS = -I at top_srcdir@/include
-AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\"
+AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\" -std=c++0x
 bin_PROGRAMS = frog mbma mblem
 
 frog_SOURCES = Frog.cxx
@@ -19,7 +19,6 @@ libfrog_la_SOURCES = mbma_mod.cxx mblem_mod.cxx \
 	ucto_tokenizer_mod.cxx
 
 
-TESTS_ENVIRONMENT = $(SHELL) -x
 TESTS = tst.sh
 
 EXTRA_DIST = tst.sh
diff --git a/src/Makefile.in b/src/Makefile.in
index 8288152..6f8a0fd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,11 +14,56 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 15926 2013-04-03 16:00:02Z sloot $
+# $Id: Makefile.am 17436 2014-07-09 13:13:35Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Makefile.am $
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -40,10 +84,12 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = frog$(EXEEXT) mbma$(EXEEXT) mblem$(EXEEXT)
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/depcomp $(top_srcdir)/test-driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -89,7 +135,11 @@ am_libfrog_la_OBJECTS = mbma_mod.lo mblem_mod.lo Frog-util.lo \
 	mwu_chunker_mod.lo Parser.lo cgn_tagger_mod.lo \
 	iob_tagger_mod.lo ner_tagger_mod.lo ucto_tokenizer_mod.lo
 libfrog_la_OBJECTS = $(am_libfrog_la_OBJECTS)
-libfrog_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libfrog_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
 	$(CXXFLAGS) $(libfrog_la_LDFLAGS) $(LDFLAGS) -o $@
 PROGRAMS = $(bin_PROGRAMS)
@@ -105,30 +155,249 @@ am_mbma_OBJECTS = mbma_prog.$(OBJEXT)
 mbma_OBJECTS = $(am_mbma_OBJECTS)
 mbma_LDADD = $(LDADD)
 mbma_DEPENDENCIES = libfrog.la
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
 CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
 SOURCES = $(libfrog_la_SOURCES) $(frog_SOURCES) $(mblem_SOURCES) \
 	$(mbma_SOURCES)
 DIST_SOURCES = $(libfrog_la_SOURCES) $(frog_SOURCES) $(mblem_SOURCES) \
 	$(mbma_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT at .log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -174,7 +443,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -219,6 +487,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -291,7 +561,7 @@ top_srcdir = @top_srcdir@
 ucto_CFLAGS = @ucto_CFLAGS@
 ucto_LIBS = @ucto_LIBS@
 AM_CPPFLAGS = -I at top_srcdir@/include
-AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\"
+AM_CXXFLAGS = -DSYSCONF_PATH=\"$(SYSCONFDIR)\" -DPYTHONDIR=\"$(PYTHONDIR)\" -std=c++0x
 frog_SOURCES = Frog.cxx
 mbma_SOURCES = mbma_prog.cxx
 mblem_SOURCES = mblem_prog.cxx
@@ -303,14 +573,13 @@ libfrog_la_SOURCES = mbma_mod.cxx mblem_mod.cxx \
 	cgn_tagger_mod.cxx iob_tagger_mod.cxx ner_tagger_mod.cxx \
 	ucto_tokenizer_mod.cxx
 
-TESTS_ENVIRONMENT = $(SHELL) -x
 TESTS = tst.sh
 EXTRA_DIST = tst.sh
 CLEANFILES = tst.out
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .cxx .lo .o .obj
+.SUFFIXES: .cxx .lo .log .o .obj .test .test$(EXEEXT) .trs
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -341,9 +610,9 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -351,6 +620,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
 	}
@@ -366,24 +637,32 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
 libfrog.la: $(libfrog_la_OBJECTS) $(libfrog_la_DEPENDENCIES) $(EXTRA_libfrog_la_DEPENDENCIES) 
-	$(libfrog_la_LINK) -rpath $(libdir) $(libfrog_la_OBJECTS) $(libfrog_la_LIBADD) $(LIBS)
+	$(AM_V_CXXLD)$(libfrog_la_LINK) -rpath $(libdir) $(libfrog_la_OBJECTS) $(libfrog_la_LIBADD) $(LIBS)
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p || test -f $$p1; \
-	  then echo "$$p"; echo "$$p"; else :; fi; \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
 	done | \
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
 	sed 'N;N;N;s,\n, ,g' | \
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -404,7 +683,8 @@ uninstall-binPROGRAMS:
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
 	files=`for p in $$list; do echo "$$p"; done | \
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' `; \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
 	test -n "$$list" || exit 0; \
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -417,15 +697,18 @@ clean-binPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
+
 frog$(EXEEXT): $(frog_OBJECTS) $(frog_DEPENDENCIES) $(EXTRA_frog_DEPENDENCIES) 
 	@rm -f frog$(EXEEXT)
-	$(CXXLINK) $(frog_OBJECTS) $(frog_LDADD) $(LIBS)
+	$(AM_V_CXXLD)$(CXXLINK) $(frog_OBJECTS) $(frog_LDADD) $(LIBS)
+
 mblem$(EXEEXT): $(mblem_OBJECTS) $(mblem_DEPENDENCIES) $(EXTRA_mblem_DEPENDENCIES) 
 	@rm -f mblem$(EXEEXT)
-	$(CXXLINK) $(mblem_OBJECTS) $(mblem_LDADD) $(LIBS)
+	$(AM_V_CXXLD)$(CXXLINK) $(mblem_OBJECTS) $(mblem_LDADD) $(LIBS)
+
 mbma$(EXEEXT): $(mbma_OBJECTS) $(mbma_DEPENDENCIES) $(EXTRA_mbma_DEPENDENCIES) 
 	@rm -f mbma$(EXEEXT)
-	$(CXXLINK) $(mbma_OBJECTS) $(mbma_LDADD) $(LIBS)
+	$(AM_V_CXXLD)$(CXXLINK) $(mbma_OBJECTS) $(mbma_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -447,25 +730,25 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ucto_tokenizer_mod.Plo at am__quote@
 
 .cxx.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
 
 .cxx.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cxx.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -473,26 +756,15 @@ mostlyclean-libtool:
 clean-libtool:
 	-rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -504,15 +776,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -521,102 +789,187 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-check-TESTS: $(TESTS)
-	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
-	srcdir=$(srcdir); export srcdir; \
-	list=' $(TESTS) '; \
-	$(am__tty_colors); \
-	if test -n "$$list"; then \
-	  for tst in $$list; do \
-	    if test -f ./$$tst; then dir=./; \
-	    elif test -f $$tst; then dir=; \
-	    else dir="$(srcdir)/"; fi; \
-	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
-	      all=`expr $$all + 1`; \
-	      case " $(XFAIL_TESTS) " in \
-	      *[\ \	]$$tst[\ \	]*) \
-		xpass=`expr $$xpass + 1`; \
-		failed=`expr $$failed + 1`; \
-		col=$$red; res=XPASS; \
-	      ;; \
-	      *) \
-		col=$$grn; res=PASS; \
-	      ;; \
-	      esac; \
-	    elif test $$? -ne 77; then \
-	      all=`expr $$all + 1`; \
-	      case " $(XFAIL_TESTS) " in \
-	      *[\ \	]$$tst[\ \	]*) \
-		xfail=`expr $$xfail + 1`; \
-		col=$$lgn; res=XFAIL; \
-	      ;; \
-	      *) \
-		failed=`expr $$failed + 1`; \
-		col=$$red; res=FAIL; \
-	      ;; \
-	      esac; \
-	    else \
-	      skip=`expr $$skip + 1`; \
-	      col=$$blu; res=SKIP; \
-	    fi; \
-	    echo "$${col}$$res$${std}: $$tst"; \
-	  done; \
-	  if test "$$all" -eq 1; then \
-	    tests="test"; \
-	    All=""; \
-	  else \
-	    tests="tests"; \
-	    All="All "; \
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+	rm -f $< $@
+	$(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+	@:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
 	  fi; \
-	  if test "$$failed" -eq 0; then \
-	    if test "$$xfail" -eq 0; then \
-	      banner="$$All$$all $$tests passed"; \
-	    else \
-	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
-	    fi; \
-	  else \
-	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all $$tests failed"; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	else \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
 	    else \
-	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
 	    fi; \
-	  fi; \
-	  dashes="$$banner"; \
-	  skipped=""; \
-	  if test "$$skip" -ne 0; then \
-	    if test "$$skip" -eq 1; then \
-	      skipped="($$skip test was not run)"; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
 	    else \
-	      skipped="($$skip tests were not run)"; \
+	      color_start= color_end=; \
 	    fi; \
-	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
-	      dashes="$$skipped"; \
-	  fi; \
-	  report=""; \
-	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
-	    report="Please report to $(PACKAGE_BUGREPORT)"; \
-	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
-	      dashes="$$report"; \
-	  fi; \
-	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  if test "$$failed" -eq 0; then \
-	    col="$$grn"; \
-	  else \
-	    col="$$red"; \
-	  fi; \
-	  echo "$${col}$$dashes$${std}"; \
-	  echo "$${col}$$banner$${std}"; \
-	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
-	  test -z "$$report" || echo "$${col}$$report$${std}"; \
-	  echo "$${col}$$dashes$${std}"; \
-	  test "$$failed" -eq 0; \
-	else :; fi
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS:
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	bases=`for i in $$bases; do echo $$i; done \
+	         | $(am__list_recheck_tests)` || exit 1; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+tst.sh.log: tst.sh
+	@p='tst.sh'; \
+	b='tst.sh'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+ at am__EXEEXT_TRUE@.test$(EXEEXT).log:
+ at am__EXEEXT_TRUE@	@p='$<'; \
+ at am__EXEEXT_TRUE@	$(am__set_b); \
+ at am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ at am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
+ at am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ at am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -678,6 +1031,9 @@ install-strip:
 	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
 	fi
 mostlyclean-generic:
+	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -762,21 +1118,21 @@ uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
 	clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
-	clean-libtool ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-binPROGRAMS install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-binPROGRAMS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-binPROGRAMS \
-	uninstall-libLTLIBRARIES
+	recheck tags tags-am uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-libLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/Parser.cxx b/src/Parser.cxx
index 36e75af..b247344 100644
--- a/src/Parser.cxx
+++ b/src/Parser.cxx
@@ -1,13 +1,13 @@
 /*
-  $Id: Parser.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: Parser.cxx 17489 2014-08-07 08:42:59Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/Parser.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
   Version 0.04
- 
+
   This file is part of frog.
 
   frog is free software; you can redistribute it and/or modify
@@ -104,7 +104,7 @@ void PythonInterface::parse( const string& depFile,
 			     const string& maxDist,
 			     const string& inputFile,
 			     const string& outputFile ) {
-  
+
   PyObjectRef tmp = PyObject_CallFunction(mainFunction,
 					  (char *)"[s, s, s, s, s, s, s, s, s, s, s]",
 					  "--dep", depFile.c_str(),
@@ -141,7 +141,7 @@ ostream& operator<<( ostream& os, const parseData& pd ){
   }
   return os;
 }
-  
+
 void Parser::createParserFile( const parseData& pd ){
   const vector<string>& words = pd.words;
   const vector<string>& heads = pd.heads;
@@ -150,8 +150,8 @@ void Parser::createParserFile( const parseData& pd ){
   ofstream anaFile( fileName.c_str() );
   if ( anaFile ){
     for( size_t i = 0; i < words.size(); ++i ){
-      anaFile << i+1 << "\t" << words[i] << "\t" << "*" << "\t" << heads[i] 
-	      << "\t" << heads[i] << "\t" << mods[i] << "\t"<< "0" 
+      anaFile << i+1 << "\t" << words[i] << "\t" << "*" << "\t" << heads[i]
+	      << "\t" << heads[i] << "\t" << mods[i] << "\t"<< "0"
 	      << "\t" << "_" << "\t" << "_" << "\t" << "_" << endl;
     }
   }
@@ -261,7 +261,7 @@ bool Parser::init( const Configuration& configuration ){
   }
   if ( problem )
     return false;
-  
+
   bool happy = true;
   pairs = new Timbl::TimblAPI( pairsOptions );
   if ( pairs->Valid() ){
@@ -299,7 +299,7 @@ Parser::~Parser(){
   delete PI;
 }
 
-static vector<Word *> lookup( Word *word, 
+static vector<Word *> lookup( Word *word,
 			      const vector<Entity*>& entities ){
   vector<Word*> vec;
   for ( size_t p=0; p < entities.size(); ++p ){
@@ -327,7 +327,7 @@ void Parser::createPairs( const parseData& pd ){
       ps << "__ " << words[0] << " __"
 	 << " ROOT ROOT ROOT __ " << heads[0]
 	 << " __ ROOT ROOT ROOT "
-	 << words[0] << "^ROOT ROOT ROOT ROOT^" 
+	 << words[0] << "^ROOT ROOT ROOT ROOT^"
 	 << heads[0]
 	 << " _" << endl;
     }
@@ -357,12 +357,12 @@ void Parser::createPairs( const parseData& pd ){
 	}
 	ps << word_1 << " " << word0 << " " << word1
 	   << " ROOT ROOT ROOT "
-	   << tag_1 << " " << tag0 << " " << tag1 
+	   << tag_1 << " " << tag0 << " " << tag1
 	   << " ROOT ROOT ROOT "
 	   << tag0 << "^ROOT ROOT ROOT ROOT^" << mods0
 	   << " _" << endl;
       }
-      // 
+      //
       for ( size_t wPos=0; wPos < words.size(); ++wPos ){
 	string w_word_1, w_word0, w_word1;
 	string w_tag_1, w_tag0, w_tag1;
@@ -394,11 +394,11 @@ void Parser::createPairs( const parseData& pd ){
 	    continue;
 	  if ( wPos > maxDepSpan + pos )
 	    continue;
-	  
+
 	  ps << w_word_1;
 	  ps << " " << w_word0;
 	  ps << " " << w_word1;
-	  
+
 	  if ( pos == 0 )
 	    ps << " __";
 	  else
@@ -426,13 +426,13 @@ void Parser::createPairs( const parseData& pd ){
 	    ps << " " << heads[pos+1];
 	  else
 	    ps << " __";
-	  
+
 	  ps << " " << w_tag0 << "^";
 	  if ( pos < words.size() )
 	    ps << heads[pos];
 	  else
 	    ps << "__";
-	  
+
 	  if ( wPos > pos )
 	    ps << " LEFT " << wPos - pos;
 	  else
@@ -831,7 +831,7 @@ void Parser::prepareParse( const vector<Word *>& fwords,
       pd.mwus.push_back( vec );
     }
   }
-  
+
   createParserFile( pd );
 
 #pragma omp parallel sections
@@ -867,17 +867,18 @@ void appendParseResult( const vector<Word *>& words,
     }
     ++cnt;
   }
-  DependenciesLayer *dl = new DependenciesLayer();
-  Sentence *sent;
+  Sentence *sent = words[0]->sentence();
+  KWargs args;
+  args["generate_id"] = sent->id();
+  DependenciesLayer *dl = new DependenciesLayer(sent->doc(),args);
 #pragma omp critical(foliaupdate)
   {
-    sent = words[0]->sentence();
     sent->append( dl );
   }
   for ( size_t i=0; i < nums.size(); ++i ){
     if ( nums[i] != 0 ){
       KWargs args;
-      args["generate-id"] = sent->id();
+      args["generate_id"] = dl->id();
       args["class"] = roles[i];
 #pragma omp critical(foliaupdate)
       {
@@ -913,7 +914,7 @@ void Parser::Parse( const vector<Word*>& words, const string& mwuSet,
     *Log(parseLog) << "unable to parse an analisis without words" << endl;
     return;
   }
-  string resFileName = fileName + ".result"; 
+  string resFileName = fileName + ".result";
   string pairsInName = fileName +".pairs.inst";
   string pairsOutName = fileName +".pairs.out";
   string dirInName = fileName + ".dir.inst";
@@ -922,7 +923,7 @@ void Parser::Parse( const vector<Word*>& words, const string& mwuSet,
   string relsOutName = fileName + ".rels.out";
   remove( resFileName.c_str() );
   timers.prepareTimer.start();
-  parseData pd;  
+  parseData pd;
   prepareParse( words, mwuSet, pd );
   timers.prepareTimer.stop();
 #pragma omp parallel sections
diff --git a/src/cgn_tagger_mod.cxx b/src/cgn_tagger_mod.cxx
index 8a1334a..8449ba8 100644
--- a/src/cgn_tagger_mod.cxx
+++ b/src/cgn_tagger_mod.cxx
@@ -1,12 +1,12 @@
 /*
-  $Id: cgn_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: cgn_tagger_mod.cxx 17485 2014-08-06 14:10:15Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/cgn_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -29,6 +29,7 @@
 */
 
 #include "mbt/MbtAPI.h"
+#include "ucto/unicode.h"
 #include "frog/Frog.h"
 #include "frog/cgn_tagger_mod.h"
 
@@ -37,11 +38,13 @@ using namespace folia;
 
 CGNTagger::CGNTagger(){
   tagger = 0;
+  filter = 0;
   cgnLog = new LogStream( theErrLog, "cgn-tagger-" );
 }
 
 CGNTagger::~CGNTagger(){
   delete tagger;
+  delete filter;
   delete cgnLog;
 }
 
@@ -52,24 +55,24 @@ void fillSubSetTable(){
   // should become a config file!
   cgnSubSets.insert( make_pair("soort", "ntype" ));
   cgnSubSets.insert( make_pair("eigen", "ntype" ));
-  
+
   cgnSubSets.insert( make_pair("ev", "getal" ));
   cgnSubSets.insert( make_pair("mv", "getal" ));
   cgnSubSets.insert( make_pair("getal", "getal" ));
-  
+
   cgnSubSets.insert( make_pair("zijd", "genus" ));
   cgnSubSets.insert( make_pair("onz", "genus" ));
   cgnSubSets.insert( make_pair("masc", "genus" ));
   cgnSubSets.insert( make_pair("fem", "genus" ));
   cgnSubSets.insert( make_pair("genus", "genus" ) );
-  
+
   cgnSubSets.insert( make_pair("stan", "naamval" ));
   cgnSubSets.insert( make_pair("gen", "naamval" ));
   cgnSubSets.insert( make_pair("dat", "naamval" ));
   cgnSubSets.insert( make_pair("nomin", "naamval" ));
   cgnSubSets.insert( make_pair("obl", "naamval" ));
   cgnSubSets.insert( make_pair("bijz", "naamval" ));
-    
+
   cgnSubSets.insert( make_pair("afgebr", "spectype" ));
   cgnSubSets.insert( make_pair("afk", "spectype" ));
   cgnSubSets.insert( make_pair("deeleigen", "spectype" ));
@@ -80,14 +83,14 @@ void fillSubSetTable(){
   cgnSubSets.insert( make_pair("achter", "spectype" ));
   cgnSubSets.insert( make_pair("comment", "spectype" ));
   cgnSubSets.insert( make_pair("onverst", "spectype" ));
-  
+
   cgnSubSets.insert( make_pair("neven", "conjtype" ));
   cgnSubSets.insert( make_pair("onder", "conjtype" ));
-    
+
   cgnSubSets.insert( make_pair("init", "vztype" ));
   cgnSubSets.insert( make_pair("versm", "vztype" ));
   cgnSubSets.insert( make_pair("fin", "vztype" ));
-    
+
   cgnSubSets.insert( make_pair("agr", "npagr" ));
   cgnSubSets.insert( make_pair("evon", "npagr" ));
   cgnSubSets.insert( make_pair("rest", "npagr" ));
@@ -96,10 +99,10 @@ void fillSubSetTable(){
   cgnSubSets.insert( make_pair( "evmo", "npagr" ));
   cgnSubSets.insert( make_pair( "rest3", "npagr" ));
   cgnSubSets.insert( make_pair("evf", "npagr" ));
-  
+
   cgnSubSets.insert( make_pair("bep", "lwtype" ));
   cgnSubSets.insert( make_pair("onbep", "lwtype" ));
-  
+
   cgnSubSets.insert( make_pair("pers", "vwtype" ));
   cgnSubSets.insert( make_pair("pr", "vwtype" ));
   cgnSubSets.insert( make_pair("refl", "vwtype" ));
@@ -111,16 +114,16 @@ void fillSubSetTable(){
   cgnSubSets.insert( make_pair("excl", "vwtype" ));
   cgnSubSets.insert( make_pair("aanw", "vwtype" ));
   cgnSubSets.insert( make_pair("onbep", "vwtype" ));
-    
+
   cgnSubSets.insert( make_pair("adv-pron", "pdtype" ));
   cgnSubSets.insert( make_pair("pron", "pdtype" ));
   cgnSubSets.insert( make_pair("det", "pdtype" ));
   cgnSubSets.insert( make_pair("grad", "pdtype" ));
-  
+
   cgnSubSets.insert( make_pair("vol", "status" ));
   cgnSubSets.insert( make_pair("red", "status" ));
   cgnSubSets.insert( make_pair("nadr", "status" ));
-  
+
   cgnSubSets.insert( make_pair("1", "persoon" ));
   cgnSubSets.insert( make_pair("2", "persoon" ));
   cgnSubSets.insert( make_pair("2v", "persoon" ));
@@ -131,41 +134,41 @@ void fillSubSetTable(){
   cgnSubSets.insert( make_pair("3v", "persoon" ));
   cgnSubSets.insert( make_pair("3o", "persoon" ));
   cgnSubSets.insert( make_pair("persoon", "persoon" ));
-  
+
   cgnSubSets.insert( make_pair("prenom", "positie" ));
   cgnSubSets.insert( make_pair("postnom", "positie" ));
   cgnSubSets.insert( make_pair("nom", "positie" ));
   cgnSubSets.insert( make_pair("vrij", "positie" ));
-  
+
   cgnSubSets.insert( make_pair("zonder", "buiging" ));
   cgnSubSets.insert( make_pair("met-e", "buiging" ));
   cgnSubSets.insert( make_pair("met-s", "buiging" ));
-    
+
   cgnSubSets.insert( make_pair("zonder-v", "getal-n" ));
   cgnSubSets.insert( make_pair("mv-n", "getal-n" ));
   cgnSubSets.insert( make_pair("zonder-n", "getal-n" ));
-    
+
   cgnSubSets.insert( make_pair("basis", "graad" ));
   cgnSubSets.insert( make_pair("comp", "graad" ));
   cgnSubSets.insert( make_pair("sup", "graad" ));
   cgnSubSets.insert( make_pair("dim", "graad" ));
-  
+
   cgnSubSets.insert( make_pair("pv", "wvorm" ));
   cgnSubSets.insert( make_pair("inf", "wvorm" ));
   cgnSubSets.insert( make_pair("vd", "wvorm" ));
   cgnSubSets.insert( make_pair("od", "wvorm" ));
-    
+
   cgnSubSets.insert( make_pair("tgw", "pvtijd" ));
   cgnSubSets.insert( make_pair("verl", "pvtijd" ));
   cgnSubSets.insert( make_pair("conj", "pvtijd" ));
-  
+
   cgnSubSets.insert( make_pair("ev", "pvagr" ));
   cgnSubSets.insert( make_pair("mv", "pvagr" ));
   cgnSubSets.insert( make_pair( "met-t", "pvagr" ));
-    
+
   cgnSubSets.insert( make_pair("hoofd", "numtype" ));
   cgnSubSets.insert( make_pair("rang", "numtype" ));
-  
+
   cgnSubSets.insert( make_pair("dial", "dial" ));
 
   cgnConstraints.insert( make_pair( "getal", "N" ) );
@@ -173,12 +176,15 @@ void fillSubSetTable(){
   cgnConstraints.insert( make_pair( "pvagr", "WW" ) );
 }
 
- 
-bool CGNTagger::init( const Configuration& conf ){
-  debug = tpDebug;
-  string db = conf.lookUp( "debug", "tagger" );
-  if ( !db.empty() )
-    debug = TiCC::stringTo<int>( db );
+
+bool CGNTagger::init( const Configuration& config ){
+  string val = config.lookUp( "debug", "tagger" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
+    debug = TiCC::stringTo<int>( val );
+  }
   switch ( debug ){
   case 0:
   case 1:
@@ -195,12 +201,12 @@ bool CGNTagger::init( const Configuration& conf ){
     break;
   default:
     cgnLog->setlevel(LogExtreme);
-  }    
+  }
   if ( tagger != 0 ){
     *Log(cgnLog) << "CGNTagger is already initialized!" << endl;
     return false;
-  }  
-  string val = conf.lookUp( "settings", "tagger" );
+  }
+  val = config.lookUp( "settings", "tagger" );
   if ( val.empty() ){
     *Log(cgnLog) << "Unable to find settings for Tagger" << endl;
     return false;
@@ -209,21 +215,29 @@ bool CGNTagger::init( const Configuration& conf ){
   if ( val[0] == '/' ) // an absolute path
     settings = val;
   else
-    settings =  configuration.configDir() + val;
+    settings =  config.configDir() + val;
 
-  val = conf.lookUp( "version", "tagger" );
+  val = config.lookUp( "version", "tagger" );
   if ( val.empty() ){
     version = "1.0";
   }
   else
     version = val;
-  val = conf.lookUp( "set", "tagger" );
+  val = config.lookUp( "set", "tagger" );
   if ( val.empty() ){
     tagset = "http://ilk.uvt.nl/folia/sets/frog-mbpos-cgn";
   }
   else
     tagset = val;
   fillSubSetTable();
+  string charFile = config.lookUp( "char_filter_file", "tagger" );
+  if ( charFile.empty() )
+    charFile = config.lookUp( "char_filter_file" );
+  if ( !charFile.empty() ){
+    charFile = prefix( config.configDir(), charFile );
+    filter = new Tokenizer::UnicodeFilter();
+    filter->fill( charFile );
+  }
   string init = "-s " + settings + " -vcf";
   tagger = new MbtAPI( init, *cgnLog );
   return tagger->isInit();
@@ -253,7 +267,7 @@ string getSubSet( const string& val, const string& head ){
     }
     ++it;
   }
-  throw folia::ValueError( "unable to find cgn subset for class: '" + val + 
+  throw folia::ValueError( "unable to find cgn subset for class: '" + val +
 			   "' whithin the constraints for '" + head + "'" );
 }
 
@@ -263,8 +277,10 @@ void CGNTagger::addTag( Word *word, const string& inputTag, double confidence ){
   string tagPartS;
   string ucto_class = word->cls();
   if ( debug )
-    *Log(cgnLog) << "ucto class= " << ucto_class << endl;
-  if ( ucto_class == "PUNCTUATION" && cgnTag.find("SPEC(") != string::npos ){
+    *Log(cgnLog) << "ucto class= " << ucto_class << " cgnTag=" << cgnTag << endl;
+  if ( ucto_class == "PUNCTUATION"
+       && ( cgnTag.find("SPEC(") != string::npos
+	    || cgnTag.find("LET") != string::npos ) ){
     mainTag = "LET";
     tagPartS = "";
     cgnTag = "LET()";
@@ -278,6 +294,7 @@ void CGNTagger::addTag( Word *word, const string& inputTag, double confidence ){
   }
   else if ( ucto_class == "SMILEY" ||
 	    ucto_class == "REVERSE-SMILEY" ||
+	    ucto_class == "EMOTICON" ||
 	    ucto_class.find("URL") == 0 ||
 	    ucto_class == "E-MAIL" ){
     mainTag = "SPEC";
@@ -337,15 +354,16 @@ vector<TagResult> CGNTagger::tagLine( const string& line ){
 
 void CGNTagger::Classify( const vector<Word*>& swords ){
   if ( !swords.empty() ) {
-    vector<string> words;
     string sentence; // the tagger needs the whole sentence
     for ( size_t w = 0; w < swords.size(); ++w ) {
-      sentence += swords[w]->str();
-      words.push_back( swords[w]->str() );
+      UnicodeString word = swords[w]->text();
+      if ( filter )
+	word = filter->filter( word );
+      sentence += UnicodeToUTF8(word);
       if ( w < swords.size()-1 )
 	sentence += " ";
     }
-    if (debug) 
+    if (debug)
       *Log(cgnLog) << "CGN tagger in: " << sentence << endl;
     vector<TagResult> tagv = tagger->TagLine(sentence);
     if ( tagv.size() != swords.size() ){
@@ -354,7 +372,7 @@ void CGNTagger::Classify( const vector<Word*>& swords ){
       for ( size_t w = 0; w < swords.size(); ++w ) {
 	*Log(cgnLog) << "w[" << w << "]= " << swords[w]->str() << endl;
       }
-      *Log(cgnLog) << "words according to CGN tagger: " << endl;    
+      *Log(cgnLog) << "words according to CGN tagger: " << endl;
       for ( size_t i=0; i < tagv.size(); ++i ){
 	*Log(cgnLog) << "word[" << i << "]=" << tagv[i].word() << endl;
       }
@@ -363,8 +381,8 @@ void CGNTagger::Classify( const vector<Word*>& swords ){
     if ( debug ){
       *Log(cgnLog) << "CGN tagger out: " << endl;
       for ( size_t i=0; i < tagv.size(); ++i ){
-	*Log(cgnLog) << "[" << i << "] : word=" << tagv[i].word() 
-		     << " tag=" << tagv[i].assignedTag() 
+	*Log(cgnLog) << "[" << i << "] : word=" << tagv[i].word()
+		     << " tag=" << tagv[i].assignedTag()
 		     << " confidence=" << tagv[i].confidence() << endl;
       }
     }
diff --git a/src/iob_tagger_mod.cxx b/src/iob_tagger_mod.cxx
index 19c90c2..43b5a44 100644
--- a/src/iob_tagger_mod.cxx
+++ b/src/iob_tagger_mod.cxx
@@ -1,12 +1,12 @@
 /*
-  $Id: iob_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: iob_tagger_mod.cxx 17487 2014-08-06 14:55:31Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/iob_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -44,12 +44,16 @@ IOBTagger::~IOBTagger(){
   delete tagger;
   delete iobLog;
 }
- 
-bool IOBTagger::init( const Configuration& conf ){
-  debug = tpDebug;
-  string db = conf.lookUp( "debug", "IOB" );
-  if ( !db.empty() )
-    debug = TiCC::stringTo<int>( db );
+
+bool IOBTagger::init( const Configuration& config ){
+  debug = 0;
+  string val = config.lookUp( "debug", "IOB" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
+    debug = TiCC::stringTo<int>( val );
+  }
   switch ( debug ){
   case 0:
   case 1:
@@ -67,14 +71,14 @@ bool IOBTagger::init( const Configuration& conf ){
     break;
   default:
     iobLog->setlevel(LogExtreme);
-  }    
-  if (debug) 
+  }
+  if (debug)
     *Log(iobLog) << "IOB Chunker Init" << endl;
   if ( tagger != 0 ){
     *Log(iobLog) << "IOBTagger is already initialized!" << endl;
     return false;
-  }  
-  string val = conf.lookUp( "settings", "IOB" );
+  }
+  val = config.lookUp( "settings", "IOB" );
   if ( val.empty() ){
     *Log(iobLog) << "Unable to find settings for IOB" << endl;
     return false;
@@ -83,15 +87,15 @@ bool IOBTagger::init( const Configuration& conf ){
   if ( val[0] == '/' ) // an absolute path
     settings = val;
   else
-    settings =  configuration.configDir() + val;
+    settings = config.configDir() + val;
 
-  val = conf.lookUp( "version", "IOB" );
+  val = config.lookUp( "version", "IOB" );
   if ( val.empty() ){
     version = "1.0";
   }
   else
     version = val;
-  val = conf.lookUp( "set", "IOB" );
+  val = config.lookUp( "set", "IOB" );
   if ( val.empty() ){
     tagset = "http://ilk.uvt.nl/folia/sets/frog-chunker-nl";
   }
@@ -103,7 +107,7 @@ bool IOBTagger::init( const Configuration& conf ){
   return tagger->isInit();
 }
 
-void IOBTagger::addChunk( ChunkingLayer *chunks, 
+void IOBTagger::addChunk( ChunkingLayer *chunks,
 			  const vector<Word*>& words,
 			  const vector<double>& confs,
 			  const string& IOB ){
@@ -114,6 +118,7 @@ void IOBTagger::addChunk( ChunkingLayer *chunks,
   args["class"] = IOB;
   args["set"] = tagset;
   args["confidence"] = toString(conf);
+  args["generate_id"] = chunks->id();
   Chunk *chunk = 0;
 #pragma omp critical(foliaupdate)
   {
@@ -149,7 +154,9 @@ void IOBTagger::addIOBTags( const vector<Word*>& words,
       el = sent->annotation<ChunkingLayer>();
     }
     catch(...){
-      el = new ChunkingLayer();
+      KWargs args;
+      args["generate_id"] = sent->id();
+      el = new ChunkingLayer(sent->doc(),args);
       sent->append( el );
     }
   }
@@ -157,7 +164,7 @@ void IOBTagger::addIOBTags( const vector<Word*>& words,
   vector<double> dstack;
   string curIOB;
   for ( size_t i=0; i < tags.size(); ++i ){
-    if (debug) 
+    if (debug)
       *Log(iobLog) << "tag = " << tags[i] << endl;
     vector<string> tagwords;
     size_t num_words = TiCC::split_at( tags[i], tagwords, "_" );
@@ -166,14 +173,14 @@ void IOBTagger::addIOBTags( const vector<Word*>& words,
       exit( EXIT_FAILURE );
     }
     vector<string> iob;
-    if (debug) 
+    if (debug)
       *Log(iobLog) << "IOB = " << tagwords[1] << endl;
     if ( tagwords[1] == "O" ){
       if ( !stack.empty() ){
 	if (debug) {
 	  *Log(iobLog) << "O spit out " << curIOB << endl;
 	  using TiCC::operator<<;
-	  *Log(iobLog) << "spit out " << stack << endl;	
+	  *Log(iobLog) << "spit out " << stack << endl;
 	}
 	addChunk( el, stack, dstack, curIOB );
 	dstack.clear();
@@ -197,7 +204,7 @@ void IOBTagger::addIOBTags( const vector<Word*>& words,
 	if ( debug ){
 	  *Log(iobLog) << "B spit out " << curIOB << endl;
 	  using TiCC::operator<<;
-	  *Log(iobLog) << "spit out " << stack << endl;	
+	  *Log(iobLog) << "spit out " << stack << endl;
 	}
 	addChunk( el, stack, dstack, curIOB );
 	dstack.clear();
@@ -212,14 +219,14 @@ void IOBTagger::addIOBTags( const vector<Word*>& words,
     if ( debug ){
       *Log(iobLog) << "END spit out " << curIOB << endl;
       using TiCC::operator<<;
-      *Log(iobLog) << "spit out " << stack << endl;	
+      *Log(iobLog) << "spit out " << stack << endl;
     }
     addChunk( el, stack, dstack, curIOB );
   }
 }
 
 void IOBTagger::addDeclaration( Document& doc ) const {
-  doc.declare( AnnotationType::CHUNKING, 
+  doc.declare( AnnotationType::CHUNKING,
 	       tagset,
 	       "annotator='frog-chunker-" + version
 	       + "', annotatortype='auto', datetime='" + getTime() + "'");
@@ -235,7 +242,7 @@ void IOBTagger::Classify( const vector<Word *>& swords ){
       if ( w < swords.size()-1 )
 	sentence += " ";
     }
-    if (debug) 
+    if (debug)
       *Log(iobLog) << "IOB in: " << sentence << endl;
     vector<TagResult> tagv = tagger->TagLine(sentence);
     if ( tagv.size() != swords.size() ){
@@ -244,13 +251,13 @@ void IOBTagger::Classify( const vector<Word *>& swords ){
     if ( debug ){
       *Log(iobLog) << "IOB tagger out: " << endl;
       for ( size_t i=0; i < tagv.size(); ++i ){
-	*Log(iobLog) << "[" << i << "] : word=" << tagv[i].word() 
-		     << " tag=" << tagv[i].assignedTag() 
+	*Log(iobLog) << "[" << i << "] : word=" << tagv[i].word()
+		     << " tag=" << tagv[i].assignedTag()
 		     << " confidence=" << tagv[i].confidence() << endl;
       }
     }
     vector<double> conf;
-    vector<string> tags;    
+    vector<string> tags;
     for ( size_t i=0; i < tagv.size(); ++i ){
       tags.push_back( tagv[i].assignedTag() );
       conf.push_back( tagv[i].confidence() );
@@ -258,5 +265,3 @@ void IOBTagger::Classify( const vector<Word *>& swords ){
     addIOBTags( swords, tags, conf );
   }
 }
-
-
diff --git a/src/mblem_mod.cxx b/src/mblem_mod.cxx
index 981d9a3..a605f63 100755
--- a/src/mblem_mod.cxx
+++ b/src/mblem_mod.cxx
@@ -1,36 +1,37 @@
 /*
-  $Id: mblem_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: mblem_mod.cxx 17436 2014-07-09 13:13:35Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mblem_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
 
   frog is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by  
-  the Free Software Foundation; either version 3 of the License, or  
-  (at your option) any later version.  
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
 
   frog is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of  
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
-  GNU General Public License for more details.  
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
 
-  You should have received a copy of the GNU General Public License  
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.  
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
   For questions and suggestions, see:
       http://ilk.uvt.nl/software.html
   or send mail to:
       timbl at uvt.nl
-*/                                                                   
+*/
 
 #include <cstdlib>
 #include <string>
 #include <iostream>
 #include <fstream>
 #include "timbl/TimblAPI.h"
+#include "ucto/unicode.h"
 #include "ticcutils/LogStream.h"
 #include "ticcutils/Configuration.h"
 #include "frog/Frog.h"
@@ -40,7 +41,7 @@ using namespace std;
 using namespace TiCC;
 using namespace folia;
 
-Mblem::Mblem(): myLex(0),punctuation( "?...,:;\\'`(){}[]%#+-_=/!" ), 
+Mblem::Mblem(): myLex(0),punctuation( "?...,:;\\'`(){}[]%#+-_=/!" ),
 		history(20), debug(0) {
   mblemLog = new LogStream( theErrLog, "mblem" );
 }
@@ -48,7 +49,7 @@ Mblem::Mblem(): myLex(0),punctuation( "?...,:;\\'`(){}[]%#+-_=/!" ),
 void Mblem::read_transtable( const string& tableName ) {
   ifstream bron( tableName.c_str() );
   if ( !bron ) {
-    *Log(mblemLog) << "translation table file '" << tableName 
+    *Log(mblemLog) << "translation table file '" << tableName
 		    << "' appears to be missing." << endl;
     exit(1);
   }
@@ -64,7 +65,7 @@ void Mblem::read_transtable( const string& tableName ) {
       classMap[classCode] = className;
     }
     // else {
-    //   *Log(mblemLog) << "multiple entry " << className << " " << classCode << " in translation table file: " << tableName  << " (Ignored) " << endl;      
+    //   *Log(mblemLog) << "multiple entry " << className << " " << classCode << " in translation table file: " << tableName  << " (Ignored) " << endl;
     // }
     bron >> ws;
   }
@@ -73,11 +74,15 @@ void Mblem::read_transtable( const string& tableName ) {
 
 bool Mblem::init( const Configuration& config ) {
   *Log(mblemLog) << "Initiating lemmatizer..." << endl;
-  debug = tpDebug;
-  string db = config.lookUp( "debug", "mblem" );
-  if ( !db.empty() )
-    debug = TiCC::stringTo<int>( db );
-  string val = config.lookUp( "version", "mblem" );
+  debug = 0;
+  string val = config.lookUp( "debug", "mblem" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
+    debug = TiCC::stringTo<int>( val );
+  }
+  val = config.lookUp( "version", "mblem" );
   if ( val.empty() ){
     version = "1.0";
   }
@@ -96,7 +101,7 @@ bool Mblem::init( const Configuration& config ) {
   }
   else
     cgn_tagset = val;
-  
+
   string transName = config.lookUp( "transFile", "mblem" );
   if ( !transName.empty() ){
     transName = prefix( config.configDir(), transName );
@@ -106,11 +111,21 @@ bool Mblem::init( const Configuration& config ) {
   if ( treeName.empty() )
     treeName = "mblem.tree";
   treeName = prefix( config.configDir(), treeName );
+
+  string charFile = config.lookUp( "char_filter_file", "mblem" );
+  if ( charFile.empty() )
+    charFile = config.lookUp( "char_filter_file" );
+  if ( !charFile.empty() ){
+    charFile = prefix( config.configDir(), charFile );
+    filter = new Tokenizer::UnicodeFilter();
+    filter->fill( charFile );
+  }
+
   string opts = config.lookUp( "timblOpts", "mblem" );
   if ( opts.empty() )
     opts = "-a1";
   //make it silent
-  opts += " +vs -vf";	    
+  opts += " +vs -vf";
   //Read in (igtree) data
   myLex = new Timbl::TimblAPI(opts);
   return myLex->GetInstanceBase(treeName);
@@ -128,9 +143,8 @@ string Mblem::make_instance( const UnicodeString& in ) {
     *Log(mblemLog) << "making instance from: " << in << endl;
   UnicodeString instance = "";
   size_t length = in.length();
-  size_t j;
   for ( size_t i=0; i < history; i++) {
-    j = length - history + i;
+    size_t j = length - history + i;
     if (( i < history - length ) &&
 	(length<history))
       instance += "= ";
@@ -143,7 +157,7 @@ string Mblem::make_instance( const UnicodeString& in ) {
   string result = UnicodeToUTF8(instance);
   if (debug)
     *Log(mblemLog) << "inst: " << instance << endl;
-  
+
   return result;
 }
 
@@ -155,7 +169,7 @@ bool similar( const string& tag, const string& lookuptag,
 
 bool isSimilar( const string& tag, const string& cgnTag ){
   // Dutch CGN constraints
-  return 
+  return
     tag == cgnTag ||
     similar( tag, cgnTag, "hulpofkopp" ) ||
     similar( tag, cgnTag, "neut,zelfst" ) ||
@@ -189,7 +203,7 @@ void Mblem::addLemma( FoliaElement *word, const string& cls ){
     word->addLemmaAnnotation( args );
   }
 }
-  
+
 void Mblem::addAltLemma( Word *word, const string& cls ){
   Alternative *alt = new Alternative();
 #pragma omp critical(foliaupdate)
@@ -198,20 +212,20 @@ void Mblem::addAltLemma( Word *word, const string& cls ){
   }
   addLemma( alt, cls );
 }
-  
+
 void Mblem::filterTag( const string& postag ){
   vector<mblemData>::iterator it = mblemResult.begin();
   while( it != mblemResult.end() ){
-    if (debug)
-      *Log(mblemLog) << "compare cgn-tag " << postag << " with " << it->getTag() << " ";
     if ( isSimilar( postag, it->getTag() ) ){
       if ( debug )
-	*Log(mblemLog) << "similar! " << endl;
+	*Log(mblemLog) << "compare cgn-tag " << postag << " with "
+		       << it->getTag() << " similar! " << endl;
       ++it;
     }
     else {
       if ( debug )
-	*Log(mblemLog) << "NOT similar! " << endl;	
+	*Log(mblemLog) << "compare cgn-tag " << postag << " with "
+		       << it->getTag() << " NOT similar! " << endl;
       it = mblemResult.erase(it);
     }
   }
@@ -234,12 +248,19 @@ void Mblem::makeUnique( ){
       }
       else {
 	if ( debug )
-	  *Log(mblemLog) << "NOT equal! " << endl;	
+	  *Log(mblemLog) << "NOT equal! " << endl;
 	++it2;
       }
     }
     ++it;
   }
+  if (debug){
+    *Log(mblemLog) << "final result after filter and unique" << endl;
+    for( size_t index=0; index < mblemResult.size(); ++index ){
+      *Log(mblemLog) << "lemma alt: " << mblemResult[index].getLemma()
+		     << "\ttag alt: " << mblemResult[index].getTag() << endl;
+    }
+  }
 }
 
 void Mblem::getFoLiAResult( Word *word, const UnicodeString& uWord ){
@@ -264,11 +285,11 @@ void Mblem::getFoLiAResult( Word *word, const UnicodeString& uWord ){
       ++it;
     }
   }
-} 
+}
 
 
 void Mblem::addDeclaration( Document& doc ) const {
-  doc.declare( AnnotationType::LEMMA, 
+  doc.declare( AnnotationType::LEMMA,
 	       tagset,
 	       "annotator='frog-mblem-" + version
 	       + "', annotatortype='auto', datetime='" + getTime() + "'");
@@ -277,30 +298,54 @@ void Mblem::addDeclaration( Document& doc ) const {
 void Mblem::Classify( Word *sword ){
   if ( sword->isinstance(PlaceHolder_t ) )
     return;
-  string word;
+  UnicodeString word;
   string tag;
   string pos;
+  string token_class;
 #pragma omp critical(foliaupdate)
-  {  
-    word = sword->str();
+  {
+    word = sword->text();
     pos = sword->pos();
+    token_class = sword->cls();
     tag = sword->annotation<PosAnnotation>( cgn_tagset )->feat("head");
   }
-  if ( tag == "SPEC" || tag == "LET" ) {
-    addLemma( sword, word );
+  if (debug)
+    *Log(mblemLog) << "Classify " << word << "(" << pos << ") ["
+		   << token_class << "]" << endl;
+  if ( filter )
+    word = filter->filter( word );
+  if ( tag == "LET" ){
+    addLemma( sword, UnicodeToUTF8(word) );
+    return;
+  }
+  else if ( tag == "SPEC" ){
+    if ( pos.find("eigen") != string::npos ){
+      // SPEC(deeleigen) might contain suffixes
+      if ( token_class == "QUOTE-SUFFIX" ){
+	addLemma( sword, UnicodeToUTF8(UnicodeString( word, 0, word.length()-1)));
+      }
+      else if ( token_class == "WORD-WITHSUFFIX" ){
+	addLemma( sword, UnicodeToUTF8(UnicodeString( word, 0, word.length()-2)));
+      }
+      else {
+	addLemma( sword, UnicodeToUTF8(word) );      return;
+      }
+    }
+    else
+      addLemma( sword, UnicodeToUTF8(word) );
     return;
   }
-  UnicodeString uWord = UTF8ToUnicode(word);
-  uWord.toLower();
-  Classify( uWord );
-  filterTag( pos ); 
-  makeUnique(); 
-  getFoLiAResult( sword, uWord ); 
+  if ( tag != "SPEC")
+    word.toLower();
+  Classify( word );
+  filterTag( pos );
+  makeUnique();
+  getFoLiAResult( sword, word );
 }
 
 void Mblem::Classify( const UnicodeString& uWord ){
   mblemResult.clear();
-  string inst = make_instance(uWord);  
+  string inst = make_instance(uWord);
   string classString;
   myLex->Classify( inst, classString );
   if (debug)
@@ -313,11 +358,11 @@ void Mblem::Classify( const UnicodeString& uWord ){
   }
   int index = 0;
   while ( index < numParts ) {
-    string partS = parts[index++]; 
+    string partS = parts[index++];
     UnicodeString lemma;
     string restag;
     string::size_type pos = partS.find("+");
-    if ( pos == string::npos ){ 
+    if ( pos == string::npos ){
       // nothing to edit
       restag = partS;
       lemma = uWord;
@@ -351,10 +396,10 @@ void Mblem::Classify( const UnicodeString& uWord ){
       if (debug){
 	*Log(mblemLog) << "pre-prefix word: '" << uWord << "' prefix: '"
 		       << prefix << "'" << endl;
-      }	
+      }
       int prefixpos = 0;
       if ( !prefix.isEmpty() ) {
-	// Whenever Toads makemblem is improved, (the infamous 
+	// Whenever Toads makemblem is improved, (the infamous
 	// 'tegemoetgekomen' example), this should probably
 	// become prefixpos = uWord.lastIndexOf(prefix);
 	prefixpos = uWord.indexOf(prefix);
@@ -366,7 +411,7 @@ void Mblem::Classify( const UnicodeString& uWord ){
 	  prefix.remove();
 	}
       }
-      
+
       if (debug)
 	*Log(mblemLog) << "prefixpos = " << prefixpos << endl;
       if (prefixpos >= 0) {
@@ -374,13 +419,13 @@ void Mblem::Classify( const UnicodeString& uWord ){
 	prefixpos = prefixpos + prefix.length();
       }
       if (debug)
-	*Log(mblemLog) << "post word: "<< uWord 
+	*Log(mblemLog) << "post word: "<< uWord
 		       << " lemma: " << lemma
 		       << " prefix: " << prefix
 		       << " delstr: " << delstr
 		       << " insstr: " << insstr
 		       << endl;
-      
+
       if ( uWord.endsWith( delstr ) ){
 	if ( uWord.length() > delstr.length() ){
 	  // chop delstr from the back, but do not delete the whole word
@@ -417,7 +462,7 @@ void Mblem::Classify( const UnicodeString& uWord ){
 	  *Log(mblemLog) << "found " << restag << endl;
       }
       else
-	*Log(mblemLog) << "problem: found no translation for " 
+	*Log(mblemLog) << "problem: found no translation for "
 		       << restag << " using it 'as-is'" << endl;
     }
     if ( debug )
diff --git a/src/mblem_prog.cxx b/src/mblem_prog.cxx
index fc8df21..4cf525c 100644
--- a/src/mblem_prog.cxx
+++ b/src/mblem_prog.cxx
@@ -2,11 +2,11 @@
   $Id:$
   $URL:$
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Morphological-Analyzer for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -50,7 +50,6 @@ using namespace Timbl;
 
 LogStream my_default_log( cerr, "", StampMessage ); // fall-back
 LogStream *theErrLog = &my_default_log;  // fill the externals
-int tpDebug = 0; //0 for none, more for more output
 
 string TestFileName;
 string ProgName;
@@ -142,7 +141,7 @@ bool parse_args( TimblOpts& Opts ) {
   return true;
 }
 
-bool init(){  
+bool init(){
   // for some modules init can take a long time
   // so first make sure it will not fail on some trivialities
   //
@@ -192,7 +191,7 @@ void Test( istream& in ){
 
 int main(int argc, char *argv[]) {
   std::ios_base::sync_with_stdio(false);
-  cerr << "mblem " << VERSION << " (c) ILK 1998 - 2013" << endl;
+  cerr << "mblem " << VERSION << " (c) ILK 1998 - 2014" << endl;
   cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
   ProgName = argv[0];
   cerr << "based on [" << Timbl::VersionName() << "]" << endl;
diff --git a/src/mbma_mod.cxx b/src/mbma_mod.cxx
index bf145ba..22b77cf 100755
--- a/src/mbma_mod.cxx
+++ b/src/mbma_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: mbma_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: mbma_mod.cxx 17460 2014-07-16 15:29:20Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mbma_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
@@ -14,7 +14,7 @@
 
   frog is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
@@ -31,10 +31,12 @@
 #include <set>
 #include <iostream>
 #include <fstream>
+#include <sstream>
 #include <timbl/TimblAPI.h>
 
-#include "frog/Frog.h"
+#include "ucto/unicode.h"
 #include "ticcutils/Configuration.h"
+#include "frog/Frog.h"
 #include "frog/mbma_mod.h"
 
 using namespace std;
@@ -44,14 +46,168 @@ using namespace TiCC;
 const long int LEFT =  6; // left context
 const long int RIGHT = 6; // right context
 
-Mbma::Mbma(): MTreeFilename( "dm.igtree" ), MTree(0), transliterator(0) { 
+Mbma::Mbma(): MTreeFilename( "dm.igtree" ), MTree(0),
+	      transliterator(0), filter(0), doDaring(false) {
   mbmaLog = new LogStream( theErrLog, "mbma-" );
 }
 
-Mbma::~Mbma() { 
-  cleanUp(); 
+Mbma::~Mbma() {
+  cleanUp();
+  delete transliterator;
+  delete filter;
   delete mbmaLog;
-};
+}
+
+namespace CLEX {
+
+  Type toCLEX( const string& s ){
+    if ( s == "N" )
+      return N;
+    else if ( s == "A" )
+      return A;
+    else if ( s == "Q" )
+      return Q;
+    else if ( s == "V" )
+      return V;
+    else if ( s == "D" )
+      return D;
+    else if ( s == "O" )
+      return O;
+    else if ( s == "B" )
+      return B;
+    else if ( s == "P" )
+      return P;
+    else if ( s == "Y" )
+      return Y;
+    else if ( s == "I" )
+      return I;
+    else if ( s == "X" )
+      return X;
+    else if ( s == "Z" )
+      return Z;
+    else if ( s == "PN" )
+      return PN;
+    else if ( s == "*" )
+      return AFFIX;
+    else if ( s == "x" )
+      return XAFFIX;
+    else if ( s == "0" )
+      return NEUTRAL;
+    else
+      return UNASS;
+  }
+
+  Type toCLEX( const char c ){
+    string s;
+    s += c;
+    return toCLEX(s);
+  }
+
+  string toLongString( const Type& t ){
+    switch ( t ){
+    case N:
+      return "noun";
+    case A:
+      return "adjective";
+    case Q:
+      return "quantifier/numeral";
+    case V:
+      return "verb";
+    case D:
+      return "article";
+    case O:
+      return "pronoun";
+    case B:
+      return "adverb";
+    case P:
+      return "preposition";
+    case Y:
+      return "conjunction";
+    case I:
+      return "interjection";
+    case X:
+      return "unanalysed";
+    case Z:
+      return "expression part";
+    case PN:
+      return "proper noun";
+    case AFFIX:
+      return "affix";
+    case XAFFIX:
+      return "x affix";
+    case NEUTRAL:
+      return "0";
+    default:
+      return "UNASS";
+    }
+  }
+
+  string toString( const Type& t ){
+    switch ( t ){
+    case N:
+      return "N";
+    case A:
+      return "A";
+    case Q:
+      return "Q";
+    case V:
+      return "V";
+    case D:
+      return "D";
+    case O:
+      return "O";
+    case B:
+      return "B";
+    case P:
+      return "P";
+    case Y:
+      return "Y";
+    case I:
+      return "I";
+    case X:
+      return "X";
+    case Z:
+      return "Z";
+    case PN:
+      return "PN";
+    case AFFIX:
+      return "*";
+    case XAFFIX:
+      return "x";
+    case NEUTRAL:
+      return "0";
+    default:
+      return "/";
+    }
+  }
+
+  bool isBasicClass( const Type& t ){
+    const string basictags = "NAQVDOBPYIXZ";
+    switch ( t ){
+    case N:
+    case A:
+    case Q:
+    case V:
+    case D:
+    case O:
+    case B:
+    case P:
+    case Y:
+    case I:
+    case X:
+    case Z:
+      return true;
+    default:
+      return false;
+    }
+  }
+
+}
+
+ostream& operator<<( ostream& os, const CLEX::Type t ){
+  os << toString( t );
+  return os;
+}
 
 void Mbma::fillMaps() {
   //
@@ -59,19 +215,19 @@ void Mbma::fillMaps() {
   //
   // first the CELEX POS tag names
   //
-  tagNames["N"] = "noun";
-  tagNames["A"] = "adjective";
-  tagNames["Q"] = "quantifier/numeral";
-  tagNames["V"] = "verb";
-  tagNames["D"] = "article";
-  tagNames["O"] = "pronoun";
-  tagNames["B"] = "adverb";
-  tagNames["P"] = "preposition";
-  tagNames["Y"] = "conjunction";
-  tagNames["I"] = "interjection";
-  tagNames["X"] = "unanalysed";
-  tagNames["Z"] = "expression part";
-  tagNames["PN"] = "proper noun";
+  tagNames[CLEX::N] = "noun";
+  tagNames[CLEX::A] = "adjective";
+  tagNames[CLEX::Q] = "quantifier/numeral";
+  tagNames[CLEX::V] = "verb";
+  tagNames[CLEX::D] = "article";
+  tagNames[CLEX::O] = "pronoun";
+  tagNames[CLEX::B] = "adverb";
+  tagNames[CLEX::P] = "preposition";
+  tagNames[CLEX::Y] = "conjunction";
+  tagNames[CLEX::I] = "interjection";
+  tagNames[CLEX::X] = "unanalysed";
+  tagNames[CLEX::Z] = "expression part";
+  tagNames[CLEX::PN] = "proper noun";
   //
   // now the inflections
   iNames['X'] = "";
@@ -122,31 +278,39 @@ void Mbma::init_cgn( const string& dir ) {
       vector<string> tmp;
       size_t num = split_at(line, tmp, " ");
       if ( num == 2 )
-	TAGconv.insert( make_pair( tmp[0], tmp[1] ) ); 
+	TAGconv.insert( make_pair( tmp[0], tmp[1] ) );
     }
   }
   else
     throw ( runtime_error( "unable to open:" + fn ) );
 }
 
-void Mbma::init_filter( ){
+Transliterator *Mbma::init_trans( ){
   UErrorCode stat = U_ZERO_ERROR;
-  transliterator = Transliterator::createInstance( "NFD; [:M:] Remove; NFC",
-						   UTRANS_FORWARD,
-						   stat );
+  Transliterator *t = Transliterator::createInstance( "NFD; [:M:] Remove; NFC",
+						      UTRANS_FORWARD,
+						      stat );
   if ( U_FAILURE( stat ) ){
     throw runtime_error( "initFilter FAILED !" );
   }
+  return t;
 }
 
-  
+
 bool Mbma::init( const Configuration& config ) {
   *Log(mbmaLog) << "Initiating morphological analyzer..." << endl;
-  debugFlag = tpDebug;
-  string db = config.lookUp( "debug", "mbma" );
-  if ( !db.empty() )
-    debugFlag = TiCC::stringTo<int>( db );
-  string val = config.lookUp( "version", "mbma" );
+  debugFlag = 0;
+  string val = config.lookUp( "debug", "mbma" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
+    debugFlag = TiCC::stringTo<int>( val );
+  }
+  val = config.lookUp( "daring", "mbma" );
+  if ( !val.empty() )
+    doDaring = TiCC::stringTo<bool>( val );
+  val = config.lookUp( "version", "mbma" );
   if ( val.empty() ){
     version = "1.0";
   }
@@ -166,6 +330,21 @@ bool Mbma::init( const Configuration& config ) {
   else
     cgn_tagset = val;
 
+  val = config.lookUp( "clex_set", "mbma" );
+  if ( val.empty() ){
+    clex_tagset = "http://ilk.uvt.nl/folia/sets/frog-mbpos-clex";
+  }
+  else
+    clex_tagset = val;
+
+  string charFile = config.lookUp( "char_filter_file", "mbma" );
+  if ( charFile.empty() )
+    charFile = config.lookUp( "char_filter_file" );
+  if ( !charFile.empty() ){
+    charFile = prefix( config.configDir(), charFile );
+    filter = new Tokenizer::UnicodeFilter();
+    filter->fill( charFile );
+  }
   string tfName = config.lookUp( "treeFile", "mbma" );
   if ( tfName.empty() )
     tfName = "mbma.igtree";
@@ -173,8 +352,11 @@ bool Mbma::init( const Configuration& config ) {
   fillMaps();
   init_cgn( config.configDir() );
   string dof = config.lookUp( "filter_diacritics", "mbma" );
-  if ( dof == "true" || dof == "TRUE" || dof =="yes" || dof == "YES" ){
-    init_filter();
+  if ( !dof.empty() ){
+    bool b = stringTo<bool>( dof );
+    if ( b ){
+      transliterator = init_trans();
+    }
   }
   //Read in (igtree) data
   string opts = config.lookUp( "timblOpts", "mbma" );
@@ -184,17 +366,16 @@ bool Mbma::init( const Configuration& config ) {
   MTree = new Timbl::TimblAPI(opts);
   return MTree->GetInstanceBase(MTreeFilename);
 }
-  
+
 void Mbma::cleanUp(){
   // *Log(mbmaLog) << "cleaning up MBMA stuff " << endl;
   delete MTree;
   MTree = 0;
+  clearAnalysis();
 }
-  
+
 vector<string> Mbma::make_instances( const UnicodeString& word ){
   vector<string> insts;
-  if (debugFlag > 2)
-    *Log(mbmaLog) << "word: " << word << "\twl : " << word.length() << endl;
   for( long i=0; i < word.length(); ++i ) {
     if (debugFlag > 10)
       *Log(mbmaLog) << "itt #:" << i << endl;
@@ -215,175 +396,236 @@ vector<string> Mbma::make_instances( const UnicodeString& word ){
 	*Log(mbmaLog) << " : " << inst << endl;
     }
     inst += "?";
-    if (debugFlag > 2)
-      *Log(mbmaLog) << "inst #" << i << " : " << inst << endl;
-    // classify res
     insts.push_back( UnicodeToUTF8(inst) );
     // store res
   }
   return insts;
 }
-  
-string extract( const string& line, size_t start, char to ){
-  string::size_type pos = line.find( to , start );
-  if ( to == '>' && pos == string::npos ){
-    cerr << "invalid edit value in line " << line << endl;
-    return "";
+
+bool RulePart::isBasic() const {
+  return isBasicClass( ResultClass );
+}
+
+ostream& operator<<( ostream& os, const RulePart& r ){
+  if ( r.ResultClass == CLEX::UNASS &&
+       r.inflect.empty() ){
+    os << "INVALID! No result node, AND no inflection" << endl;
+  }
+  else {
+    os << r.uchar << " - ";
+    for ( size_t i = 0; i < r.RightHand.size(); ++i ){
+      os << r.RightHand[i];
+      if ( i < r.RightHand.size()-1 ){
+	os << "+";
+      }
+    }
+    if ( !r.RightHand.empty() ){
+      os << " ==> ";
+    }
+    os << r.ResultClass << " ";
+    if ( !r.inflect.empty() ){
+      os << " INFLECTION: " << r.inflect;
+    }
+  }
+  if ( r.fixpos >= 0 )
+    os << " affix at pos: " << r.fixpos;
+  if ( r.xfixpos >= 0 )
+    os << " x-affix at pos: " << r.xfixpos;
+  if ( !r.ins.isEmpty() )
+    os << " insert='" << r.ins << "'";
+  if ( !r.del.isEmpty() )
+    os << " delete='" << r.del << "'";
+  if ( !r.morpheme.isEmpty() )
+    os << " morpheme ='" << r.morpheme << "'";
+  return os;
+}
+
+ostream& operator<<( ostream& os, const RulePart *r ){
+  return os << *r;
+}
+
+void RulePart::get_ins_del( const string& edit ){
+  if (edit[0]=='D') { // delete operation
+    string s = edit.substr(1);
+    ins = UTF8ToUnicode( s );
+  }
+  else if ( edit[0]=='I') {  //insert operation
+    string s = edit.substr(1);
+    del = UTF8ToUnicode( s );
+  }
+  else if ( edit[0]=='R') { // replace operation
+    string::size_type pos = edit.find( ">" );
+    string s = edit.substr( 1, pos-1 );
+    ins = UTF8ToUnicode( s );
+    s = edit.substr( pos+1 );
+    del = UTF8ToUnicode( s );
   }
-  return line.substr( start, pos - start );
 }
 
-string Mbma::calculate_ins_del( const string& in_class, 
-				string& deletestring,
-				string& insertstring,
-				bool& participle ){
-  string result_class = in_class;
-  size_t pos = in_class.find("+");
-  if ( pos != string::npos ) { 
-    if ( debugFlag){
-      *Log(mbmaLog) << "calculate ins/del for " << in_class << endl;
-    }
-    participle = ( in_class.find( 'p' ) < pos );
-    pos++;
-    if (in_class[pos]=='D') { // delete operation 
-      deletestring = extract( in_class, pos+1, '/' );
-    }
-    else if ( in_class[pos]=='I') {  //insert operation
-      insertstring = extract( in_class, pos+1, '/' );
-    }
-    else if ( in_class[pos]=='R') { // replace operation 
-      deletestring = extract( in_class, pos+1, '>' );
-      pos += deletestring.length()+1;
-      insertstring = extract( in_class, pos+1, '/' );
-    }
-    /* spelling change done; remove from in_class */
-    result_class = extract( in_class, 0, '+' );
-    pos = in_class.find("/");
-    if ( pos != string::npos )
-      result_class += in_class.substr( pos );
-    if ( debugFlag){
-      *Log(mbmaLog) << "Insert = " << insertstring << ", delete=" << deletestring << endl;
-      *Log(mbmaLog) << "result class=" << result_class << endl;
+RulePart::RulePart( const string& rs, const UChar kar ):
+  ResultClass(CLEX::UNASS),
+  uchar(kar),
+  fixpos(-1),
+  xfixpos(-1),
+  participle(false)
+{
+  //  cerr << "extract RulePart:" << rs << endl;
+  string edit;
+  string s = rs;
+  string::size_type ppos = rs.find("+");
+  if ( ppos != string::npos ){
+    // some edit info is available
+    string::size_type spos = rs.find("/");
+    if ( spos != string::npos ){
+      // inflection too
+      inflect = rs.substr( spos+1 );
+      //    cerr << "inflect = " << inflect << endl;
+      edit = rs.substr( ppos+1, spos-ppos-1 );
+    }
+    else {
+      edit = rs.substr( ppos+1 );
+    }
+    //    cerr << "EDIT = " << edit << endl;
+    get_ins_del( edit );
+    s = rs.substr(0, ppos );
+    participle = ( s.find( 'p' ) != string::npos ) &&
+      ( del == "ge" || del == "be" );
+  }
+  string::size_type pos = s.find("_");
+  if ( pos != string::npos ){
+    ResultClass = CLEX::toCLEX( s[0] );
+    // a rewrite RulePart
+    if ( pos != 1 ){
+      cerr << "Surprise! _ on a strange position:" << pos << " in " << s << endl;
+    }
+    else {
+      string rhs = s.substr( pos+1 );
+      //      cerr << "RHS = " << rhs << endl;
+      string::size_type spos = rhs.find("/");
+      if ( spos != string::npos ){
+	// inflection too
+	inflect = rhs.substr( spos+1 );
+	// cerr << "inflect = " << inflect << endl;
+	rhs = rhs.substr( 0, spos );
+      }
+      //      cerr << "RHS = " << rhs << endl;
+      RightHand.resize( rhs.size() );
+      for ( size_t i = 0; i < rhs.size(); ++i ){
+	CLEX::Type tag = CLEX::toCLEX( rhs[i] );
+	if ( tag == CLEX::UNASS ){
+	  cerr << "Unhandled class in rhs=" << rhs << endl;
+	  continue;
+	}
+	else {
+	  //	  cerr << "found tag '" << tag << "' in " << rhs << endl;
+	  RightHand[i] = tag;
+	  if ( tag == CLEX::AFFIX ){
+	    fixpos = i;
+	  }
+	  if ( tag == CLEX::XAFFIX ){
+	    xfixpos = i;
+	  }
+	}
+      }
     }
   }
   else {
-    if ( debugFlag ){
-      *Log(mbmaLog) << "calculate_ins_del: do nothing" << endl;
-      *Log(mbmaLog) << "result class=" << result_class << endl;
+    //    cerr << "normal RulePart " << s << endl;
+    CLEX::Type tag = CLEX::toCLEX( s[0] );
+    string::size_type pos = s.find("/");
+    if ( pos != string::npos ){
+      // some inflextion
+      if ( tag != CLEX::UNASS ){
+	// cases like 0/e 0/te2I
+	ResultClass = tag;
+	inflect = s.substr(pos+1);
+      }
+      else {
+	//  E/P
+	inflect = s;
+      }
+      //      cerr << "inflect =" << inflect << endl;
+    }
+    else if ( tag != CLEX::UNASS ){
+      // dull case
+      ResultClass = tag;
+    }
+    else {
+      // m
+      inflect = s;
+      //	cerr << "inflect =" << inflect << endl;
     }
   }
-  return result_class;
 }
 
+Rule::Rule( const vector<string>& parts,
+	    const UnicodeString& s,
+	    int flag ): debugFlag( flag ){
+  for ( size_t k=0; k < parts.size(); ++k ) {
+    string this_class = parts[k];
+    RulePart cur( this_class, s[k] );
+    rules.push_back( cur );
+  }
+}
 
-ostream& operator<< ( ostream& os, const waStruct& a ){
-  os << "[" << a.word << "]" << a.act;
+ostream& operator<<( ostream& os, const Rule& r ){
+  os << "MBMA rule:" << endl;
+  for ( size_t k=0; k < r.rules.size(); ++k ) {
+    os << "\t" << r.rules[k] << endl;
+  }
   return os;
 }
 
-ostream& operator<< ( ostream& os, const vector<waStruct>& V ){
-  for ( size_t i=0; i < V.size(); ++i )
-    os << V[i];
+ostream& operator<<( ostream& os, const Rule *r ){
+  if ( r )
+    os << *r << endl;
+  else
+    os << "Empty MBMA rule" << endl;
   return os;
 }
 
-vector<waStruct> Mbma::Step1( unsigned int step, 
-			      const UnicodeString& word,
-			      const vector<vector<string> >& classParts,
-			      const string& basictags ) {
-  vector<waStruct> ana;
-  size_t tobeignored=0;
-  string this_class;
-  string previoustag;
-  waStruct waItem;
-  for ( long k=0; k < word.length(); ++k ) { 
-    this_class = classParts[step][k];
-    if ( debugFlag){
-      *Log(mbmaLog) << "Step::" << step << " " << this_class << endl;
-    }
-    string deletestring;
-    string insertstring;
-    bool participle = false;
-    this_class = calculate_ins_del( this_class, deletestring, insertstring, participle );
-    if ( deletestring == "eeer" )
-      deletestring = "eer";
-    /* exceptions */
-    bool eexcept = false;
-    if ( deletestring == "ere" ){ 
-      deletestring = "er";
-      eexcept = true;
-    }
-    // insert the deletestring :-) 
-    UnicodeString dels = UTF8ToUnicode( deletestring );
-    waItem.word += dels;
-    // delete the insertstring :-) 
-    if ( tobeignored == 0 &&
-	 ( !participle || 
-	   ( insertstring != "ge" &&
-	     insertstring != "be" ) ) )
-      tobeignored = insertstring.length();
-    
-    if ( basictags.find(this_class[0]) != string::npos ){
-      // encountering POS tag
-      if ( !previoustag.empty() ) { 
-	waItem.act = previoustag;
-	ana.push_back( waItem );
-	waItem.clear();
-      }
-      previoustag = this_class;
-    }
-    else { 
-      if ( this_class[0] !='0' ){ 
-	// encountering inflection info
-	if ( !previoustag.empty() ) { 
-	  waItem.act = previoustag;
-	  ana.push_back( waItem );
-	  waItem.clear();
-	}
-	previoustag = "i" + this_class;
-      }
+void Rule::reduceZeroNodes(){
+  vector<RulePart> out;
+  for ( size_t k=0; k < rules.size(); ++k ) {
+    if ( rules[k].ResultClass == CLEX::NEUTRAL
+	 && rules[k].morpheme.isEmpty()
+	 && rules[k].inflect.empty() ){
     }
-    /* copy the next character */
-    if ( eexcept ) { 
-      waItem.word += "e";
-      eexcept = false;
-    }
-    if ( tobeignored == 0 ) { 
-      waItem.word += word[k];
+    else {
+      out.push_back(rules[k]);
     }
-    else if (tobeignored > 0 )
-      tobeignored--;
   }
-  waItem.act = previoustag;
-  ana.push_back( waItem );
-  waItem.clear();
-  
-  // do we have inflection?
-  size_t pos = this_class.find( '/' );
-  if ( pos != string::npos && this_class != "E/P" ) { 
-    // tags like 0/te3 N/e 0/P etc.
-    string inflection = "i" + this_class.substr( pos+1 );
-    waItem.act = inflection;
-    ana.push_back( waItem );
+  rules.swap( out );
+}
+
+vector<string> Rule::extract_morphemes() const {
+  vector<string> morphemes;
+  vector<RulePart>::const_iterator it = rules.begin();
+  while ( it != rules.end() ) {
+    UnicodeString morpheme = it->morpheme;
+    if ( !morpheme.isEmpty() ){
+      morphemes.push_back( UnicodeToUTF8(morpheme) );
+    }
+    ++it;
   }
-  return ana;
+  return morphemes;
 }
 
-string select_tag( const char ch ){
-  string newtag;
+CLEX::Type select_tag( const char ch ){
+  CLEX::Type result = CLEX::UNASS;
   switch( ch ){
   case 'm':
   case 'e':
   case 'd':
   case 'G':
   case 'D':
-    newtag = "N";
+    result = CLEX::N;
   break;
   case 'P':
   case 'C':
   case 'S':
   case 'E':
-    newtag = "A";
+    result = CLEX::A;
   break;
   case 'i':
   case 'p':
@@ -391,147 +633,680 @@ string select_tag( const char ch ){
   case 'v':
   case 'g':
   case 'a':
-    newtag = "V";
+    result = CLEX::V;
   break;
   default:
     break;
   }
-  return newtag;
+  return result;
 }
 
-void Mbma::resolve_inflections( vector<waStruct>& ana, 
-				const string& basictags ) {
+
+void Mbma::resolve_inflections( Rule& rule ){
   // resolve all clearly resolvable implicit selections of inflectional tags
-  for ( vector<waStruct>::iterator it = ana.begin(); 
-	it != ana.end(); 
-	++it ){
-    if ( ana.begin() == it )
-      continue; // start at second
-    string act = it->act;
-    if ( act[0]=='i') { 
+  // We take ONLY the first 'hint' of the inflection to find a new CLEX Type
+  // When applicable, we replace the class from the rule
+  for ( size_t i = 1; i < rule.rules.size(); ++i ){
+    string inf = rule.rules[i].inflect;
+    if ( !inf.empty() && !rule.rules[i].participle ){
       // it is an inflection tag
       if (debugFlag){
-	*Log(mbmaLog) << "act: >" << act << "<" << endl;
-      }	  
+	*Log(mbmaLog) << " inflection: >" << inf << "<" << endl;
+      }
       // given the specific selections of certain inflections,
       //    select a tag!
-      string new_tag = select_tag( act[1] );
-      
+      CLEX::Type new_tag = select_tag( inf[0] );
+
       // apply the change. Remember, the idea is that an inflection is
       // far more certain of the tag of its predecessing morpheme than
-      // the morpheme itself. 
+      // the morpheme itself.
       // This is not always the case, but it works
-      if ( !new_tag.empty() ) {
+      if ( new_tag != CLEX::UNASS ) {
 	if ( debugFlag  ){
-	  *Log(mbmaLog) << act[1] << " selects " << new_tag << endl;
+	  *Log(mbmaLog) << inf[0] << " selects " << new_tag << endl;
 	}
-	// change the previous act
-	if ( basictags.find((it-1)->act[0]) != string::npos ){
-	  if ( debugFlag  ){
-	    *Log(mbmaLog) << "replace " << (it-1)->act[0] << " by " 
-			  << new_tag[0] << endl;
+	// go back to the previous morpheme
+	size_t k = i-1;
+	//	  *Log(mbmaLog) << "een terug is " << rule.rules[k].ResultClass << endl;
+	if ( rule.rules[k].isBasic() ){
+	  // now see if we can replace this class for a better one
+	  if ( rule.rules[k].ResultClass == CLEX::PN &&
+	       new_tag == CLEX::N ){
+	    if ( debugFlag  ){
+	      *Log(mbmaLog) << "Don't replace PN by N" << endl;
+	    }
 	  }
-	  (it-1)->act[0] = new_tag[0];
+	  else {
+	    if ( debugFlag  ){
+	      *Log(mbmaLog) << " replace " << rule.rules[k].ResultClass
+			    << " by " << new_tag << endl;
+	    }
+	    rule.rules[k].ResultClass = new_tag;
+	  }
+	  return;
 	}
       }
     }
   }
 }
 
-MBMAana Mbma::addInflect( const vector<waStruct>& ana,
-			  const string& inflect, 
-			  const vector<string>& morph ){
-  string the_act;
-  vector<waStruct>::const_reverse_iterator it = ana.rbegin();
-  while ( it != ana.rend() ) { 
-    // go back to the last non-inflectional tag 
-    the_act = it->act;
-    if (debugFlag){
-      *Log(mbmaLog) << "examine act " << the_act << endl;
+BracketLeaf::BracketLeaf( const RulePart& p, int flag ):
+  BaseBracket(p.ResultClass, p.RightHand, flag),
+  morph(p.morpheme )
+{
+  ifpos = -1;
+  if ( !p.inflect.empty() ){
+    inflect = p.inflect;
+    if ( p.ResultClass == CLEX::UNASS ){
+      status = INFLECTION;
     }
-    if ( the_act[0] != 'i' ){
-      if (debugFlag){
-	*Log(mbmaLog) << "final tag " << the_act << endl;
+    else {
+      status = INFO;
+    }
+  }
+  else if ( RightHand.size() == 0 ){
+    orig = toString( cls );
+    status = STEM;
+  }
+  else {
+    orig = toString( cls );
+    orig += "_";
+    for ( size_t i = 0; i < RightHand.size(); ++i ){
+      orig += toString(RightHand[i]);
+      if ( RightHand[i] == CLEX::AFFIX )
+	ifpos = i;
+    }
+    status = DERIVATIONAL;
+  }
+}
+
+BracketLeaf::BracketLeaf( CLEX::Type t, const UnicodeString& us, int flag ):
+  BaseBracket( t, vector<CLEX::Type>(), flag ),
+  morph( us )
+{
+  ifpos = -1;
+  orig = toString( t );
+  status = STEM;
+}
+
+BracketNest::~BracketNest(){
+  for ( list<BaseBracket*>::const_iterator it = parts.begin();
+	it != parts.end();
+	++it ){
+    delete *it;
+  }
+}
+
+UnicodeString BaseBracket::put( bool noclass ) const {
+  UnicodeString result = "[err?]";
+  if ( !noclass ){
+    UnicodeString s = UTF8ToUnicode(toString(cls));
+    result += s;
+  }
+  return result;
+}
+
+UnicodeString BracketLeaf::put( bool noclass ) const {
+  UnicodeString result = "[";
+  result += morph;
+  result += "]";
+  if ( !noclass ){
+    if ( orig.empty() )
+      result += UTF8ToUnicode(inflect);
+    else
+      result += UTF8ToUnicode(orig);
+  }
+  return result;
+}
+
+UnicodeString BracketNest::put( bool noclass ) const {
+  UnicodeString result = "[ ";
+  for ( list<BaseBracket*>::const_iterator it = parts.begin();
+	it != parts.end();
+	++it ){
+    result +=(*it)->put(noclass) + " ";
+  }
+  result += "]";
+  if ( !noclass ){
+    if ( cls != CLEX::UNASS )
+      result += UTF8ToUnicode(toString(cls));
+  }
+  return result;
+}
+
+ostream& operator<< ( ostream& os, const BaseBracket& c ){
+  os << c.put();
+  return os;
+}
+
+ostream& operator<< ( ostream& os, const BaseBracket *c ){
+  if ( c ){
+    os << c->put();
+  }
+  else {
+    os << "[EMPTY]";
+  }
+  return os;
+}
+
+UnicodeString BracketNest::deepmorphemes() const{
+  UnicodeString res;
+  for ( list<BaseBracket*>::const_iterator it = parts.begin();
+	it != parts.end();
+	++it ){
+    res += (*it)->deepmorphemes();
+  }
+  return res;
+}
+
+void prettyP( ostream& os, const list<BaseBracket*>& v ){
+  os << "[";
+  for ( list<BaseBracket*>::const_iterator it = v.begin();
+	it != v.end();
+	++it ){
+    os << *it << " ";
+  }
+  os << "]";
+}
+
+bool BracketNest::testMatch( list<BaseBracket*>& result,
+			     const list<BaseBracket*>::iterator& rpos,
+			     list<BaseBracket*>::iterator& bpos ){
+  if ( debugFlag > 5 ){
+    cerr << "test MATCH " << endl;
+  }
+  bpos = result.end();
+  size_t len = (*rpos)->RightHand.size();
+  if ( len == 0 || len > result.size() ){
+    if ( debugFlag > 5 ){
+      cerr << "test MATCH FAIL (no RHS or RHS > result)" << endl;
+    }
+    return false;
+  }
+  size_t fpos = (*rpos)->infixpos();
+  if ( debugFlag > 5 ){
+    cerr << "test MATCH, fpos=" << fpos << " en len=" << len << endl;
+  }
+  list<BaseBracket*>::iterator it = rpos;
+  while ( fpos > 0 ){
+    --fpos;
+    --it;
+  }
+  size_t j = 0;
+  bpos = it;
+  for (; j < len && it != result.end(); ++j, ++it ){
+    if ( debugFlag > 5 ){
+      cerr << "test MATCH vergelijk " << *it << " met " << (*rpos)->RightHand[j] << endl;
+    }
+    if ( (*rpos)->RightHand[j] == CLEX::XAFFIX)
+      continue;
+    else if ( (*rpos)->RightHand[j] == CLEX::AFFIX)
+      continue;
+    else if ( (*rpos)->RightHand[j] != (*it)->tag() ){
+      if ( debugFlag > 5 ){
+	cerr << "test MATCH FAIL (" << (*rpos)->RightHand[j]
+	     << " != " << (*it)->tag() << ")" << endl;
       }
-      break;
+      bpos = it;
+      return false;
+    }
+  }
+  if ( j < len ){
+    if ( debugFlag > 5 ){
+      cerr << "test MATCH FAIL (j < len)" << endl;
+    }
+    bpos = result.end();
+    return false;
+  }
+  if ( debugFlag > 5 ){
+    cerr << "test MATCH OK" << endl;
+  }
+  return true;
+}
+
+
+list<BaseBracket*>::iterator BracketNest::resolveAffix( list<BaseBracket*>& result,
+							const list<BaseBracket*>::iterator& rpos ){
+  if ( debugFlag > 5 ){
+    cerr << "resolve affix" << endl;
+  }
+  list<BaseBracket*>::iterator bit;
+  bool matched = testMatch( result, rpos, bit );
+  if ( matched ){
+    if ( debugFlag > 5 ){
+      cerr << "OK een match" << endl;
+    }
+    size_t len = (*rpos)->RightHand.size();
+    if ( len == result.size() ){
+      // the rule matches exact what we have.
+      // leave it
+      list<BaseBracket*>::iterator it = rpos;
+      return ++it;
+    }
+    else {
+      list<BaseBracket*>::iterator it = bit--;
+      BaseBracket *tmp = new BracketNest( (*rpos)->tag(), debugFlag );
+      for ( size_t j = 0; j < len; ++j ){
+	tmp->append( *it );
+	if ( debugFlag > 5 ){
+	  cerr << "erase " << *it << endl;
+	}
+	it = result.erase(it);
+      }
+      if ( debugFlag > 5 ){
+	cerr << "new node:" << tmp << endl;
+      }
+      result.insert( ++bit, tmp );
+      return bit;
+    }
+  }
+  else {
+    // the affix derivation failed.
+    if ( bit == result.end() ){
+      // no hacks yet
+      bit = rpos;
+      return ++bit;
     }
-    else { 
+    list<BaseBracket*>::iterator it = rpos;
+    if ( debugFlag > 5 ){
+      cerr << "it = " << *it << endl;
+      cerr << "bit = " << *bit << endl;
+    }
+    if ( (*bit)->RightHand.size() > 1 ){
+      if ( debugFlag > 5 ){
+	cerr << "undo splitup case 1" << endl;
+      }
+      // We 'undo' the splitup and construct a leaf with the combined morphemes
+      UnicodeString mor;
+      CLEX::Type tag = (*it)->tag();
+      while ( it != result.end() ){
+	if ( (*it)->inflection() != "" && tag != CLEX::UNASS ){
+	  // so we DO continue when there is inflection and NO tag (like 'pt')
+	  // in : N,0,0,0,pt,0,Q_Q*,0,0,0,0,0/m
+	  break;
+	}
+	if ( debugFlag > 5 ){
+	  cerr << "append:" << *it << endl;
+	}
+	mor += (*it)->morpheme();
+	tag = (*it)->tag(); // remember the 'last' tag
+	if ( debugFlag > 5 ){
+	  cerr << "erase " << *it << endl;
+	}
+	it = result.erase(it);
+      }
+      BaseBracket *tmp = new BracketLeaf( tag, mor, debugFlag );
+      if ( debugFlag > 5 ){
+	cerr << "new node: " << tmp << endl;
+      }
+      result.insert( it, tmp );
+      if ( debugFlag > 5 ){
+	cerr << "result = " << result << endl;
+      }
+      return ++it;
+    }
+    else {
+      if ( debugFlag > 5 ){
+	cerr << "undo splitup case 2" << endl;
+      }
+      // We 'undo' the splitup and construct a leaf with the combined morphemes
+      UnicodeString mor;
+      CLEX::Type tag = (*bit)->tag();
+      ++it;
+      if (  bit == it ){
+	if ( debugFlag > 5 ){
+	  cerr << "escape with result = " << result << endl;
+	}
+	return ++bit;
+      }
+      while ( bit != it ){
+	if ( debugFlag > 5 ){
+	  cerr << "loop :" << *bit << endl;
+	}
+	if ( (*bit)->inflection() != "" && tag != CLEX::UNASS ){
+	  // so we DO continue when there is inflection and NO tag (like 'pt')
+	  // in : N,0,0,0,pt,0,Q_Q*,0,0,0,0,0/m
+	  break;
+	}
+	if ( debugFlag > 5 ){
+	  cerr << "append:" << *bit << " morpheme=" <<  (*bit)->deepmorphemes() << endl;
+	}
+	mor += (*bit)->deepmorphemes();
+	tag = (*bit)->tag(); // remember the 'last' tag
+	if ( debugFlag > 5 ){
+	  cerr << "erase " << *bit << endl;
+	}
+	bit = result.erase(bit);
+      }
+      BaseBracket *tmp = new BracketLeaf( tag, mor, debugFlag );
+      if ( debugFlag > 5 ){
+	cerr << "new node: " << tmp << endl;
+      }
+      result.insert( it, tmp );
+      if ( debugFlag > 5 ){
+	cerr << "result = " << result << endl;
+      }
+      return ++bit;
+    }
+  }
+}
+
+void BracketNest::resolveNouns( ){
+  if ( debugFlag > 5 ){
+    cerr << "resolve NOUNS in:" << this << endl;
+  }
+  list<BaseBracket*>::iterator it = parts.begin();
+  list<BaseBracket*>::iterator prev = it++;
+  while ( it != parts.end() ){
+    if ( (*prev)->tag() == CLEX::N && (*prev)->RightHand.size() == 0
+	 && (*it)->tag() == CLEX::N && (*it)->RightHand.size() == 0 ){
+      BaseBracket *tmp = new BracketNest( CLEX::N, debugFlag );
+      tmp->append( *prev );
+      tmp->append( *it );
+      if ( debugFlag > 5 ){
+	cerr << "current result:" << parts << endl;
+	cerr << "new node:" << tmp << endl;
+	cerr << "erase " << *prev << endl;
+      }
+      prev = parts.erase(prev);
+      if ( debugFlag > 5 ){
+	cerr << "erase " << *prev << endl;
+      }
+      prev = parts.erase(prev);
+      prev = parts.insert( prev, tmp );
+      if ( debugFlag > 5 ){
+	cerr << "current result:" << parts << endl;
+      }
+      it = prev;
+      ++it;
+    }
+    else {
+      prev = it++;
+    }
+  }
+  if ( debugFlag > 5 ){
+    cerr << "resolve NOUNS result:" << this << endl;
+  }
+}
+
+void BracketNest::resolveLead( ){
+  list<BaseBracket*>::iterator it = parts.begin();
+  while ( it != parts.end() ){
+    // search for rules with a * at the begin
+    if ( debugFlag > 5 ){
+      cerr << "search leading *: bekijk: " << *it << endl;
+    }
+    if ( (*it)->isNested() ){
+      if ( debugFlag > 5 ){
+	cerr << "nested! " << endl;
+      }
+      (*it)->resolveLead();
+      ++it;
+    }
+    else {
+      if ( (*it)->infixpos() == 0 ){
+	it = resolveAffix( parts, it );
+      }
+      else {
+	++it;
+      }
+    }
+  }
+}
+
+void BracketNest::resolveTail(){
+  list<BaseBracket *>::iterator it = parts.begin();
+  while ( it != parts.end() ){
+    // search for rules with a * at the end
+    if ( debugFlag > 5 ){
+      cerr << "search trailing *: bekijk: " << *it << endl;
+    }
+    if ( (*it)->isNested() ){
+      if ( debugFlag > 5 ){
+	cerr << "nested! " << endl;
+      }
+      (*it)->resolveTail();
       ++it;
     }
+    else {
+      size_t len = (*it)->RightHand.size();
+      if ( (*it)->infixpos() > 0
+	   && (*it)->infixpos() == signed(len)-1 ){
+	if ( debugFlag > 5 ){
+	  cerr << "found trailing * " << *it << endl;
+	  cerr << "infixpos=" << (*it)->infixpos() << endl;
+	  cerr << "len=" << len << endl;
+	}
+	it = resolveAffix( parts, it );
+      }
+      else {
+	++it;
+      }
+    }
   }
-  string::size_type pos = the_act.find_first_of("_/");
-  string tag;
-  if ( pos != string::npos )
-    tag = the_act.substr( 0, pos );
-  else 
-    tag = the_act;
-  string outTag, descr;
-  map<string,string>::const_iterator tit = tagNames.find( tag ); 
+}
+
+void BracketNest::resolveMiddle(){
+  list<BaseBracket*>::iterator it = parts.begin();
+  while ( it != parts.end() ){
+    // now search for other rules with a * in the middle
+    if ( debugFlag > 5 ){
+      cerr << "hoofd infix loop bekijk: " << *it << endl;
+    }
+    if ( (*it)->isNested() ){
+      if ( debugFlag > 5 ){
+	cerr << "nested! " << endl;
+      }
+      (*it)->resolveMiddle( );
+      ++it;
+    }
+    else {
+      size_t len = (*it)->RightHand.size();
+      if ( (*it)->infixpos() > 0
+	   && (*it)->infixpos() < signed(len)-1 ){
+	it = resolveAffix( parts, it );
+      }
+      else {
+	++it;
+      }
+    }
+  }
+}
+
+CLEX::Type BracketNest::getFinalTag() {
+  // cerr << "get Final Tag from: " << this << endl;
+  cls = CLEX::X;
+  list<BaseBracket*>::const_reverse_iterator it = parts.rbegin();
+  while ( it != parts.rend() ){
+    // cerr << "bekijk: " << *it << endl;
+    if ( (*it)->isNested()
+	 || ( (*it)->inflection().empty()
+	      && !(*it)->morpheme().isEmpty() ) ){
+      cls = (*it)->tag();
+      // cerr << "final tag = " << cls << endl;
+      break;
+    }
+    ++it;
+  }
+  //  cerr << "final tag = X " << endl;
+  return cls;
+}
+
+BracketNest *Rule::resolveBrackets( bool daring, CLEX::Type& tag  ) {
+  if ( debugFlag > 5 ){
+    cerr << "check rule for bracketing: " << this << endl;
+  }
+  BracketNest *brackets = new BracketNest( CLEX::UNASS, debugFlag );
+  for ( size_t k=0; k < rules.size(); ++k ) {
+    // fill a flat result;
+    BracketLeaf *tmp = new BracketLeaf( rules[k], debugFlag );
+    if ( tmp->stat() == STEM && tmp->morpheme().isEmpty() ){
+      delete tmp;
+    }
+    else {
+      brackets->append( tmp );
+    }
+  }
+  if ( debugFlag > 5 ){
+    cerr << "STEP 1:" << brackets << endl;
+  }
+  if ( daring ){
+    brackets->resolveNouns( );
+    if ( debugFlag > 5 ){
+      cerr << "STEP 2:" << brackets << endl;
+    }
+    brackets->resolveLead( );
+    if ( debugFlag > 5 ){
+      cerr << "STEP 3:" << brackets << endl;
+    }
+    brackets->resolveTail( );
+    if ( debugFlag > 5 ){
+      cerr << "STEP 4:" << brackets << endl;
+    }
+    brackets->resolveMiddle();
+  }
+  tag = brackets->getFinalTag();
+  if ( debugFlag > 5 ){
+    cerr << "Final Bracketing:" << brackets << endl;
+  }
+  return brackets;
+}
+
+bool Mbma::performEdits( Rule& rule ){
+  if ( debugFlag){
+    *Log(mbmaLog) << "FOUND rule " << rule << endl;
+  }
+  RulePart *last = 0;
+  for ( size_t k=0; k < rule.rules.size(); ++k ) {
+    RulePart *cur = &rule.rules[k];
+    if ( last == 0 )
+      last = cur;
+    if ( debugFlag){
+      *Log(mbmaLog) << "edit::act=" << cur << endl;
+    }
+    if ( !cur->del.isEmpty() && cur->ins != "eer" ){
+      // sanity check
+      for ( int j=0; j < cur->del.length(); ++j ){
+	if ( rule.rules[k+j].uchar != cur->del[j] ){
+	  UnicodeString tmp(cur->del[j]);
+	  *Log(mbmaLog) << "Hmm: deleting " << cur->del << " is impossible. ("
+			<< rule.rules[k+j].uchar << " != " << tmp
+			<< ")." << endl;
+	  *Log(mbmaLog) << "Reject rule: " << rule << endl;
+	  return false;
+	}
+      }
+    }
+    if ( !cur->participle ){
+      for ( int j=0; j < cur->del.length(); ++j ){
+	rule.rules[k+j].uchar = "";
+      }
+    }
+
+    bool inserted = false;
+    bool e_except = false;
+    if ( cur->isBasic() ){
+      // encountering real POS tag
+      // start a new morpheme, BUT: inserts are appended to the previous one
+      // except for Replace edits, exception on that again: "eer" inserts
+      if ( debugFlag ){
+	*Log(mbmaLog) << "FOUND a basic tag " << cur->ResultClass << endl;
+      }
+      if ( cur->del.isEmpty() || cur->ins == "eer" ){
+	if ( !cur->del.isEmpty() && cur->ins == "eer" ){
+	  if ( debugFlag > 5 ){
+	    *Log(mbmaLog) << "special 'eer' exception." << endl;
+	    *Log(mbmaLog) << rule << endl;
+	  }
+	}
+	if ( cur->ins == "ere" ){
+	  if ( debugFlag > 5 ){
+	    *Log(mbmaLog) << "special 'ere' exception." << endl;
+	    *Log(mbmaLog) << rule << endl;
+	  }
+	  // strange exception
+	  last->morpheme += "er";
+	  e_except = true;
+	}
+	else {
+	  last->morpheme += cur->ins;
+	}
+	inserted = true;
+      }
+      last = cur;
+    }
+    else if ( cur->ResultClass != CLEX::NEUTRAL && !cur->inflect.empty() ){
+      // non 0 inflection starts a new morheme
+      last = cur;
+    }
+    if ( !inserted ){
+      // insert the deletestring :-)
+      last->morpheme += cur->ins;
+    }
+    if ( e_except ) {
+      // fix exception
+      last->morpheme += "e";
+    }
+    last->morpheme += cur->uchar; // might be empty because of deletion
+  }
+  if ( debugFlag ){
+    *Log(mbmaLog) << "edited rule " << rule << endl;
+  }
+  return true;
+}
+
+MBMAana::MBMAana( const Rule& r, bool daring ): rule(r) {
+  CLEX::Type Tag;
+  brackets = rule.resolveBrackets( daring, Tag );
+  infl = rule.getCleanInflect();
+  map<CLEX::Type,string>::const_iterator tit = tagNames.find( Tag );
   if ( tit == tagNames.end() ){
     // unknown tag
-    outTag = "X";
-    descr = "unknown";
+    tag = toString(CLEX::X);
+    description = "unknown";
   }
   else {
-    outTag = tit->first;
-    descr = tit->second;
+    tag = toString(Tag);
+    description = tit->second;
   }
-  if (debugFlag)
-    *Log(mbmaLog) << "added (4) " << outTag << " " << descr << endl;
-  return MBMAana( outTag, inflect, morph, descr );
 }
 
-MBMAana Mbma::inflectAndAffix( const vector<waStruct>& ana ){
-  string inflect;
-  vector<string> morphemes;
-  vector<waStruct>::const_iterator it = ana.begin();
-  while ( it != ana.end() ) { 
-    if ( !it->word.isEmpty() ){
-      morphemes.push_back( UnicodeToUTF8(it->word) );
-    }
-    string this_act= it->act;
-    if (debugFlag)
-      *Log(mbmaLog) << "unpacking act "<< this_act << endl;
-    if ( inflect.empty() && !this_act.empty() &&
-	 this_act.find("_") == string::npos &&
-	 this_act[0]=='i' ){
-      for ( size_t i=1; i< this_act.length(); ++i ) {
-	if (this_act[i]!='/') {
+string Rule::getCleanInflect() const {
+  // get the FIRST inflection and clean it up by extracting only
+  //  known inflection names
+  vector<RulePart>::const_iterator it = rules.begin();
+  while ( it != rules.end() ) {
+    if ( !it->inflect.empty() ){
+      //      cerr << "x inflect:'" << it->inflect << "'" << endl;
+      string inflect;
+      for ( size_t i=0; i< it->inflect.length(); ++i ) {
+	if ( it->inflect[i] != '/' ){
 	  // check if it is a known inflection
-	  map<char,string>::const_iterator csIt = iNames.find(this_act[i]);
+	  //	    cerr << "x bekijk [" << it->inflect[i] << "]" << endl;
+	  map<char,string>::const_iterator csIt = iNames.find(it->inflect[i]);
 	  if ( csIt == iNames.end() ){
-	    if (debugFlag)
-	      *Log(mbmaLog) << "added X 1" << endl;
+	    // cerr << "added unknown inflection X" << endl;
 	    inflect += "X";
 	  }
 	  else {
-	    if (debugFlag)
-	      *Log(mbmaLog) << "added (1) (" << csIt->first << ") " << csIt->second << endl;
-	    inflect += this_act[i];
+	    // cerr << "added known inflection " << csIt->first
+	    // 	 << " (" << csIt->second << ")" << endl;
+	    inflect += it->inflect[i];
 	  }
 	}
       }
-      if ( debugFlag )
-	*Log(mbmaLog) << "found inflection " << inflect << endl;
+      //      cerr << "cleaned inflection " << inflect << endl;
+      return inflect;
     }
-    if (debugFlag)	
-      *Log(mbmaLog) << "morphemes now: |" << morphemes << "|" << endl;
     ++it;
   }
-  if (debugFlag)	
-    *Log(mbmaLog) << "inflectAndAffix: " << inflect << " - " << morphemes << endl;
-  // go back to the last non-inflectional
-  // tag and stick it at the end. 
-  MBMAana retVal = addInflect( ana, inflect, morphemes );
-  if (debugFlag)
-    *Log(mbmaLog) << "Inflection: " << retVal << endl;
-  return retVal;
+  return "";
 }
 
 #define OLD_STEP
 
 #ifdef OLD_STEP
-string find_class( unsigned int step, 
+string find_class( unsigned int step,
 		   const vector<string>& classes,
 		   unsigned int nranal ){
   string result = classes[0];
@@ -572,14 +1347,14 @@ vector<vector<string> > generate_all_perms( const vector<string>& classes ){
   vector<vector<string> > result;
   for ( int step=0; step < largest_anal; ++step ){
     vector<string> item(classParts.size());
-    for ( size_t k=0; k < classParts.size(); ++k ) { 
+    for ( size_t k=0; k < classParts.size(); ++k ) {
       item[k] = find_class( step, classParts[k], largest_anal );
     }
     result.push_back( item );
   }
   return result;
 }
-#else  
+#else
 
 bool next_perm( vector< vector<string>::const_iterator >& its,
 		const vector<vector<string> >& parts ){
@@ -590,14 +1365,14 @@ bool next_perm( vector< vector<string>::const_iterator >& its,
 	return false;
       its[i] = parts[i].begin();
     }
-    else 
+    else
       return true;
   }
   return false;
 }
 
 vector<vector<string> > generate_all_perms( const vector<string>& classes ){
-  
+
   // determine all alternative analyses
   // store every part in a vector of string vectors
   vector<vector<string> > classParts;
@@ -635,11 +1410,16 @@ vector<vector<string> > generate_all_perms( const vector<string>& classes ){
 }
 #endif
 
-void Mbma::execute( const UnicodeString& word, 
-		    const vector<string>& classes ){
-  const string basictags = "NAQVDOBPYIXZ";
+void Mbma::clearAnalysis(){
+  for ( size_t i=0; i < analysis.size(); ++i ){
+    delete analysis[i];
+  }
   analysis.clear();
+}
 
+void Mbma::execute( const UnicodeString& word,
+		    const vector<string>& classes ){
+  clearAnalysis();
   vector<vector<string> > allParts = generate_all_perms( classes );
   if ( debugFlag ){
     string out = "alternatives: word=" + UnicodeToUTF8(word) + ", classes=<";
@@ -648,24 +1428,34 @@ void Mbma::execute( const UnicodeString& word,
     out += ">";
     *Log(mbmaLog) << out << endl;
     *Log(mbmaLog) << "allParts : " << allParts << endl;
-  }    
-  
+  }
+
   // now loop over all the analysis
-  for ( unsigned int step=0; step < allParts.size(); ++step ) { 
-    vector<waStruct> ana = Step1( step, word, allParts, basictags );
-    if (debugFlag)
-      *Log(mbmaLog) << "intermediate analysis 1: " << ana << endl;
-    resolve_inflections( ana, basictags );
-    /* finally, unpack the tag and inflection names to make everything readable */
-    if (debugFlag)
-      *Log(mbmaLog) << "intermediate analysis 3: " << ana << endl;
-    MBMAana tmp = inflectAndAffix( ana );
-    analysis.push_back( tmp );
+  for ( unsigned int step=0; step < allParts.size(); ++step ) {
+    Rule rule( allParts[step], word, debugFlag );
+    if ( performEdits( rule ) ){
+      rule.reduceZeroNodes();
+      if ( debugFlag ){
+	*Log(mbmaLog) << "after reduction: " << rule << endl;
+      }
+      resolve_inflections( rule );
+      if ( debugFlag ){
+	*Log(mbmaLog) << "after resolving: " << rule << endl;
+      }
+      MBMAana *tmp = new MBMAana( rule, doDaring );
+      if ( debugFlag ){
+	*Log(mbmaLog) << "1 added Inflection: " << tmp << endl;
+      }
+      analysis.push_back( tmp );
+    }
+    else if ( debugFlag ){
+      *Log(mbmaLog) << "rejected rule: " << rule << endl;
+    }
   }
 }
 
-void Mbma::addAltMorph( Word *word, 
-			const vector<string>& lemmas ) const {
+void Mbma::addAltMorph( Word *word,
+			const vector<string>& morphs ) const {
   Alternative *alt = new Alternative();
   MorphologyLayer *ml = new MorphologyLayer();
 #pragma omp critical(foliaupdate)
@@ -673,48 +1463,322 @@ void Mbma::addAltMorph( Word *word,
     alt->append( ml );
     word->append( alt );
   }
-  addMorph( ml, lemmas );
+  addMorph( ml, morphs );
+}
+
+void Mbma::addMorph( Word *word,
+		     const vector<string>& morphs ) const {
+  MorphologyLayer *ml = new MorphologyLayer();
+#pragma omp critical(foliaupdate)
+  {
+    word->append( ml );
+  }
+  addMorph( ml, morphs );
+}
+
+void Mbma::addBracketMorph( Word *word,
+			    const string& wrd,
+			    const string& tag ) const {
+  //  *Log(mbmaLog) << "addBracketMorph(" << wrd << "," << tag << ")" << endl;
+  MorphologyLayer *ml = new MorphologyLayer();
+#pragma omp critical(foliaupdate)
+  {
+    word->append( ml );
+  }
+  KWargs args;
+  args["class"] = "stem";
+  Morpheme *result = new Morpheme( word->doc(), args );
+  args.clear();
+  args["value"] = wrd;
+  args["offset"] = "0";
+  TextContent *t = new TextContent( args );
+#pragma omp critical(foliaupdate)
+  {
+    result->append( t );
+  }
+  args.clear();
+  args["value"] =  "[" + wrd + "]";
+  Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+  {
+    result->append( d );
+  }
+  args.clear();
+  args["set"] = clex_tagset;
+  args["cls"] = tag;
+#pragma omp critical(foliaupdate)
+  {
+    result->addPosAnnotation( args );
+  }
+#pragma omp critical(foliaupdate)
+  {
+    ml->append( result );
+  }
 }
 
-void Mbma::addMorph( Word *word, 
-		     const vector<string>& lemmas ) const {
+void Mbma::addBracketMorph( Word *word,
+			    const BracketNest *brackets ) const {
   MorphologyLayer *ml = new MorphologyLayer();
 #pragma omp critical(foliaupdate)
   {
     word->append( ml );
   }
-  addMorph( ml, lemmas );
+  Morpheme *m = brackets->createMorpheme( word->doc(), clex_tagset );
+  if ( m ){
+#pragma omp critical(foliaupdate)
+    {
+      ml->append( m );
+    }
+  }
 }
 
-void Mbma::addMorph( MorphologyLayer *ml, 
-		     const vector<string>& lemmas ) const {
+void Mbma::addAltBracketMorph( Word *word,
+			       const BracketNest *brackets ) const {
+  Alternative *alt = new Alternative();
+  MorphologyLayer *ml = new MorphologyLayer();
+#pragma omp critical(foliaupdate)
+  {
+    alt->append( ml );
+    word->append( alt );
+  }
+  Morpheme *m = brackets->createMorpheme( word->doc(), clex_tagset );
+  if ( m ){
+#pragma omp critical(foliaupdate)
+    {
+      ml->append( m );
+    }
+  }
+}
+
+Morpheme *BracketLeaf::createMorpheme( Document *doc,
+				       const string& tagset ) const {
+  string desc;
+  int offset = 0;
+  return createMorpheme( doc, tagset, offset, desc );
+}
+
+Morpheme *BracketLeaf::createMorpheme( Document *doc,
+				       const string& tagset,
+				       int& offset,
+				       string& desc ) const {
+  Morpheme *result = 0;
+  desc.clear();
+  if ( status == STEM ){
+    KWargs args;
+    args["class"] = "stem";
+    result = new Morpheme( doc, args );
+    args.clear();
+    string out = UnicodeToUTF8(morph);
+    args["value"] = out;
+    args["offset"] = toString(offset);
+    offset += out.length();
+    TextContent *t = new TextContent( args );
+#pragma omp critical(foliaupdate)
+    {
+      result->append( t );
+    }
+    args.clear();
+    desc = "[" + out + "]";
+    args["value"] = desc;
+    Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+    {
+      result->append( d );
+    }
+    args.clear();
+    args["set"]  = tagset;
+    args["cls"] = toString( tag() );
+#pragma omp critical(foliaupdate)
+    {
+      result->addPosAnnotation( args );
+    }
+  }
+  else if ( status == INFLECTION ){
+    KWargs args;
+    args["class"] = "inflection";
+    result = new Morpheme( doc, args );
+    args.clear();
+    string out = UnicodeToUTF8(morph);
+    if ( out.empty() )
+      out = inflect;
+    else
+      desc = "[" + out + "]";
+    args["value"] = out;
+    args["offset"] = toString(offset);
+    TextContent *t = new TextContent( args );
+    offset += out.length();
+#pragma omp critical(foliaupdate)
+    {
+      result->append( t );
+    }
+    args.clear();
+    string inf_desc;
+    for ( size_t i=0; i < inflect.size(); ++i ){
+      string d = iNames[inflect[i]];
+      if ( i > 0 )
+	inf_desc += ", ";
+      inf_desc += d;
+    }
+    args.clear();
+    args["value"] = inf_desc;
+    Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+    {
+      result->append( d );
+    }
+  }
+  else if ( status == DERIVATIONAL ){
+    KWargs args;
+    args["class"] = "derivational";
+    result = new Morpheme( doc, args );
+    args.clear();
+    string out = UnicodeToUTF8(morph);
+    args["value"] = out;
+    args["offset"] = toString(offset);
+    TextContent *t = new TextContent( args );
+    offset += out.length();
+#pragma omp critical(foliaupdate)
+    {
+      result->append( t );
+    }
+    args.clear();
+    desc = "[" + out + "]";
+    args["value"] = desc;
+    Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+    {
+      result->append( d );
+    }
+    args.clear();
+    args["set"]  = tagset;
+    args["cls"]  = orig;
+#pragma omp critical(foliaupdate)
+    {
+      result->addPosAnnotation( args );
+    }
+  }
+  else {
+    KWargs args;
+    args["class"] = "inflection";
+    result = new Morpheme( doc, args );
+    string inf_desc;
+    for ( size_t i=0; i < inflect.size(); ++i ){
+      string d = iNames[inflect[i]];
+      if ( i > 0 )
+	inf_desc += ", ";
+      inf_desc += d;
+    }
+    args.clear();
+    args["value"] = inf_desc;
+    Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+    {
+      result->append( d );
+    }
+  }
+  return result;
+}
+
+Morpheme *BracketNest::createMorpheme( Document *doc,
+				       const string& tagset ) const {
+  string desc;
+  int offset = 0;
+  return createMorpheme( doc, tagset, offset, desc );
+}
+
+Morpheme *BracketNest::createMorpheme( Document *doc,
+				       const string& tagset,
+				       int& of,
+				       string& desc ) const {
+  KWargs args;
+  args["class"] = "complex";
+  Morpheme *result = new Morpheme( doc, args );
+  list<BaseBracket*>::const_iterator it = parts.begin();
+  string mor;
+  int cnt = 0;
+  desc.clear();
+  vector<Morpheme*> stack;
+  int offset = 0;
+  while ( it != parts.end() ){
+    string deeper_desc;
+    Morpheme *m = (*it)->createMorpheme( doc, tagset, offset, deeper_desc );
+    if ( m ){
+      string tmp;
+      try {
+	tmp = m->str();
+      }
+      catch (...){
+      };
+      if ( !tmp.empty() ){
+	mor += tmp;
+	desc += deeper_desc;
+	++cnt;
+      }
+      stack.push_back( m );
+    }
+    ++it;
+  }
+  args.clear();
+  args["value"] = mor;
+  args["offset"] = toString(of);
+  of += offset;
+  TextContent *t = new TextContent( args );
+#pragma omp critical(foliaupdate)
+  {
+    result->append( t );
+  }
+  args.clear();
+  if ( cnt > 1 )
+    desc = "[" + desc + "]";
+  args["value"] = desc;
+  Description *d = new Description( args );
+#pragma omp critical(foliaupdate)
+  {
+    result->append( d );
+  }
+  args.clear();
+  args["set"]  = tagset;
+  args["cls"]  = toString( tag() );
+#pragma omp critical(foliaupdate)
+  {
+    result->addPosAnnotation( args );
+  }
+#pragma omp critical(foliaupdate)
+  for ( size_t i=0; i < stack.size(); ++i ){
+    result->append( stack[i] );
+  }
+  return result;
+}
+
+void Mbma::addMorph( MorphologyLayer *ml,
+		     const vector<string>& morphs ) const {
   int offset = 0;
-  for ( size_t p=0; p < lemmas.size(); ++p ){
+  for ( size_t p=0; p < morphs.size(); ++p ){
     Morpheme *m = new Morpheme();
 #pragma omp critical(foliaupdate)
     {
       ml->append( m );
     }
     KWargs args;
-    args["value"] = lemmas[p];
+    args["value"] = morphs[p];
     args["offset"] = toString(offset);
     TextContent *t = new TextContent( args );
-    offset += lemmas[p].length();
+    offset += morphs[p].length();
 #pragma omp critical(foliaupdate)
     {
       m->append( t );
     }
   }
-}	  
+}
 
 void Mbma::filterTag( const string& head,  const vector<string>& feats ){
   // first we select only the matching heads
   if (debugFlag){
-    *Log(mbmaLog) << "filter with tag, head: " << head 
+    *Log(mbmaLog) << "filter with tag, head: " << head
 		  << " feats: " << feats << endl;
     *Log(mbmaLog) << "filter:start, analysis is:" << endl;
     int i=1;
-    for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
+    for(vector<MBMAana*>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
       *Log(mbmaLog) << i++ << " - " << *it << endl;
   }
   map<string,string>::const_iterator tagIt = TAGconv.find( head );
@@ -725,31 +1789,33 @@ void Mbma::filterTag( const string& head,  const vector<string>& feats ){
   if (debugFlag){
     *Log(mbmaLog) << "#matches: " << tagIt->first << " " << tagIt->second << endl;
   }
-  vector<MBMAana>::iterator ait = analysis.begin();
+  vector<MBMAana*>::iterator ait = analysis.begin();
   while ( ait != analysis.end() ){
-    if ( tagIt->second == ait->getTag() ) {
+    string tagI = (*ait)->getTag();
+    if ( tagIt->second == tagI || ( tagIt->second == "N" && tagI == "PN" ) ){
       if (debugFlag)
-	*Log(mbmaLog) << "comparing " << tagIt->second << " with " 
-		      << ait->getTag() << " (OK)" << endl;
+	*Log(mbmaLog) << "comparing " << tagIt->second << " with "
+		      << tagI << " (OK)" << endl;
       ait++;
     }
     else {
       if (debugFlag)
-	*Log(mbmaLog) << "comparing " << tagIt->second << " with " 
-		      << ait->getTag() << " (rejected)" << endl;
+	*Log(mbmaLog) << "comparing " << tagIt->second << " with "
+		      << tagI << " (rejected)" << endl;
+      delete *ait;
       ait = analysis.erase( ait );
     }
   }
   if (debugFlag){
     *Log(mbmaLog) << "filter: analysis after first step" << endl;
     int i=1;
-    for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
+    for(vector<MBMAana*>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
       *Log(mbmaLog) << i++ << " - " << *it << endl;
   }
 
   if ( analysis.size() < 1 ){
     if (debugFlag ){
-      *Log(mbmaLog) << "analysis has size: " << analysis.size() 
+      *Log(mbmaLog) << "analysis has size: " << analysis.size()
 		    << " so skip next filter" << endl;
     }
     return;
@@ -760,11 +1826,11 @@ void Mbma::filterTag( const string& head,  const vector<string>& feats ){
   // find best match
   // loop through all subfeatures of the tag
   // and match with inflections from each m
-  set<const MBMAana *> bestMatches;
+  set<MBMAana *> bestMatches;
   int max_count = 0;
   for ( size_t q=0; q < analysis.size(); ++q ) {
     int match_count = 0;
-    string inflection = analysis[q].getInflection();
+    string inflection = analysis[q]->getInflection();
     if (debugFlag){
       *Log(mbmaLog) << "matching " << inflection << " with " << feats << endl;
     }
@@ -790,13 +1856,13 @@ void Mbma::filterTag( const string& head,  const vector<string>& feats ){
 	max_count = match_count;
 	bestMatches.clear();
       }
-      bestMatches.insert(&analysis[q]);
+      bestMatches.insert(analysis[q]);
     }
   }
   // so now we have "the" best matches.
   // Weed the rest
-  vector<const MBMAana*> res;
-  set<const MBMAana*>::const_iterator bit = bestMatches.begin();
+  vector<MBMAana*> res;
+  set<MBMAana*>::const_iterator bit = bestMatches.begin();
   while ( bit != bestMatches.end() ){
     res.push_back( *bit );
     ++bit;
@@ -804,36 +1870,46 @@ void Mbma::filterTag( const string& head,  const vector<string>& feats ){
   if (debugFlag){
     *Log(mbmaLog) << "filter: analysis after second step" << endl;
     int i=1;
-    for(vector<const MBMAana*>::const_iterator it=res.begin(); it != res.end(); it++)
+    for(vector<MBMAana*>::const_iterator it=res.begin(); it != res.end(); it++)
       *Log(mbmaLog) << i++ << " - " <<  *it << endl;
     *Log(mbmaLog) << "start looking for doubles" << endl;
   }
   //
   // but now we still might have doubles
   //
-  map<string, const MBMAana*> unique;
-  vector<const MBMAana*>::iterator it=res.begin();
+  map<string, MBMAana*> unique;
+  vector<MBMAana*>::iterator it=res.begin();
   while (  it != res.end() ){
-    vector<string> v = (*it)->getMorph();
     string tmp;
-    // create an unique key
-    for ( size_t p=0; p < v.size(); ++p ) {
-      tmp += v[p] + "+";
+    if ( doDaring ){
+      stringstream ss;
+      ss << (*it)->getBrackets() << endl;
+      tmp = ss.str();
+    }
+    else {
+      vector<string> v = (*it)->getMorph();
+      // create an unique key
+      for ( size_t p=0; p < v.size(); ++p ) {
+	tmp += v[p] + "+";
+      }
     }
     unique[tmp] = *it;
     ++it;
   }
-  vector<MBMAana> result;
-  map<string, const MBMAana*>::const_iterator uit=unique.begin();
+  vector<MBMAana*> result;
+  map<string, MBMAana*>::const_iterator uit=unique.begin();
   while ( uit != unique.end() ){
-    result.push_back( *(uit->second) );
+    result.push_back( uit->second );
+    if (debugFlag){
+      *Log(mbmaLog) << "Final Bracketing: " << uit->second->getBrackets() << endl;
+    }
     ++uit;
   }
   analysis = result;
   if (debugFlag){
     *Log(mbmaLog) << "filter: definitive analysis:" << endl;
     int i=1;
-    for(vector<MBMAana>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
+    for(vector<MBMAana*>::const_iterator it=analysis.begin(); it != analysis.end(); it++)
       *Log(mbmaLog) << i++ << " - " << *it << endl;
     *Log(mbmaLog) << "done filtering" << endl;
   }
@@ -842,33 +1918,49 @@ void Mbma::filterTag( const string& head,  const vector<string>& feats ){
 
 void Mbma::getFoLiAResult( Word *fword, const UnicodeString& uword ) const {
   if ( analysis.size() == 0 ){
-    // fallback option: use the lowercased word and pretend it's a lemma ;-)
-    UnicodeString word = uword;
-    word.toLower();
+    // fallback option: use the word and pretend it's a morpheme ;-)
     if ( debugFlag ){
-      *Log(mbmaLog) << "no matches found, use the word instead: " 
-		    << word << endl;
+      *Log(mbmaLog) << "no matches found, use the word instead: "
+		    << uword << endl;
+    }
+    if ( doDaring ){
+      addBracketMorph( fword, UnicodeToUTF8(uword), "UNK" );
+    }
+    else {
+      vector<string> tmp;
+      tmp.push_back( UnicodeToUTF8(uword) );
+      addMorph( fword, tmp );
     }
-    vector<string> tmp;
-    tmp.push_back( UnicodeToUTF8(word) );
-    addMorph( fword, tmp );
   }
   else {
-    vector<MBMAana>::const_iterator sit = analysis.begin();
+    vector<MBMAana*>::const_iterator sit = analysis.begin();
     while( sit != analysis.end() ){
-      if ( sit == analysis.begin() )
-	addMorph( fword, sit->getMorph() );
-      else
-	addAltMorph( fword, sit->getMorph() );
+      if ( sit == analysis.begin() ){
+	if ( doDaring )
+	  addBracketMorph( fword, (*sit)->getBrackets() );
+	else
+	  addMorph( fword, (*sit)->getMorph() );
+      }
+      else {
+	if ( doDaring )
+	  addAltBracketMorph( fword, (*sit)->getBrackets() );
+	else
+	  addAltMorph( fword, (*sit)->getMorph() );
+      }
       ++sit;
     }
   }
 }
-  
+
 void Mbma::addDeclaration( Document& doc ) const {
   doc.declare( AnnotationType::MORPHOLOGICAL, tagset,
-	       "annotator='frog-mbma-" +  version + 
+	       "annotator='frog-mbma-" +  version +
 	       + "', annotatortype='auto', datetime='" + getTime() + "'");
+  if ( doDaring ){
+    doc.declare( AnnotationType::POS, clex_tagset,
+		 "annotator='frog-mbma-" +  version +
+		 + "', annotatortype='auto', datetime='" + getTime() + "'");
+  }
 }
 
 UnicodeString Mbma::filterDiacritics( const UnicodeString& in ) const {
@@ -887,19 +1979,36 @@ void Mbma::Classify( Word* sword ){
   UnicodeString uWord;
   PosAnnotation *pos;
   string head;
+  string token_class;
 #pragma omp critical(foliaupdate)
   {
     uWord = sword->text();
     pos = sword->annotation<PosAnnotation>( cgn_tagset );
     head = pos->feat("head");
+    token_class = sword->cls();
   }
-  if ( head == "SPEC" || head == "LET" ){
+  if (debugFlag)
+    *Log(mbmaLog) << "Classify " << uWord << "(" << pos << ") ["
+		  << token_class << "]" << endl;
+  if ( filter )
+    uWord = filter->filter( uWord );
+  if ( head == "LET" || head == "SPEC" ){
+    // take over the letter/word 'as-is'.
     string word = UnicodeToUTF8( uWord );
-    vector<string> tmp;
-    tmp.push_back( word );
-    addMorph( sword, tmp );
+    if ( doDaring ){
+      addBracketMorph( sword, word, head );
+    }
+    else {
+      vector<string> tmp;
+      tmp.push_back( word );
+      addMorph( sword, tmp );
+    }
   }
   else {
+    UnicodeString lWord = uWord;
+    if ( head != "SPEC" )
+      lWord.toLower();
+    Classify( lWord );
     vector<string> featVals;
 #pragma omp critical(foliaupdate)
     {
@@ -907,47 +2016,50 @@ void Mbma::Classify( Word* sword ){
       for ( size_t i = 0; i < feats.size(); ++i )
 	featVals.push_back( feats[i]->cls() );
     }
-    Classify( uWord );
     filterTag( head, featVals );
-    getFoLiAResult( sword, uWord );
+    getFoLiAResult( sword, lWord );
   }
 }
 
 void Mbma::Classify( const UnicodeString& word ){
-  UnicodeString uWord = word;
-  uWord.toLower();
-  uWord = filterDiacritics( uWord );
-  if (debugFlag)
-    *Log(mbmaLog) << "Classify word: " << uWord << endl;
-  
+  UnicodeString uWord = filterDiacritics( word );
   vector<string> insts = make_instances( uWord );
   vector<string> classes;
   for( size_t i=0; i < insts.size(); ++i ) {
     string ans;
     MTree->Classify( insts[i], ans );
     if ( debugFlag ){
-      *Log(mbmaLog) << "itt #" << i << ": timbl gave class= " << ans 
-		    << ", it matched at depth=" << MTree->matchDepth() << endl; 
+      *Log(mbmaLog) << "itt #" << i << " " << insts[i] << " ==> " << ans
+		    << ", depth=" << MTree->matchDepth() << endl;
     }
     classes.push_back( ans);
   }
-  
+
   // fix for 1st char class ==0
   if ( classes[0] == "0" )
-    classes[0] = "X";  
+    classes[0] = "X";
   execute( uWord, classes );
 }
 
 vector<vector<string> > Mbma::getResult() const {
   vector<vector<string> > result;
-  for (vector<MBMAana>::const_iterator it=analysis.begin(); 
-       it != analysis.end(); 
+  for (vector<MBMAana*>::const_iterator it=analysis.begin();
+       it != analysis.end();
        it++ ){
-    vector<string> mors = it->getMorph();
-    if ( debugFlag ){
-      *Log(mbmaLog) << "Morphs " << mors << endl;
+    if ( doDaring ){
+      stringstream ss;
+      ss << (*it)->getBrackets()->put( true ) << endl;
+      vector<string> mors;
+      mors.push_back( ss.str() );
+      result.push_back( mors );
+    }
+    else {
+      vector<string> mors = (*it)->getMorph();
+      if ( debugFlag ){
+	*Log(mbmaLog) << "Morphs " << mors << endl;
+      }
+      result.push_back( mors );
     }
-    result.push_back( mors );
   }
   if ( debugFlag ){
     *Log(mbmaLog) << "result of morph analyses: " << result << endl;
@@ -956,17 +2068,15 @@ vector<vector<string> > Mbma::getResult() const {
 }
 
 ostream& operator<< ( ostream& os, const MBMAana& a ){
-  os << "tag: " << a.tag << " infl:" << a.infl << " morhemes: " 
-     << a.morphemes << " description: " << a.description;
+  os << "tag: " << a.tag << " infl:" << a.infl << " morhemes: "
+     << a.rule.extract_morphemes() << " description: " << a.description;
   return os;
 }
 
 ostream& operator<< ( ostream& os, const MBMAana *a ){
   if ( a )
     os << *a;
-  else 
+  else
     os << "no-mbma";
   return os;
 }
-
-
diff --git a/src/mbma_prog.cxx b/src/mbma_prog.cxx
index d28d89b..da62381 100644
--- a/src/mbma_prog.cxx
+++ b/src/mbma_prog.cxx
@@ -2,11 +2,11 @@
   $Id:$
   $URL:$
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Morphological-Analyzer for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -50,7 +50,6 @@ using namespace Timbl;
 
 LogStream my_default_log( cerr, "", StampMessage ); // fall-back
 LogStream *theErrLog = &my_default_log;  // fill the externals
-int tpDebug = 0; //0 for none, more for more output
 
 string TestFileName;
 string ProgName;
@@ -71,6 +70,7 @@ void usage( ) {
        << "\t============= OTHER OPTIONS ============================================\n"
        << "\t -h. give some help.\n"
        << "\t -V or --version .   Show version info.\n"
+       << "\t --daring=<true|false>. Default false\n"
        << "\t -d <debug level>    (for more verbosity)\n";
 }
 
@@ -127,10 +127,16 @@ bool parse_args( TimblOpts& Opts ) {
     doAll = true;
     Opts.Delete('a');
   };
+  if ( Opts.Find( "daring", value, mood )) {
+    if ( value.empty() )
+      value = "1";
+    configuration.setatt( "daring", value, "mbma" );
+    Opts.Delete("daring");
+  };
   return true;
 }
 
-bool init(){  
+bool init(){
   // for some modules init can take a long time
   // so first make sure it will not fail on some trivialities
   //
@@ -153,29 +159,40 @@ bool init(){
 void Test( istream& in ){
   string line;
   while ( getline( in, line ) ){
+    line = TiCC::trim( line );
+    if ( line.empty() )
+      continue;
+    cerr << "processing: " << line << endl;
     vector<string> sentences = tokenizer.tokenize( line );
     for ( size_t s=0; s < sentences.size(); ++s ){
       vector<TagResult> tagv = tagger.tagLine(sentences[s]);
       for ( size_t w=0; w < tagv.size(); ++w ){
 	UnicodeString uWord = folia::UTF8ToUnicode(tagv[w].word());
+	vector<string> v;
+	size_t num = TiCC::split_at_first_of( tagv[w].assignedTag(),
+					      v, "(,)" );
+	if ( num < 1 ){
+	  throw runtime_error( "error: tag not in right format " );
+	}
+	string head = v[0];
+	if ( head != "SPEC" )
+	  uWord.toLower();
 	myMbma.Classify( uWord );
 	if ( !doAll ){
-	  vector<string> v;
-	  size_t num = TiCC::split_at_first_of( tagv[w].assignedTag(), 
-						 v, "(,)" );
-	  if ( num < 1 ){
-	    throw runtime_error( "error: tag not in right format " );    
-	  }
-	  string head = v[0];
 	  v.erase(v.begin());
 	  myMbma.filterTag( head, v );
 	}
 	vector<vector<string> > res = myMbma.getResult();
 	cout << tagv[w].word() << " {" << tagv[w].assignedTag() << "}\t";
-	for ( size_t i=0; i < res.size(); ++i ){
-	  cout << res[i];
-	  if ( i < res.size()-1 )
-	    cout << "/";
+	if ( res.size() == 0 ){
+	  cout << "[" << uWord << "]";
+	}
+	else {
+	  for ( size_t i=0; i < res.size(); ++i ){
+	    cout << res[i];
+	    if ( i < res.size()-1 )
+	      cout << "/";
+	  }
 	}
 	cout << endl;
       }
@@ -189,7 +206,7 @@ void Test( istream& in ){
 
 int main(int argc, char *argv[]) {
   std::ios_base::sync_with_stdio(false);
-  cerr << "mbma " << VERSION << " (c) ILK 1998 - 2013" << endl;
+  cerr << "mbma " << VERSION << " (c) ILK 1998 - 2014" << endl;
   cerr << "Induction of Linguistic Knowledge Research Group, Tilburg University" << endl;
   ProgName = argv[0];
   cerr << "based on [" << Timbl::VersionName() << "]" << endl;
@@ -203,6 +220,7 @@ int main(int argc, char *argv[]) {
       }
       ifstream in(TestFileName.c_str() );
       if ( in.good() ){
+	cerr << "Processing: " << TestFileName << endl;
 	Test( in );
       }
       else {
diff --git a/src/mwu_chunker_mod.cxx b/src/mwu_chunker_mod.cxx
index f98c9d0..0dc5089 100755
--- a/src/mwu_chunker_mod.cxx
+++ b/src/mwu_chunker_mod.cxx
@@ -1,8 +1,8 @@
 /*
-  $Id: mwu_chunker_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: mwu_chunker_mod.cxx 17486 2014-08-06 14:47:38Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/mwu_chunker_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   This file is part of frog.
@@ -14,12 +14,12 @@
 
   frog is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- 
+
   For questions and suggestions, see:
       http://ilk.uvt.nl/software.html
   or send mail to:
@@ -59,7 +59,7 @@ mwuAna::mwuAna( Word *fwrd ){
     }
   }
   fwords.push_back( fwrd );
-}  
+}
 
 void mwuAna::merge( const mwuAna *add ){
   fwords.push_back( add->fwords[0] );
@@ -72,12 +72,15 @@ EntitiesLayer *mwuAna::addEntity( const std::string& tagset,
     if ( el == 0 ){
 #pragma omp critical(foliaupdate)
       {
-	el = new EntitiesLayer();
+	KWargs args;
+	args["generate_id"] = sent->id();
+	el = new EntitiesLayer(sent->doc(),args);
 	sent->append( el );
       }
     }
     KWargs args;
     args["set"] = tagset;
+    args["generate_id"] = el->id();
     Entity *e=0;
 #pragma omp critical(foliaupdate)
     {
@@ -98,7 +101,7 @@ Mwu::Mwu(){
   mwuLog = new LogStream( theErrLog, "mwu-" );
 }
 
-Mwu::~Mwu(){ 
+Mwu::~Mwu(){
   reset();
   delete mwuLog;
 }
@@ -137,14 +140,18 @@ bool Mwu::read_mwus( const string& fname) {
   }
   return true;
 }
-  
+
 bool Mwu::init( const Configuration& config ) {
   *Log(mwuLog) << "initiating mwuChunker..." << endl;
-  debug = tpDebug;
+  debug = 0;
   string val = config.lookUp( "debug", "mwu" );
-  if ( !val.empty() )
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
     debug = TiCC::stringTo<int>( val );
-  val = config.lookUp( "t", "mwu" );  
+  }
+  val = config.lookUp( "t", "mwu" );
   if ( val.empty() ){
     *Log(mwuLog) << "cannot find attribute 't' in configfile" << endl;
     return false;
@@ -178,7 +185,7 @@ ostream &operator <<( ostream& os,
 }
 
 void Mwu::addDeclaration( Document& doc ) const {
-  doc.declare( AnnotationType::ENTITY, 
+  doc.declare( AnnotationType::ENTITY,
 	       tagset,
 	       "annotator='frog-mwu-" + version
 	       + "', annotatortype='auto', datetime='" + getTime() + "'");
@@ -209,7 +216,7 @@ void Mwu::Classify(){
   mymap2::iterator best_match;
   size_t matchLength = 0;
   size_t max = mWords.size();
-  
+
   // add all current sequences of SPEC(deeleigen) words to MWUs
   for( size_t i=0; i < max-1; ++i ) {
     if ( mWords[i]->isSpec() && mWords[i+1]->isSpec() ) {
@@ -223,7 +230,7 @@ void Mwu::Classify(){
       MWUs.insert( make_pair(key, newmwu) );
     }
   }
-  size_t i; 
+  size_t i;
   for( i = 0; i < max; i++) {
     string word = mWords[i]->getWord();
     if ( debug )
@@ -244,7 +251,7 @@ void Mwu::Classify(){
 	for(; i + j + 1 < max && j < max_match; j++) {
 	  if ( match[j] != mWords[i+j+1]->getWord() ) {
 	    if ( debug )
-	      *Log(mwuLog) << "match " << j <<" (" << match[j] 
+	      *Log(mwuLog) << "match " << j <<" (" << match[j]
 		   << ") doesn't match with word " << i+ j + 1
 			   << " (" << mWords[i+j + 1]->getWord() <<")" << endl;
 	    // mismatch in jth word of current mwu
@@ -252,7 +259,7 @@ void Mwu::Classify(){
 	  }
 	  else if ( debug )
 	    *Log(mwuLog) << " matched " <<  mWords[i+j+1]->getWord() << " j=" << j << endl;
-	  
+
 	}
 	if (j == max_match && j > matchLength ){
 	  // a match. remember this!
@@ -268,12 +275,12 @@ void Mwu::Classify(){
 	  *Log(mwuLog) <<"MWU: no match" << endl;
 	}
       }
-      // we found a matching mwu, break out of loop thru sentence, 
+      // we found a matching mwu, break out of loop thru sentence,
       // do useful stuff, and recurse to find more mwus
       if (matchLength > 0 )
 	break;
     } //match found
-    else { 
+    else {
       if( debug )
 	*Log(mwuLog) <<"MWU:check: no match" << endl;
     }
@@ -293,7 +300,7 @@ void Mwu::Classify(){
     if ( debug ){
       *Log(mwuLog) << "tussenstand:" << endl;
       *Log(mwuLog) << *this << endl;
-    }      
+    }
     Classify( );
   } //if (matchLength)
   return;
diff --git a/src/ner_tagger_mod.cxx b/src/ner_tagger_mod.cxx
index a9d8e95..56dc9b9 100644
--- a/src/ner_tagger_mod.cxx
+++ b/src/ner_tagger_mod.cxx
@@ -1,12 +1,12 @@
 /*
-  $Id: ner_tagger_mod.cxx 15912 2013-04-03 14:04:30Z sloot $
+  $Id: ner_tagger_mod.cxx 17486 2014-08-06 14:47:38Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/ner_tagger_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -44,12 +44,15 @@ NERTagger::~NERTagger(){
   delete tagger;
   delete nerLog;
 }
- 
-bool NERTagger::init( const Configuration& conf ){
-  debug = tpDebug;
-  string db = conf.lookUp( "debug", "NER" );
-  if ( !db.empty() )
-    debug = TiCC::stringTo<int>( db );
+
+bool NERTagger::init( const Configuration& config ){
+  string val = config.lookUp( "debug", "NER" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
+  }
+  if ( !val.empty() ){
+    debug = TiCC::stringTo<int>( val );
+  }
   switch ( debug ){
   case 0:
   case 1:
@@ -67,14 +70,14 @@ bool NERTagger::init( const Configuration& conf ){
     break;
   default:
     nerLog->setlevel(LogExtreme);
-  }    
-  if (debug) 
+  }
+  if (debug)
     *Log(nerLog) << "NER Tagger Init" << endl;
   if ( tagger != 0 ){
     *Log(nerLog) << "NER Tagger is already initialized!" << endl;
     return false;
-  }  
-  string val = conf.lookUp( "settings", "NER" );
+  }
+  val = config.lookUp( "settings", "NER" );
   if ( val.empty() ){
     *Log(nerLog) << "Unable to find settings for NER" << endl;
     return false;
@@ -83,15 +86,15 @@ bool NERTagger::init( const Configuration& conf ){
   if ( val[0] == '/' ) // an absolute path
     settings = val;
   else
-    settings =  configuration.configDir() + val;
+    settings = config.configDir() + val;
 
-  val = conf.lookUp( "version", "NER" );
+  val = config.lookUp( "version", "NER" );
   if ( val.empty() ){
     version = "1.0";
   }
   else
     version = val;
-  val = conf.lookUp( "set", "NER" );
+  val = config.lookUp( "set", "NER" );
   if ( val.empty() ){
     tagset = "http://ilk.uvt.nl/folia/sets/frog-ner-nl";
   }
@@ -103,7 +106,7 @@ bool NERTagger::init( const Configuration& conf ){
   return tagger->isInit();
 }
 
-static void addEntity( EntitiesLayer *entities, 
+static void addEntity( EntitiesLayer *entities,
 		       const string& tagset,
 		       const vector<Word*>& words,
 		       const vector<double>& confs,
@@ -115,6 +118,7 @@ static void addEntity( EntitiesLayer *entities,
   args["class"] = NER;
   args["confidence"] =  toString(c);
   args["set"] = tagset;
+  args["generate_id"] = entities->id();
   Entity *e = 0;
 #pragma omp critical(foliaupdate)
   {
@@ -142,7 +146,9 @@ void NERTagger::addNERTags( const vector<Word*>& words,
       el = sent->annotation<EntitiesLayer>();
     }
     catch(...){
-      el = new EntitiesLayer();
+      KWargs args;
+      args["generate_id"] = sent->id();
+      el = new EntitiesLayer(sent->doc(),args);
       sent->append( el );
     }
   }
@@ -150,7 +156,7 @@ void NERTagger::addNERTags( const vector<Word*>& words,
   vector<double> dstack;
   string curNER;
   for ( size_t i=0; i < tags.size(); ++i ){
-    if (debug) 
+    if (debug)
       *Log(nerLog) << "NER = " << tags[i] << endl;
     vector<string> ner;
     if ( tags[i] == "O" ){
@@ -158,7 +164,7 @@ void NERTagger::addNERTags( const vector<Word*>& words,
 	if (debug) {
 	  *Log(nerLog) << "O spit out " << curNER << endl;
 	  using TiCC::operator<<;
-	  *Log(nerLog) << "spit out " << stack << endl;	
+	  *Log(nerLog) << "spit out " << stack << endl;
 	}
 	addEntity( el, tagset, stack, dstack, curNER );
 	dstack.clear();
@@ -182,7 +188,7 @@ void NERTagger::addNERTags( const vector<Word*>& words,
 	if ( debug ){
 	  *Log(nerLog) << "B spit out " << curNER << endl;
 	  using TiCC::operator<<;
-	  *Log(nerLog) << "spit out " << stack << endl;	
+	  *Log(nerLog) << "spit out " << stack << endl;
 	}
 	addEntity( el, tagset, stack, dstack, curNER );
 	dstack.clear();
@@ -197,14 +203,14 @@ void NERTagger::addNERTags( const vector<Word*>& words,
     if ( debug ){
       *Log(nerLog) << "END spit out " << curNER << endl;
       using TiCC::operator<<;
-      *Log(nerLog) << "spit out " << stack << endl;	
+      *Log(nerLog) << "spit out " << stack << endl;
     }
     addEntity( el, tagset, stack, dstack, curNER );
   }
 }
 
 void NERTagger::addDeclaration( Document& doc ) const {
-  doc.declare( AnnotationType::ENTITY, 
+  doc.declare( AnnotationType::ENTITY,
 	       tagset,
 	       "annotator='frog-ner-" + version
 	       + "', annotatortype='auto', datetime='" + getTime() + "'");
@@ -220,7 +226,7 @@ void NERTagger::Classify( const vector<Word *>& swords ){
       if ( w < swords.size()-1 )
 	sentence += " ";
     }
-    if (debug) 
+    if (debug)
       *Log(nerLog) << "NER in: " << sentence << endl;
     vector<TagResult> tagv = tagger->TagLine(sentence);
     if ( tagv.size() != swords.size() ){
@@ -229,13 +235,13 @@ void NERTagger::Classify( const vector<Word *>& swords ){
     if ( debug ){
       *Log(nerLog) << "NER tagger out: " << endl;
       for ( size_t i=0; i < tagv.size(); ++i ){
-	*Log(nerLog) << "[" << i << "] : word=" << tagv[i].word() 
-		     << " tag=" << tagv[i].assignedTag() 
+	*Log(nerLog) << "[" << i << "] : word=" << tagv[i].word()
+		     << " tag=" << tagv[i].assignedTag()
 		     << " confidence=" << tagv[i].confidence() << endl;
       }
     }
     vector<double> conf;
-    vector<string> tags;    
+    vector<string> tags;
     for ( size_t i=0; i < tagv.size(); ++i ){
       tags.push_back( tagv[i].assignedTag() );
       conf.push_back( tagv[i].confidence() );
@@ -243,5 +249,3 @@ void NERTagger::Classify( const vector<Word *>& swords ){
     addNERTags( swords, tags, conf );
   }
 }
-
-
diff --git a/src/tst.sh b/src/tst.sh
old mode 100644
new mode 100755
index cdbc82e..b5bdc33
--- a/src/tst.sh
+++ b/src/tst.sh
@@ -1,4 +1,4 @@
 #! /bin/sh
 
-./frog --skip=p -t $srcdir/../tests/tst.txt -o tst.out >& /dev/null
+./frog --skip=p -t $srcdir/../tests/tst.txt -o tst.out
 diff -w tst.out $srcdir/../tests/tst.ok
diff --git a/src/ucto_tokenizer_mod.cxx b/src/ucto_tokenizer_mod.cxx
index 8830137..1ab003c 100644
--- a/src/ucto_tokenizer_mod.cxx
+++ b/src/ucto_tokenizer_mod.cxx
@@ -1,12 +1,12 @@
 /*
-  $Id: ucto_tokenizer_mod.cxx 15833 2013-03-28 12:10:55Z sloot $
+  $Id: ucto_tokenizer_mod.cxx 17436 2014-07-09 13:13:35Z sloot $
   $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/src/ucto_tokenizer_mod.cxx $
 
-  Copyright (c) 2006 - 2013
+  Copyright (c) 2006 - 2014
   Tilburg University
 
   A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch
- 
+
   This file is part of frog
 
   frog is free software; you can redistribute it and/or modify
@@ -39,31 +39,30 @@ using namespace std;
 using namespace TiCC;
 
 UctoTokenizer::UctoTokenizer() {
-  tokenizer = 0; 
+  tokenizer = 0;
   uctoLog = new LogStream( theErrLog, "tok-" );
-};
+}
 
-bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool pass ){
+bool UctoTokenizer::init( const Configuration& config, const string & docid, bool pass ){
   if ( tokenizer )
     throw runtime_error( "ucto tokenizer is already initalized" );
   tokenizer = new Tokenizer::TokenizerClass();
   tokenizer->setErrorLog( uctoLog );
-  string debug = conf.lookUp( "debug", "tokenizer" );
-  if ( debug.empty() ){
-    debug = conf.lookUp( "debug" );
+  int debug = 0;
+  string val = config.lookUp( "debug", "tokenizer" );
+  if ( val.empty() ){
+    val = config.lookUp( "debug" );
   }
-  if ( debug.empty() ){
-    tokenizer->setDebug( tpDebug );
-  }
-  else
-    tokenizer->setDebug( TiCC::stringTo<int>(debug) );
+  if ( !val.empty() )
+    debug = TiCC::stringTo<int>( val );
+  tokenizer->setDebug( debug );
   if ( pass ){
     // when passthru, we don't further initialize the tokenizer
     // it wil run in minimal mode then.
-    tokenizer->setPassThru( true ); 
+    tokenizer->setPassThru( true );
   }
   else {
-    string rulesName = conf.lookUp( "rulesFile", "tokenizer" );
+    string rulesName = config.lookUp( "rulesFile", "tokenizer" );
     if ( rulesName.empty() ){
       *Log(uctoLog) << "no rulesFile found in configuration" << endl;
       return false;
@@ -76,7 +75,7 @@ bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool
   tokenizer->setEosMarker( "" );
   tokenizer->setVerbose( false );
   tokenizer->setSentenceDetection( true ); //detection of sentences
-  tokenizer->setParagraphDetection( false ); //detection of paragraphs  
+  tokenizer->setParagraphDetection( false ); //detection of paragraphs
   tokenizer->setXMLOutput( true, docid );
   return true;
 }
@@ -84,25 +83,25 @@ bool UctoTokenizer::init( const Configuration& conf, const string & docid, bool
 void UctoTokenizer::setUttMarker( const string& u ) {
   if ( tokenizer ){
     if ( !u.empty() )
-      tokenizer->setEosMarker( u ); 
+      tokenizer->setEosMarker( u );
   }
   else
     throw runtime_error( "ucto tokenizer not initalized" );
-};
+}
 
 void UctoTokenizer::setSentencePerLineInput( bool b ) {
   if ( tokenizer )
-    tokenizer->setSentencePerLineInput( b ); 
+    tokenizer->setSentencePerLineInput( b );
   else
     throw runtime_error( "ucto tokenizer not initalized" );
-};
+}
 
 void UctoTokenizer::setQuoteDetection( bool b ) {
   if ( tokenizer )
-    tokenizer->setQuoteDetection( b ); 
+    tokenizer->setQuoteDetection( b );
   else
     throw runtime_error( "ucto tokenizer not initalized" );
-};
+}
 
 void UctoTokenizer::setInputEncoding( const std::string & enc ){
   if ( tokenizer ){
@@ -132,6 +131,7 @@ void UctoTokenizer::setInputXml( bool b ){
 
 vector<string> UctoTokenizer::tokenize( const string& line ){
   if ( tokenizer ){
+    tokenizer->reset();
     if ( tokenizer->getPassThru() ){
       bool bos = true;
       tokenizer->passthruLine( line, bos );
@@ -159,4 +159,3 @@ bool UctoTokenizer::tokenize( folia::Document& doc ){
     throw runtime_error( "ucto tokenizer not initalized" );
 
 }
-
diff --git a/test-driver b/test-driver
new file mode 100755
index 0000000..d306056
--- /dev/null
+++ b/test-driver
@@ -0,0 +1,139 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-13.22; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+   *) break;;
+  esac
+  shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='' # Red.
+  grn='' # Green.
+  lgn='' # Light green.
+  blu='' # Blue.
+  mgn='' # Magenta.
+  std=''     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  estatus=1
+fi
+
+case $estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/tests/Makefile.in b/tests/Makefile.in
index cb65e61..b4d3d23 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,6 +17,51 @@
 # $Id: Makefile.am 13537 2011-11-10 14:36:15Z sloot $
 # $URL: https://ilk.uvt.nl/svn/sources/Frog/trunk/tests/Makefile.am $
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -37,10 +81,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = tests
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
 	$(top_srcdir)/m4/ax_icu_check.m4 \
+	$(top_srcdir)/m4/ax_lib_readline.m4 \
 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
@@ -52,11 +97,30 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -102,7 +166,6 @@ LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -147,6 +210,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 SYSCONFDIR = @SYSCONFDIR@
 VERSION = @VERSION@
+XML2_CFLAGS = @XML2_CFLAGS@
+XML2_LIBS = @XML2_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
@@ -258,11 +323,11 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
@@ -398,15 +463,16 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	distclean distclean-generic distclean-libtool distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/tests/tst.ok b/tests/tst.ok
index 4f2c1d3..b043a1e 100644
--- a/tests/tst.ok
+++ b/tests/tst.ok
@@ -8,5 +8,5 @@
 8	de	de	[de]	LID(bep,stan,rest)	0.999964	O	B-NP		
 9	datum	datum	[datum]	N(soort,ev,basis,zijd,stan)	0.997691	O	I-NP		
 10	09-01-2012	09-01-2012	[09-01-2012]	TW(hoofd,vrij)	0.533224	O	B-NP		
-11	!	!	[!]	LET()	0.995005	O	O		
+11	!	!	[!]	LET()	1.000000	O	O		
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/frog.git



More information about the debian-science-commits mailing list