[SCM] dvdauthor/upstream: upstream 0.7.1 release

mleeman-guest at users.alioth.debian.org mleeman-guest at users.alioth.debian.org
Thu Oct 25 14:36:15 UTC 2012


The following commit has been merged in the upstream branch:
commit 6aa260afe34498027c037ce4ba4e17c9e40fc089
Author: Marc Leeman <marc.leeman at gmail.com>
Date:   Thu Oct 25 16:35:53 2012 +0200

    upstream 0.7.1 release

diff --git a/ChangeLog b/ChangeLog
index a524be9..f7cca96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+0.7.1: 2012 August 20
+	No longer silently fail to build dvdunauthor if libdvdread is not present;
+		must be explicitly disabled with --disable-dvdunauthor, otherwise configure
+		reports an error
+	Allow format specification at top level of dvdauthor control file
+	mpeg2desc now reports more details about video frames
+	More explanatory XML-parsing errors
+
 0.7.0: 2010 October 23
 	Reworked subtitle file reading so it can now deal with encodings like UTF-16
 	Default encoding for subtitle files is no longer ISO-8859-1, but taken from
diff --git a/Makefile.in b/Makefile.in
index be49b30..aa159b0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +76,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-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
 DATA = $(noinst_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
@@ -72,9 +94,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -103,6 +127,8 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 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@
@@ -140,6 +166,8 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
 LIBS = @LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBOBJS = @LTLIBOBJS@
@@ -229,7 +257,7 @@ edit = sed \
 all: all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
@@ -433,13 +461,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; \
@@ -471,7 +496,11 @@ dist-gzip: distdir
 	$(am__remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
 	$(am__remove_distdir)
 
 dist-lzma: distdir
@@ -479,7 +508,7 @@ dist-lzma: distdir
 	$(am__remove_distdir)
 
 dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
 	$(am__remove_distdir)
 
 dist-tarZ: distdir
@@ -510,6 +539,8 @@ distcheck: dist
 	  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*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -519,7 +550,7 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	chmod -R a-w $(distdir); chmod u+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
@@ -529,6 +560,7 @@ distcheck: dist
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -557,8 +589,16 @@ distcheck: dist
 	  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'
 distuninstallcheck:
-	@$(am__cd) '$(distuninstallcheck_dir)' \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -589,10 +629,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -679,15 +724,15 @@ uninstall-am:
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am am--refresh check check-am clean clean-generic \
 	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-	dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
-	distclean distclean-generic 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 \
+	dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+	distcheck distclean distclean-generic 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 pdf \
 	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
 
diff --git a/README b/README
index e400738..aab119a 100644
--- a/README
+++ b/README
@@ -59,3 +59,6 @@ mjpegtools: http://mjpeg.sourceforge.net
         for DVD-Video navigation packets
 mpucoder's site on dvd specs: http://www.mpucoder.com/DVD/
         details on the DVD-Video format
+Inside DVD-Video wikibook: <http://en.wikibooks.org/wiki/Inside_DVD-Video>
+        an attempt to document everything that is publicly known about the
+        DVD-Video spec in a readable form
diff --git a/TODO b/TODO
index 7b4d8be..171e34f 100644
--- a/TODO
+++ b/TODO
@@ -4,8 +4,6 @@ DVDAUTHOR
 
 . moving buttons
 
-. make it a library
-
 . improve (and test) audio gap detection
 
 . resurrect buttongroup code
@@ -16,17 +14,20 @@ DVDAUTHOR
 
 . allow jumppad to span multiple pgc's
 
+. multiangle support!
+
+. make it a library?
 
 SPUMUX
 
-. handle multiple scripts in spumux
+. rework subtitle rendering to use Pango
 
 . deal with 16 color subtitles
 
-. librarify spumux
-
 . add way to map color->color for generating select images
 
+. librarify spumux?
+
 
 DOCUMENTATION
 
diff --git a/aclocal.m4 b/aclocal.m4
index 25b652c..77baebf 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,8 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 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.
@@ -13,8 +14,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
+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'.])])
@@ -1562,7 +1563,8 @@ main()
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -1608,7 +1610,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -1656,9 +1659,9 @@ if test $pkg_failed = yes; then
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -1692,12 +1695,15 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 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_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
@@ -1707,7 +1713,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 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.1], [],
+m4_if([$1], [1.11.6], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -1723,19 +1729,21 @@ 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.1])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])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  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 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
+
 # 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/../..'.
@@ -1817,14 +1825,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
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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.
 
-# serial 10
+# serial 12
 
 # 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,
@@ -1864,6 +1872,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # 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'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -1928,7 +1937,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # 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.
@@ -1993,10 +2002,13 @@ AC_DEFUN([AM_DEP_TRACK],
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
@@ -2230,12 +2242,15 @@ 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  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008, 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_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -2367,12 +2382,15 @@ else
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 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'.
@@ -2395,13 +2413,14 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 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
+# serial 5
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -2409,13 +2428,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # 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)])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -2491,12 +2510,14 @@ Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 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_INSTALL_STRIP
 # ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
@@ -2519,13 +2540,13 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 2010 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
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -2534,13 +2555,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -2562,10 +2583,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [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='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [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])
diff --git a/autotools/config.guess b/autotools/config.guess
index c2246a4..d622a44 100755
--- a/autotools/config.guess
+++ b/autotools/config.guess
@@ -1,10 +1,10 @@
 #! /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
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-12-30'
+timestamp='2012-02-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
@@ -17,9 +17,7 @@ timestamp='2009-12-30'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# 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
@@ -57,8 +55,8 @@ 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 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+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."
@@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -181,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -224,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -270,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -296,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
@@ -395,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -481,8 +482,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -495,7 +496,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -552,7 +553,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -595,52 +596,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+			esac ;;
+		    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
+		    sed 's/^		//' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -731,22 +732,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+	exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+	exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+	exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+	exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -770,14 +771,14 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -789,13 +790,12 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
 	    amd64)
 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
@@ -804,15 +804,18 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
     *:Interix*:*)
-    	case ${UNAME_MACHINE} in
+	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
@@ -858,6 +861,13 @@ EOF
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -867,7 +877,7 @@ EOF
 	  EV6)   UNAME_MACHINE=alphaev6 ;;
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+	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}
@@ -879,20 +889,29 @@ EOF
 	then
 	    echo ${UNAME_MACHINE}-unknown-linux-gnu
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    else
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	LIBC=gnu
@@ -934,7 +953,7 @@ EOF
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     padre:Linux:*:*)
 	echo sparc-unknown-linux-gnu
@@ -960,7 +979,7 @@ EOF
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -968,14 +987,17 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -984,11 +1006,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+	# Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -1020,7 +1042,7 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
@@ -1048,13 +1070,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
 	# prints for the "djgpp" host, or else GDB configury will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
-        exit ;;
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1089,8 +1111,8 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 	OS_REL='.3'
 	test -r /etc/.relid \
@@ -1133,10 +1155,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1162,11 +1184,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv${UNAME_RELEASE}
 	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1231,6 +1253,9 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
@@ -1276,13 +1301,13 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1300,6 +1325,9 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1322,11 +1350,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+	"4"
 #else
-	  ""
+	""
 #endif
-         ); exit (0);
+	); exit (0);
 #endif
 #endif
 
diff --git a/autotools/config.sub b/autotools/config.sub
index c2d1257..6205f84 100755
--- a/autotools/config.sub
+++ b/autotools/config.sub
@@ -1,10 +1,10 @@
 #! /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
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2010-01-22'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2010-01-22'
 # 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# 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
@@ -76,8 +74,8 @@ 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 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+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."
@@ -124,13 +122,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -157,8 +160,8 @@ case $os in
 		os=
 		basic_machine=$1
 		;;
-        -bluegene*)
-	        os=-cnk
+	-bluegene*)
+		os=-cnk
 		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
@@ -174,10 +177,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -222,6 +225,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
 		;;
@@ -246,17 +255,22 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| 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 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
@@ -282,29 +296,39 @@ case $basic_machine in
 	| moxie \
 	| mt \
 	| msp430 \
+	| nds32 | nds32le | nds32be \
 	| nios | nios2 \
 	| ns16k | ns32k \
+	| open8 \
 	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| rx \
+	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -314,6 +338,21 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -328,21 +367,25 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -368,26 +411,29 @@ case $basic_machine in
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
 	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* | rx-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile-* | tilegx-* \
+	| tile*-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -412,7 +458,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -482,11 +528,20 @@ case $basic_machine in
 		basic_machine=powerpc-ibm
 		os=-cnk
 		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-        cegcc)
+	cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -518,7 +573,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16)
+	cr16 | cr16-*)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -676,7 +731,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -734,7 +788,7 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-        microblaze)
+	microblaze)
 		basic_machine=microblaze-xilinx
 		;;
 	mingw32)
@@ -773,10 +827,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -841,6 +903,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -923,9 +991,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -1019,6 +1088,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -1075,25 +1147,8 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
-		;;
-        # This must be matched before tile*.
-        tilegx*)
-		basic_machine=tilegx-unknown
-		os=-linux-gnu
-		;;
 	tile*)
-		basic_machine=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1163,6 +1218,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1260,11 +1318,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
-        -auroraux)
-	        os=-auroraux
+	-auroraux)
+		os=-auroraux
 		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1300,8 +1358,9 @@ case $os in
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1348,7 +1407,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1397,7 +1456,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1442,8 +1501,8 @@ case $os in
 	-dicos*)
 		os=-dicos
 		;;
-        -nacl*)
-	        ;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1466,10 +1525,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+	score-*)
 		os=-elf
 		;;
-        spu-*)
+	spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1481,8 +1540,20 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-        c4x-* | tic4x-*)
-        	os=-coff
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1502,14 +1573,11 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
-        mep-*)
+	mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1536,7 +1604,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
diff --git a/autotools/depcomp b/autotools/depcomp
index df8eea7..25a39e6 100755
--- a/autotools/depcomp
+++ b/autotools/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011, 2012 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,7 +28,7 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -40,11 +40,11 @@ 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 outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -57,6 +57,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+
 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
@@ -90,10 +96,24 @@ 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"
+   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
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -148,20 +168,21 @@ gcc)
 ## 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
+  tr ' ' "$nl" < "$tmpdepfile" |
+## 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.
+## 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 '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -193,18 +214,15 @@ sgi)
     # 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" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
@@ -216,10 +234,17 @@ sgi)
   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|/[^/]*$|/|'`
@@ -249,12 +274,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
+    # 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:'.
+    # '$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"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -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
@@ -265,23 +289,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -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:
+  # 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
   #    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 ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -290,15 +317,21 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  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"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -334,7 +367,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
 	       s/^ *//
 	       s/ \\*$//
@@ -349,9 +382,9 @@ hp2)
 
 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'.
+   # 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.
+   # 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=
@@ -397,14 +430,59 @@ tru64)
    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"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # 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
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -422,7 +500,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,15 +520,14 @@ 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" | \
+  tr ' ' "$nl" < "$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"
@@ -503,9 +580,10 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # 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 ' ' "$nl" | \
 ## 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"
@@ -525,7 +603,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -594,8 +672,8 @@ msvisualcpp)
   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/autotools/install-sh b/autotools/install-sh
index 6781b98..a9244eb 100755
--- a/autotools/install-sh
+++ b/autotools/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-01-19.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -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
 
@@ -200,7 +208,11 @@ if test $# -eq 0; then
 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.
@@ -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/autotools/missing b/autotools/missing
index 28055d2..86a8fc3 100755
--- a/autotools/missing
+++ b/autotools/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@ Supported PROGRAM values:
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@ WARNING: \`$1' $msg.  You should only need it if
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@ WARNING: \`$1' is $msg.  You should only need it if
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
diff --git a/configure b/configure
index 9336128..674576b 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.67 for DVDAuthor 0.7.0.
+# Generated by GNU Autoconf 2.69 for DVDAuthor 0.7.1.
 #
 # Report bugs to <dvdauthor-users at lists.sourceforge.net>.
 #
 #
-# 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
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,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
@@ -168,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'\" &&
@@ -213,14 +238,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.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$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 :
@@ -323,6 +359,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
@@ -444,6 +488,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).
@@ -478,16 +526,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
@@ -499,28 +547,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'"
@@ -552,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='DVDAuthor'
 PACKAGE_TARNAME='dvdauthor'
-PACKAGE_VERSION='0.7.0'
-PACKAGE_STRING='DVDAuthor 0.7.0'
+PACKAGE_VERSION='0.7.1'
+PACKAGE_STRING='DVDAuthor 0.7.1'
 PACKAGE_BUGREPORT='dvdauthor-users at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -610,6 +638,8 @@ build_os
 build_vendor
 build_cpu
 build
+HAVE_DVDREAD_FALSE
+HAVE_DVDREAD_TRUE
 FREETYPE_LIBS
 FREETYPE_CPPFLAGS
 FREETYPECONFIG
@@ -617,21 +647,22 @@ FRIBIDI_LIBS
 FRIBIDI_CFLAGS
 FONTCONFIG_LIBS
 FONTCONFIG_CFLAGS
-PKG_CONFIG_LIBDIR
-PKG_CONFIG_PATH
-PKG_CONFIG
 MAGICK_LIBS
 MAGICK_CPPFLAGS
 GMAGICKCONFIG
 MAGICKCONFIG
-HAVE_DVDREAD_FALSE
-HAVE_DVDREAD_TRUE
+LIBPNG_LIBS
+LIBPNG_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 EGREP
 GREP
 CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -713,6 +744,7 @@ enable_largefile
 enable_dependency_tracking
 enable_default_video_format
 enable_localize_filenames
+enable_dvdunauthor
 with_gnu_ld
 enable_rpath
 with_libiconv_prefix
@@ -732,6 +764,8 @@ CPP
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
+LIBPNG_CFLAGS
+LIBPNG_LIBS
 FONTCONFIG_CFLAGS
 FONTCONFIG_LIBS
 FRIBIDI_CFLAGS
@@ -1140,7 +1174,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1191,8 +1225,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
@@ -1278,7 +1310,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 DVDAuthor 0.7.0 to adapt to many kinds of systems.
+\`configure' configures DVDAuthor 0.7.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1348,7 +1380,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of DVDAuthor 0.7.0:";;
+     short | recursive ) echo "Configuration of DVDAuthor 0.7.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1367,6 +1399,10 @@ Optional Features:
                           specifies that filenames are to be interpreted in
                           the locale encoding. If omitted, they are always
                           interpreted as UTF-8
+  --disable-dvdunauthor   don't build dvdunauthor (which requires libdvdread).
+                          If not specified and libdvdread cannot be found, an
+                          error occurs
+
   --disable-rpath         do not hardcode runtime library paths
   --disable-xmltest       Do not try to compile and run a test LIBXML program
 
@@ -1393,6 +1429,9 @@ 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
+  LIBPNG_CFLAGS
+              C compiler flags for LIBPNG, overriding pkg-config
+  LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
   FONTCONFIG_CFLAGS
               C compiler flags for FONTCONFIG, overriding pkg-config
   FONTCONFIG_LIBS
@@ -1468,10 +1507,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-DVDAuthor configure 0.7.0
-generated by GNU Autoconf 2.67
+DVDAuthor configure 0.7.1
+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
@@ -1515,7 +1554,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1529,7 +1568,7 @@ ac_fn_c_check_type ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1570,7 +1609,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
 
@@ -1606,7 +1645,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1648,7 +1687,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1662,7 +1701,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1680,7 +1719,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1711,7 +1750,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
@@ -1725,7 +1764,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1738,10 +1777,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1808,7 +1847,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1817,7 +1856,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1829,7 +1868,7 @@ ac_fn_c_check_func ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1884,7 +1923,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
@@ -1899,7 +1938,7 @@ ac_fn_c_check_decl ()
   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1930,15 +1969,15 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
 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 DVDAuthor $as_me 0.7.0, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+It was created by DVDAuthor $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2196,7 +2235,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&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 $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2337,7 +2376,7 @@ am__api_version='1.11'
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2357,7 +2396,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.
@@ -2424,11 +2463,11 @@ am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
 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
@@ -2514,7 +2553,7 @@ if test "$cross_compiling" != no; then
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -2526,7 +2565,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
@@ -2554,7 +2593,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -2566,7 +2605,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
@@ -2607,7 +2646,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then :
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2617,7 +2656,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) '* | \
@@ -2658,7 +2697,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -2670,7 +2709,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
@@ -2698,7 +2737,7 @@ done
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -2756,7 +2795,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='dvdauthor'
- VERSION='0.7.0'
+ VERSION='0.7.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2786,11 +2825,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# 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}'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -2851,6 +2890,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -2871,7 +2911,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2883,7 +2923,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
@@ -2911,7 +2951,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2923,7 +2963,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
@@ -2964,7 +3004,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2976,7 +3016,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
@@ -3004,7 +3044,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3017,7 +3057,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
@@ -3063,7 +3103,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3075,7 +3115,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
@@ -3107,7 +3147,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3119,7 +3159,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
@@ -3162,7 +3202,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -3277,7 +3317,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3320,7 +3360,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3379,7 +3419,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3390,7 +3430,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3431,7 +3471,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3441,7 +3481,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3478,7 +3518,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3556,7 +3596,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3565,8 +3605,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);
@@ -3655,7 +3694,7 @@ depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -3664,6 +3703,7 @@ else
   # 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'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3723,7 +3763,7 @@ else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # 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.
@@ -3788,7 +3828,7 @@ if test "$enable_largefile" != no; then
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+if ${ac_cv_sys_largefile_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_largefile_CC=no
@@ -3839,7 +3879,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+if ${ac_cv_sys_file_offset_bits+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -3908,7 +3948,7 @@ rm -rf conftest*
   if test $ac_cv_sys_file_offset_bits = unknown; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then :
+if ${ac_cv_sys_large_files+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -3975,6 +4015,8 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
+
+
 fi
 
 
@@ -3990,7 +4032,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4106,7 +4148,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -4118,7 +4160,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4132,7 +4174,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
@@ -4181,7 +4223,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4198,7 +4240,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
@@ -4248,7 +4290,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4377,84 +4419,66 @@ done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
+if ${ac_cv_header_stdbool_h+:} false; then :
   $as_echo_n "(cached) " >&6
 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];
-	bool e = &s;
-	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];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
-	/* 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 ()
 {
 
-	*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;
@@ -4469,8 +4493,8 @@ 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_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE__BOOL 1
@@ -4479,6 +4503,7 @@ _ACEOF
 
 fi
 
+
 if test $ac_cv_header_stdbool_h = yes; then
 
 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
@@ -4486,10 +4511,37 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
 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
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+void nested(void) {}
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo C compiler allows nested routines;
+$as_echo "#define HAVE_NESTED_ROUTINES 1" >>confdefs.h
+
+else
+  echo WARNING: C compiler does not allow nested routines--some functionality will be disabled
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 have_dvdread=false
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DVDOpenFile in -ldvdread" >&5
 $as_echo_n "checking for DVDOpenFile in -ldvdread... " >&6; }
-if test "${ac_cv_lib_dvdread_DVDOpenFile+set}" = set; then :
+if ${ac_cv_lib_dvdread_DVDOpenFile+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -4523,22 +4575,14 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dvdread_DVDOpenFile" >&5
 $as_echo "$ac_cv_lib_dvdread_DVDOpenFile" >&6; }
-if test "x$ac_cv_lib_dvdread_DVDOpenFile" = x""yes; then :
+if test "x$ac_cv_lib_dvdread_DVDOpenFile" = xyes; then :
   have_dvdread=true
 fi
 
- if $have_dvdread; then
-  HAVE_DVDREAD_TRUE=
-  HAVE_DVDREAD_FALSE='#'
-else
-  HAVE_DVDREAD_TRUE='#'
-  HAVE_DVDREAD_FALSE=
-fi
-
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lgnugetopt" >&5
 $as_echo_n "checking for getopt_long in -lgnugetopt... " >&6; }
-if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then :
+if ${ac_cv_lib_gnugetopt_getopt_long+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -4572,7 +4616,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnugetopt_getopt_long" >&5
 $as_echo "$ac_cv_lib_gnugetopt_getopt_long" >&6; }
-if test "x$ac_cv_lib_gnugetopt_getopt_long" = x""yes; then :
+if test "x$ac_cv_lib_gnugetopt_getopt_long" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBGNUGETOPT 1
 _ACEOF
@@ -4616,6 +4660,220 @@ fi
 done
 
 
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; 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_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  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 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
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; 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_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  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 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
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  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
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPNG" >&5
+$as_echo_n "checking for LIBPNG... " >&6; }
+
+if test -n "$LIBPNG_CFLAGS"; then
+    pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libpng") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBPNG_LIBS"; then
+    pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libpng") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng" 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
+	        LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpng" 2>&1`
+        else
+	        LIBPNG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpng" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBPNG_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (libpng) were not met:
+
+$LIBPNG_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 LIBPNG_CFLAGS
+and LIBPNG_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 LIBPNG_CFLAGS
+and LIBPNG_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
+	LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS
+	LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
 usemagick=0
 
 for ac_prog in Magick-config
@@ -4624,7 +4882,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_MAGICKCONFIG+set}" = set; then :
+if ${ac_cv_prog_MAGICKCONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$MAGICKCONFIG"; then
@@ -4636,7 +4894,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_MAGICKCONFIG="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4668,7 +4926,7 @@ if test -n "$MAGICKCONFIG"; then
     CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
     LIBS="$MAGICK_LIBS $LIBS"
     ac_fn_c_check_func "$LINENO" "ExportImagePixels" "ac_cv_func_ExportImagePixels"
-if test "x$ac_cv_func_ExportImagePixels" = x""yes; then :
+if test "x$ac_cv_func_ExportImagePixels" = xyes; then :
   usemagick=1
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: ImageMagick does not support the function
@@ -4693,7 +4951,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_GMAGICKCONFIG+set}" = set; then :
+if ${ac_cv_prog_GMAGICKCONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$GMAGICKCONFIG"; then
@@ -4705,7 +4963,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_GMAGICKCONFIG="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4737,7 +4995,7 @@ done
         CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
         LIBS="$MAGICK_LIBS $LIBS"
         ac_fn_c_check_func "$LINENO" "DispatchImage" "ac_cv_func_DispatchImage"
-if test "x$ac_cv_func_DispatchImage" = x""yes; then :
+if test "x$ac_cv_func_DispatchImage" = xyes; then :
   usemagick=1
 fi
 
@@ -4752,218 +5010,14 @@ $as_echo "#define HAVE_GMAGICK 1" >>confdefs.h
 fi
 
 if test "$usemagick" != 1; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5
-$as_echo_n "checking for zlibVersion in -lz... " >&6; }
-if test "${ac_cv_lib_z_zlibVersion+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-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 zlibVersion ();
-int
-main ()
-{
-return zlibVersion ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_z_zlibVersion=yes
-else
-  ac_cv_lib_z_zlibVersion=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5
-$as_echo "$ac_cv_lib_z_zlibVersion" >&6; }
-if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then :
-  test
-else
-  as_fn_error $? "You must have libz(-devel) installed" "$LINENO" 5
-fi
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5
-$as_echo_n "checking for png_sig_cmp in -lpng... " >&6; }
-if test "${ac_cv_lib_png_png_sig_cmp+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng -lz -lm $LIBS"
-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 png_sig_cmp ();
-int
-main ()
-{
-return png_sig_cmp ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_png_png_sig_cmp=yes
-else
-  ac_cv_lib_png_png_sig_cmp=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5
-$as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; }
-if test "x$ac_cv_lib_png_png_sig_cmp" = x""yes; then :
-  test
-else
-  as_fn_error $? "You must have libpng(-devel) installed" "$LINENO" 5
+    MAGICK_CPPFLAGS="$LIBPNG_CFLAGS"
+    MAGICK_LIBS="$LIBPNG_LIBS"
 fi
 
-    MAGICK_CPPFLAGS=
-    MAGICK_LIBS="-lpng -lz -lm"
-fi
-
-
-
-
-
-
 
 
 
 
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  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_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
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  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_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
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  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
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.9.0
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		PKG_CONFIG=""
-	fi
-fi
-
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FONTCONFIG" >&5
 $as_echo_n "checking for FONTCONFIG... " >&6; }
@@ -4978,6 +5032,7 @@ if test -n "$FONTCONFIG_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -4994,6 +5049,7 @@ if test -n "$FONTCONFIG_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5013,9 +5069,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "fontconfig" 2>&1`
+	        FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig" 2>&1`
         else
-	        FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --print-errors "fontconfig" 2>&1`
+	        FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$FONTCONFIG_PKG_ERRORS" >&5
@@ -5052,6 +5108,7 @@ if test -n "$FRIBIDI_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FRIBIDI_CFLAGS=`$PKG_CONFIG --cflags "fribidi" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5068,6 +5125,7 @@ if test -n "$FRIBIDI_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FRIBIDI_LIBS=`$PKG_CONFIG --libs "fribidi" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5087,9 +5145,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "fribidi" 2>&1`
+	        FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fribidi" 2>&1`
         else
-	        FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --print-errors "fribidi" 2>&1`
+	        FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fribidi" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$FRIBIDI_PKG_ERRORS" >&5
@@ -5108,14 +5166,6 @@ $as_echo "yes" >&6; }
 $as_echo "#define HAVE_FRIBIDI 1" >>confdefs.h
 
 fi
-ac_fn_c_check_type "$LINENO" "FriBidiParType" "ac_cv_type_FriBidiParType" "#include <fribidi/fribidi-bidi-types.h>
-"
-if test "x$ac_cv_type_FriBidiParType" = x""yes; then :
-
-$as_echo "#define HAVE_FRIBIDI2 1" >>confdefs.h
-
-fi
-
 
 
 
@@ -5125,7 +5175,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_FREETYPECONFIG+set}" = set; then :
+if ${ac_cv_prog_FREETYPECONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$FREETYPECONFIG"; then
@@ -5137,7 +5187,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_FREETYPECONFIG="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5173,7 +5223,7 @@ $as_echo "#define HAVE_FREETYPE 1" >>confdefs.h
     for ac_header in ft2build.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default"
-if test "x$ac_cv_header_ft2build_h" = x""yes; then :
+if test "x$ac_cv_header_ft2build_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_FT2BUILD_H 1
 _ACEOF
@@ -5183,9 +5233,11 @@ fi
 done
 
     CPPFLAGS="$ac_save_CPPFLAGS"
-fi
 
 
+else
+    as_fn_error $? "freetype not found" "$LINENO" 5
+fi
 
 
 # Check whether --enable-default-video-format was given.
@@ -5216,6 +5268,30 @@ $as_echo "#define LOCALIZE_FILENAMES 1" >>confdefs.h
 fi
 
 
+# Check whether --enable-dvdunauthor was given.
+if test "${enable_dvdunauthor+set}" = set; then :
+  enableval=$enable_dvdunauthor;
+fi
+
+if test "x$enable_dvdunauthor" != xno; then :
+  if test "x$have_dvdread" = xfalse; then :
+  as_fn_error $? "missing libdvdread" "$LINENO" 5
+
+fi
+
+else
+  have_dvdread=false
+
+fi
+ if $have_dvdread; then
+  HAVE_DVDREAD_TRUE=
+  HAVE_DVDREAD_FALSE='#'
+else
+  HAVE_DVDREAD_TRUE='#'
+  HAVE_DVDREAD_FALSE=
+fi
+
+
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -5223,7 +5299,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -5239,7 +5315,7 @@ fi
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -5257,7 +5333,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -5272,7 +5348,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -5364,7 +5440,7 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${acl_cv_path_LD+set}" = set; then :
+if ${acl_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
@@ -5401,7 +5477,7 @@ fi
 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${acl_cv_prog_gnu_ld+set}" = set; then :
+if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
@@ -5421,7 +5497,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld
 
                                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
 $as_echo_n "checking for shared library run path origin... " >&6; }
-if test "${acl_cv_rpath+set}" = set; then :
+if ${acl_cv_rpath+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -5459,7 +5535,7 @@ fi
     solaris*)
                                     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
 $as_echo_n "checking for 64-bit host... " >&6; }
-if test "${gl_cv_solaris_64bit+set}" = set; then :
+if ${gl_cv_solaris_64bit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6012,7 +6088,7 @@ fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
 $as_echo_n "checking for iconv... " >&6; }
-if test "${am_cv_func_iconv+set}" = set; then :
+if ${am_cv_func_iconv+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6069,7 +6145,7 @@ $as_echo "$am_cv_func_iconv" >&6; }
   if test "$am_cv_func_iconv" = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
 $as_echo_n "checking for working iconv... " >&6; }
-if test "${am_cv_func_iconv_works+set}" = set; then :
+if ${am_cv_func_iconv_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6204,7 +6280,7 @@ $as_echo "$LIBICONV" >&6; }
   if test "$am_cv_func_iconv" = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
 $as_echo_n "checking for iconv declaration... " >&6; }
-    if test "${am_cv_proto_iconv+set}" = set; then :
+    if ${am_cv_proto_iconv+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6295,7 +6371,7 @@ fi
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XML2_CONFIG+set}" = set; then :
+if ${ac_cv_path_XML2_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML2_CONFIG in
@@ -6309,7 +6385,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_XML2_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
@@ -6516,7 +6592,7 @@ rm -f core conftest.err conftest.$ac_objext \
 
 ac_fn_c_check_decl "$LINENO" "O_BINARY" "ac_cv_have_decl_O_BINARY" " #include <fcntl.h>
 "
-if test "x$ac_cv_have_decl_O_BINARY" = x""yes; then :
+if test "x$ac_cv_have_decl_O_BINARY" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -6593,10 +6669,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6648,7 +6735,7 @@ if test -z "${HAVE_DVDREAD_TRUE}" && test -z "${HAVE_DVDREAD_FALSE}"; then
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -6749,6 +6836,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6944,16 +7032,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
@@ -7013,28 +7101,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'"
@@ -7055,8 +7131,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 DVDAuthor $as_me 0.7.0, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+This file was extended by DVDAuthor $as_me 0.7.1, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7121,11 +7197,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="\\
-DVDAuthor config.status 0.7.0
-configured by $0, generated by GNU Autoconf 2.67,
+DVDAuthor config.status 0.7.1
+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."
 
@@ -7216,7 +7292,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'
@@ -7256,7 +7332,7 @@ do
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7279,9 +7355,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -7289,12 +7366,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -7316,7 +7394,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -7344,7 +7422,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -7392,7 +7470,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -7424,7 +7502,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -7458,7 +7536,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -7470,8 +7548,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -7572,7 +7650,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7591,7 +7669,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -7600,7 +7678,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7626,8 +7704,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -7763,21 +7841,22 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -7788,20 +7867,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
diff --git a/configure.ac b/configure.ac
index ef43739..c43df92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(DVDAuthor,0.7.0,dvdauthor-users at lists.sourceforge.net)
+AC_INIT(DVDAuthor,0.7.1,dvdauthor-users at lists.sourceforge.net)
 
 AM_CONFIG_HEADER(src/config.h)
 AC_CONFIG_AUX_DIR(autotools)
@@ -11,9 +11,15 @@ AC_SYS_LARGEFILE
 
 AC_HEADER_STDBOOL
 
+AC_LANG([C])
+AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM([], [void nested(void) {}])],
+    [echo C compiler allows nested routines; AC_DEFINE([HAVE_NESTED_ROUTINES], [1], [define to 1 if C compiler allows nested routines])],
+    [echo WARNING: C compiler does not allow nested routines--some functionality will be disabled]
+)
+
 have_dvdread=false
 AC_CHECK_LIB(dvdread, DVDOpenFile, have_dvdread=true)
-AM_CONDITIONAL(HAVE_DVDREAD, $have_dvdread)
 
 AC_CHECK_LIB(gnugetopt, getopt_long)
 
@@ -29,6 +35,10 @@ AC_CHECK_FUNCS( \
     setmode \
 )
 
+PKG_CHECK_MODULES(LIBPNG, [libpng])
+AC_SUBST(LIBPNG_CFLAGS)
+AC_SUBST(LIBPNG_LIBS)
+
 usemagick=0
 
 AC_CHECK_PROGS(MAGICKCONFIG, [Magick-config])
@@ -67,11 +77,8 @@ if test "$usemagick" != 1; then
 fi
 
 if test "$usemagick" != 1; then
-    AC_CHECK_LIB(z, zlibVersion, test, AC_MSG_ERROR([You must have libz(-devel) installed]))
-
-    AC_CHECK_LIB(png, png_sig_cmp, test, AC_MSG_ERROR([You must have libpng(-devel) installed]), -lz -lm)
-    MAGICK_CPPFLAGS=
-    MAGICK_LIBS="-lpng -lz -lm"
+    MAGICK_CPPFLAGS="$LIBPNG_CFLAGS"
+    MAGICK_LIBS="$LIBPNG_LIBS"
 fi
 
 AC_SUBST(MAGICK_CPPFLAGS)
@@ -82,7 +89,6 @@ AC_SUBST(FONTCONFIG_CFLAGS)
 AC_SUBST(FONTCONFIG_LIBS)
 
 PKG_CHECK_MODULES([FRIBIDI], [fribidi], [AC_DEFINE(HAVE_FRIBIDI, 1, [whether FriBidi is available])], [:])
-AC_CHECK_TYPE(FriBidiParType, [AC_DEFINE(HAVE_FRIBIDI2, 1, [Whether Fribidi is version 2])], [], [#include <fribidi/fribidi-bidi-types.h>])
 AC_SUBST(FRIBIDI_CFLAGS)
 AC_SUBST(FRIBIDI_LIBS)
 
@@ -96,10 +102,12 @@ if test -n "$FREETYPECONFIG"; then
     CPPFLAGS="$CPPFLAGS $FREETYPE_CPPFLAGS"
     AC_CHECK_HEADERS(ft2build.h)
     CPPFLAGS="$ac_save_CPPFLAGS"
+    AC_SUBST(FREETYPE_CPPFLAGS)
+    AC_SUBST(FREETYPE_LIBS)
+else
+    AC_MSG_ERROR([freetype not found])
 fi
 
-AC_SUBST(FREETYPE_CPPFLAGS)
-AC_SUBST(FREETYPE_LIBS)
 
 AC_ARG_ENABLE([default-video-format],
 AS_HELP_STRING([--enable-default-video-format=format], [specify a default video format, either NTSC or PAL, to be used if no configuration or input setting is given]),
@@ -119,11 +127,26 @@ AS_HELP_STRING([--enable-localize-filenames], [specifies that filenames are to b
 AC_DEFINE(LOCALIZE_FILENAMES, 1, [Whether to localize filenames])
 ])
 
+AC_ARG_ENABLE([dvdunauthor],
+AS_HELP_STRING([--disable-dvdunauthor], [don't build dvdunauthor (which requires libdvdread). If not specified and libdvdread cannot be found, an error occurs])
+)
+AS_IF([test "x$enable_dvdunauthor" != xno],
+[AS_IF([test "x$have_dvdread" = xfalse],
+[AC_MSG_ERROR([missing libdvdread])]
+)
+],
+[have_dvdread=false]
+)
+AM_CONDITIONAL(HAVE_DVDREAD, $have_dvdread)
+
 dnl AM_LANGINFO_CODESET
 
 AM_ICONV
 
-AM_PATH_XML2(2.6.0, , AC_MSG_ERROR([You must have libxml2 >= 2.6.0 installed]))
+ifdef([AM_PATH_XML2],
+    [AM_PATH_XML2(2.6.0, , AC_MSG_ERROR([You must have libxml2 >= 2.6.0 installed]))],
+    [errprint([You must have libxml2 (>= 2.6.0) installed
+])m4_exit(1)AC_MSG_ERROR([You must have libxml2 (>= 2.6.0) installed])])
 
 AC_CHECK_DECLS(O_BINARY, , , [ #include <fcntl.h> ] )
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3bcef40..79ca5cc 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
 man1_MANS = dvdauthor.1 dvddirdel.1 dvdunauthor.1 mpeg2desc.1 spumux.1 spuunmux.1
-dist_pkgdata_DATA = dvdauthor.xsd spumux.xsd
+dist_pkgdata_DATA = common.xsd dvdauthor.xsd spumux.xsd
 
 
 EXTRA_DIST = $(man1_MANS)
@@ -11,7 +11,7 @@ manpages:
 	docbook2man root.sgml
 
 $(man1_MANS):
-	make manpages
+	$(MAKE) manpages
 
 .PHONY: html
 
@@ -20,6 +20,6 @@ html:
 	docbook2html -d html.dsl root.sgml
 
 index.html:
-	make html
+	$(MAKE) html
 
 MAINTAINERCLEANFILES = $(man1_MANS)
diff --git a/doc/Makefile.in b/doc/Makefile.in
index cd3e332..147b8dd 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -47,6 +64,11 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 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/||"`;; \
@@ -68,6 +90,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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; }; \
+  }
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdatadir)"
 NROFF = nroff
@@ -110,6 +138,8 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
 LIBS = @LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBOBJS = @LTLIBOBJS@
@@ -188,7 +218,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 man1_MANS = dvdauthor.1 dvddirdel.1 dvdunauthor.1 mpeg2desc.1 spumux.1 spuunmux.1
-dist_pkgdata_DATA = dvdauthor.xsd spumux.xsd
+dist_pkgdata_DATA = common.xsd dvdauthor.xsd spumux.xsd
 EXTRA_DIST = $(man1_MANS)
 MAINTAINERCLEANFILES = $(man1_MANS)
 all: all-am
@@ -226,9 +256,18 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 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"; \
@@ -255,13 +294,14 @@ uninstall-man1:
 	files=`{ for i in $$list; do echo "$$i"; done; \
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
 	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -275,9 +315,7 @@ uninstall-dist_pkgdataDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files
+	dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
@@ -345,10 +383,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -449,7 +492,7 @@ manpages:
 	docbook2man root.sgml
 
 $(man1_MANS):
-	make manpages
+	$(MAKE) manpages
 
 .PHONY: html
 
@@ -458,7 +501,7 @@ html:
 	docbook2html -d html.dsl root.sgml
 
 index.html:
-	make html
+	$(MAKE) html
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/doc/dvdauthor.1 b/doc/dvdauthor.1
index 9ac0656..3ca38ed 100644
--- a/doc/dvdauthor.1
+++ b/doc/dvdauthor.1
@@ -3,7 +3,7 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "DVDAUTHOR" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "DVDAUTHOR" "1" "20 August 2012" "" "DVDAuthor Man Pages"
 
 .SH NAME
 dvdauthor \- assembles multiple mpeg program streams into a suitable DVD filesystem
@@ -70,7 +70,14 @@ systems by avoiding extra filesystem accesses.
 .TP
 \fB-O \fIoutput-dir\fB\fR
 The destination directory to store the DVD-Video file structure in.
-If -O is specified, then any existing directory is deleted.
+If -O is specified, then any existing directory is (safely) deleted (only items that
+look like part of a DVD-Video structure are removed).
+.TP
+\fB-x \fIxml-control-file\fB\fR
+Specifies the control file describing the output structure to create.
+.PP
+Note that the remaining command-line options are \fBdeprecated\fR\&. Use the
+XML control file instead.
 .TP
 \fB-j\fR
 .TP
@@ -180,7 +187,7 @@ LANGUAGE DESCRIPTION for the format of \fIcommandlist.\fR
 Here is the basic structure of the control file:
 
 .nf
-<dvdauthor [dest="\fIoutput-dir\fR"] [jumppad="1|on|yes" | allgprm="1|on|yes"]>
+<dvdauthor [dest="\fIoutput-dir\fR"] [jumppad="1|on|yes" | allgprm="1|on|yes"] [format="ntsc|pal"]>
    <vmgm>
       [<fpc>\fIcommands;\fR</fpc>]
       <menus [lang="\fIlanguage-code\fR"]>
@@ -394,7 +401,7 @@ C-style /* ... */ comments are allowed. Or you can use XML comments
 .PP
 The DVD virtual machine processes 16 bit values.  It supports up
 to 16 general purpose registers; however \fBdvdauthor\fR
-reserves 3 for internal use.  Thus register 0-12 are avaialable for
+reserves 3 for internal use.  Thus register 0-12 are available for
 use and are referred to as g0 through
 g12\&.
 .PP
@@ -455,14 +462,14 @@ example:
 .TP 0.2i
 \(bu
 .nf
-g3=s7;
+g3 = s7;
 .fi
 .TP 0.2i
 \(bu
 .nf
 {
-  audio=1;
-  subtitle=65;
+  audio = 1;
+  subtitle = 65;
   jump vmgm menu 3;
 }
 .fi
@@ -470,7 +477,7 @@ g3=s7;
 .PP
 The statements supported are fairly simple at the moment.
 .TP
-\fB\fIVARIABLE\fB=\fIEXPRESSION\fB;\fR
+\fB\fIVARIABLE\fB = \fIEXPRESSION\fB;\fR
 Sets a variable equal to the result of an equation.
 .TP
 \fBif (\fIEXPRESSION\fB) \fIBLOCK;\fB\fR
@@ -570,4 +577,4 @@ the total amount of video in the VMG menus must fit into 1073709056 bytes (52427
 sectors of 2kiB each). In each titleset, all the menu video must fit in the first VOB
 (VTS_nn_0.VOB), so is limited to the same amount.
 <marc.leeman at gmail.com>
-MarcLeeman2003Marc LeemanFri Dec 30 19:47:26 CET 2005
\ No newline at end of file
+MarcLeeman2003Marc Leeman
\ No newline at end of file
diff --git a/doc/dvdauthor.xsd b/doc/dvdauthor.xsd
index 79edb62..2537b2b 100644
--- a/doc/dvdauthor.xsd
+++ b/doc/dvdauthor.xsd
@@ -12,6 +12,8 @@
     </xsd:documentation>
   </xsd:annotation>
 
+  <xsd:include schemaLocation="common.xsd"/>
+
   <xsd:element name="dvdauthor" type="DvdauthorType"/>
 
   <xsd:complexType name="DvdauthorType">
@@ -20,7 +22,8 @@
       <xsd:element name="titleset" type="TitlesetType" minOccurs="0" maxOccurs="unbounded"/>
     </xsd:sequence>
     <xsd:attribute name="dest" type="xsd:string"/>
-    <xsd:attribute name="jumppad" type="xsd:string"/>
+    <xsd:attribute name="jumppad" type="isOnType"/>
+    <xsd:attribute name="allgprm" type="isOnType"/>
   </xsd:complexType>
 
   <xsd:complexType name="VmgmType">
@@ -143,6 +146,7 @@
       <xsd:enumeration value="audio"/>
       <xsd:enumeration value="angle"/>
       <xsd:enumeration value="ptt"/>
+      <xsd:enumeration value="notitle"/>
     </xsd:restriction>
   </xsd:simpleType>
   
@@ -164,8 +168,7 @@
     </xsd:annotation>
     <xsd:union>
       <xsd:simpleType>
-        <xsd:restriction base="xsd:integer">
-          <xsd:minInclusive value="1"/>
+        <xsd:restriction base="xsd:unsignedByte">
           <xsd:maxInclusive value="254"/>
         </xsd:restriction>
       </xsd:simpleType>
@@ -178,7 +181,7 @@
   </xsd:simpleType>
 
   <xsd:complexType name="ButtonType">
-	<xsd:simpleContent>
+    <xsd:simpleContent>
       <xsd:extension base="xsd:string">
         <xsd:attribute name="name" type="xsd:string"/>
       </xsd:extension>
@@ -190,9 +193,24 @@
   </xsd:complexType>
 
   <xsd:complexType name="VobType">
+    <xsd:sequence>
+      <xsd:element name="cell" type="CellType" minOccurs="0"/>
+    </xsd:sequence>
     <xsd:attribute name="file" type="xsd:string"/>
     <xsd:attribute name="chapters" type="xsd:string"/>
     <xsd:attribute name="pause" type="PauseType"/>
   </xsd:complexType>
+
+  <xsd:complexType name="CellType">
+    <xsd:simpleContent>
+      <xsd:extension base="xsd:string">
+        <xsd:attribute name="start" type="xsd:string"/>
+        <xsd:attribute name="end" type="xsd:string"/>
+        <xsd:attribute name="chapter" type="isOnType"/>
+        <xsd:attribute name="program" type="isOnType"/>
+        <xsd:attribute name="pause" type="PauseType"/>
+      </xsd:extension>
+    </xsd:simpleContent>
+  </xsd:complexType>
   
 </xsd:schema>
diff --git a/doc/dvddirdel.1 b/doc/dvddirdel.1
index f79d535..6fa3de6 100644
--- a/doc/dvddirdel.1
+++ b/doc/dvddirdel.1
@@ -3,7 +3,7 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "DVDDIRDEL" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "DVDDIRDEL" "1" "Fri Dec 30 19:47:26 CET 2005" "" "DVDAuthor Man Pages"
 
 .SH NAME
 dvddirdel \- Deletes a previously authored DVD directory structure in DIR
@@ -13,7 +13,11 @@ dvddirdel \- Deletes a previously authored DVD directory structure in DIR
 
 .SH "DESCRIPTION"
 .PP
-\fBdvddirdel\fR deletes a previously authored DVD directory structure in DIR
+\fBdvddirdel\fR safely deletes a previously authored DVD directory structure
+in DIR. Only items that look like part of a DVD-Video directory structure are removed.
+.PP
+If you just want to replace an existing output directory with a new one, dvdauthor(1)
+can do that directly with its -O option.
 .SH "USAGE"
 .PP
 \fBdvddirdel\fR -o DIR 
@@ -27,4 +31,4 @@ None.
 .PP
 MarcLeemanThis manual page was written by Marc Leeman <marc.leeman at gmail.com>, for the Debian GNU/Linux system (but may be used by others).
 <marc.leeman at gmail.com>
-MarcLeeman2003Marc LeemanFri Dec 30 19:47:26 CET 2005
\ No newline at end of file
+MarcLeeman2003Marc Leeman
\ No newline at end of file
diff --git a/doc/dvdunauthor.1 b/doc/dvdunauthor.1
index 93781c7..5c5c97b 100644
--- a/doc/dvdunauthor.1
+++ b/doc/dvdunauthor.1
@@ -3,17 +3,20 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "DVDUNAUTHOR" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "DVDUNAUTHOR" "1" "Fri Dec 30 19:47:26 CET 2005" "" "DVDAuthor Man Pages"
 
 .SH NAME
-dvdunauthor \- Removes DVD-Video file structure
+dvdunauthor \- Decodes DVD-Video file structure
 .SH SYNOPSIS
 
 \fBdvdunauthor\fR [ \fBpath\fR ]
 
 .SH "DESCRIPTION"
 .PP
-\fBdvdunauthor\fR removes the DVD-Video file structure
+\fBdvdunauthor\fR decodes the specified DVD-Video directory structure,
+putting into the current directory an XML control file and corresponding MPEG-2
+files (with a .vob extension) that \fBdvdauthor\fR can (hopefully)
+interpret to recreate the DVD-Video directory structure.
 .SH "USAGE"
 .PP
 \fBdvdunauthor\fR path 
@@ -22,9 +25,11 @@ dvdunauthor \- Removes DVD-Video file structure
 None.
 .SH "BUGS"
 .PP
-None.
+Depends on libdvdread to decode the DVD-Video structure and to report any
+errors trying to do so. But libdvdread will sometimes just exit without
+reporting any error.
 .SH "AUTHOR"
 .PP
 MarcLeemanThis manual page was written by Marc Leeman <marc.leeman at gmail.com>, for the Debian GNU/Linux system (but may be used by others).
 <marc.leeman at gmail.com>
-MarcLeeman2003Marc LeemanFri Dec 30 19:47:26 CET 2005
\ No newline at end of file
+MarcLeeman2003Marc Leeman
\ No newline at end of file
diff --git a/doc/mpeg2desc.1 b/doc/mpeg2desc.1
index daa88b0..a812ada 100644
--- a/doc/mpeg2desc.1
+++ b/doc/mpeg2desc.1
@@ -3,7 +3,7 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "MPEG2DESC" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "MPEG2DESC" "1" "Fri Dec 30 19:47:26 CET 2005" "" "DVDAuthor Man Pages"
 
 .SH NAME
 mpeg2desc \- multiplex audio/video streams
@@ -17,10 +17,10 @@ mpeg2desc \- multiplex audio/video streams
 .SH "OPTIONS"
 .TP
 \fB-a \fIstream\fB\fR
-Output audio \fIstream\fR to stdout
+Output audio \fIstream\fR (0 .. 31) to stdout
 .TP
 \fB-v \fIstream\fB\fR
-Output video \fIstream\fR to stdout
+Output video \fIstream\fR (0 .. 15) to stdout
 .TP
 \fB-o \fIFILE\fB\fR
 output the previous stream to \fIFILE\fR instead of stdout
@@ -31,6 +31,9 @@ skip to first valid header -- ensures mplex can handle output
 \fB-m\fR
 output mplex offset to stdout
 .TP
+\fB-u\fR
+do not output messages about unrecognized headers
+.TP
 \fB-h\fR
 show short help
 .SH "USAGE"
diff --git a/doc/spumux.1 b/doc/spumux.1
index c9630a2..2e18b82 100644
--- a/doc/spumux.1
+++ b/doc/spumux.1
@@ -3,7 +3,7 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "SPUMUX" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "SPUMUX" "1" "Fri Dec 30 19:47:26 CET 2005" "" "DVDAuthor Man Pages"
 
 .SH NAME
 spumux \- generates and multiplexes subtitles into an existing mpeg2 program stream
@@ -236,4 +236,4 @@ with "a", the last component is the alpha (transparency) value.
 Note that alpha values are meaningless for the "transparent" attribute on the <spu>
 tag above.
 <marc.leeman at gmail.com>
-MarcLeeman2003Marc LeemanFri Dec 30 19:47:26 CET 2005
\ No newline at end of file
+MarcLeeman2003Marc Leeman
\ No newline at end of file
diff --git a/doc/spumux.xsd b/doc/spumux.xsd
index 2ecf4b4..f8305ce 100644
--- a/doc/spumux.xsd
+++ b/doc/spumux.xsd
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
-
   <xsd:annotation>
     <xsd:documentation xml:lang="en">
      XML Schema Definition for spumux.
@@ -12,12 +12,22 @@
     </xsd:documentation>
   </xsd:annotation>
 
+  <xsd:include schemaLocation="common.xsd"/>
+
   <xsd:element name="subpictures" type="SubpicturesType"/>
 
   <xsd:complexType name="SubpicturesType">
     <xsd:sequence>
       <xsd:element name="stream" type="StreamType"/>
     </xsd:sequence>
+    <xsd:attribute name="format">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:token">
+          <xsd:enumeration value="NTSC"/>
+          <xsd:enumeration value="PAL"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
   </xsd:complexType>
 
   <xsd:complexType name="StreamType">
@@ -42,7 +52,7 @@
     <xsd:attribute name="highlight" type="xsd:string"/>
     <xsd:attribute name="select" type="xsd:string"/>
     <xsd:attribute name="transparent" type="xsd:string"/>
-    <xsd:attribute name="force" type="xsd:string"/>
+    <xsd:attribute name="force" type="isOnType"/>
     <xsd:attribute name="autooutline" type="xsd:string"/>
     <xsd:attribute name="outlinewidth" type="xsd:string"/>
     <!-- [ autoorder="rows" | autoorder="columns" ] -->
@@ -80,8 +90,19 @@
     <xsd:attribute name="filename" type="xsd:string"/>
     <xsd:attribute name="characterset" type="xsd:string"/>
     <xsd:attribute name="fontsize" type="xsd:string"/>
-    <xsd:attribute name="force" type="xsd:string"/>
+    <xsd:attribute name="force" type="isOnType"/>
     <xsd:attribute name="font" type="xsd:string"/>
+    <xsd:attribute name="fill-color" type="xsd:string"/>
+    <xsd:attribute name="outline-color" type="xsd:string"/>
+    <xsd:attribute name="outline-thickness" type="xsd:float"/>
+    <xsd:attribute name="shadow-color" type="xsd:string"/>
+    <xsd:attribute name="shadow-offset">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:token">
+          <xsd:pattern value="[+-][0-9]+, [+-][0-9]+"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
     <xsd:attribute name="horizontal-alignment" type="xsd:string"/>
     <xsd:attribute name="vertical-alignment" type="xsd:string"/>
     <xsd:attribute name="left-margin" type="xsd:string"/>
@@ -92,6 +113,14 @@
     <xsd:attribute name="movie-fps" type="xsd:string"/>
     <xsd:attribute name="movie-width" type="xsd:string"/>
     <xsd:attribute name="movie-height" type="xsd:string"/>
+    <xsd:attribute name="aspect">
+      <xsd:simpleType>
+        <xsd:restriction base="xsd:token">
+          <xsd:enumeration value="16:9"/>
+          <xsd:enumeration value="4:3"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+    </xsd:attribute>
   </xsd:complexType>
 
 </xsd:schema>
diff --git a/doc/spuunmux.1 b/doc/spuunmux.1
index b2f6d8b..ba34490 100644
--- a/doc/spuunmux.1
+++ b/doc/spuunmux.1
@@ -3,7 +3,7 @@
 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
 .\" Please send any bug reports, improvements, comments, patches, 
 .\" etc. to Steve Cheng <steve at ggi-project.org>.
-.TH "SPUUNMUX" "1" "23 October 2010" "" "DVDAuthor Man Pages"
+.TH "SPUUNMUX" "1" "Fri Dec 30 19:47:26 CET 2005" "" "DVDAuthor Man Pages"
 
 .SH NAME
 spuunmux \- demultiplexes subtitles from an existing mpeg2 program stream
diff --git a/src/Makefile.am b/src/Makefile.am
index eaee55c..c7f89a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,12 +27,13 @@ spumux_SOURCES = subgen.c subgen.h rgb.h \
     conffile.c conffile.h compat.c compat.h common.h \
     subrender.c subrender.h subreader.c subreader.h subfont.c subfont.h
 spumux_LDADD = $(XML_LIBS) $(MAGICK_LIBS) $(FREETYPE_LIBS) \
-    $(FRIBIDI_LIBS) $(FONTCONFIG_LIBS) $(LIBICONV)
+    $(FRIBIDI_LIBS) $(FONTCONFIG_LIBS) $(LIBICONV) -lm
 
 spuunmux_SOURCES = spuunmux.c rgb.h compat.c compat.h common.h conffile.h conffile.c
-spuunmux_LDADD = $(LIBICONV) -lpng -lz -lm
+spuunmux_CFLAGS = @LIBPNG_CFLAGS@ $(AM_CFLAGS)
+spuunmux_LDADD = $(LIBICONV) @LIBPNG_LIBS@
 
-mpeg2desc_SOURCES = mpeg2desc.c compat.c
+mpeg2desc_SOURCES = common.h mpeg2desc.c compat.c
 mpeg2desc_LDADD = $(LIBICONV)
 
 edit = sed \
diff --git a/src/Makefile.in b/src/Makefile.in
index d03ab1f..13aff8b 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -74,10 +91,12 @@ spumux_OBJECTS = $(am_spumux_OBJECTS)
 spumux_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am_spuunmux_OBJECTS = spuunmux.$(OBJEXT) compat.$(OBJEXT) \
-	conffile.$(OBJEXT)
+am_spuunmux_OBJECTS = spuunmux-spuunmux.$(OBJEXT) \
+	spuunmux-compat.$(OBJEXT) spuunmux-conffile.$(OBJEXT)
 spuunmux_OBJECTS = $(am_spuunmux_OBJECTS)
 spuunmux_DEPENDENCIES = $(am__DEPENDENCIES_1)
+spuunmux_LINK = $(CCLD) $(spuunmux_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -99,6 +118,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 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; }; \
+  }
 SCRIPTS = $(nodist_bin_SCRIPTS)
 DEFAULT_INCLUDES = -I. at am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
@@ -112,6 +137,11 @@ SOURCES = $(dvdauthor_SOURCES) $(dvdunauthor_SOURCES) \
 	$(mpeg2desc_SOURCES) $(spumux_SOURCES) $(spuunmux_SOURCES)
 DIST_SOURCES = $(dvdauthor_SOURCES) $(dvdunauthor_SOURCES) \
 	$(mpeg2desc_SOURCES) $(spumux_SOURCES) $(spuunmux_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -151,6 +181,8 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
 LIBS = @LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBOBJS = @LTLIBOBJS@
@@ -249,11 +281,12 @@ spumux_SOURCES = subgen.c subgen.h rgb.h \
     subrender.c subrender.h subreader.c subreader.h subfont.c subfont.h
 
 spumux_LDADD = $(XML_LIBS) $(MAGICK_LIBS) $(FREETYPE_LIBS) \
-    $(FRIBIDI_LIBS) $(FONTCONFIG_LIBS) $(LIBICONV)
+    $(FRIBIDI_LIBS) $(FONTCONFIG_LIBS) $(LIBICONV) -lm
 
 spuunmux_SOURCES = spuunmux.c rgb.h compat.c compat.h common.h conffile.h conffile.c
-spuunmux_LDADD = $(LIBICONV) -lpng -lz -lm
-mpeg2desc_SOURCES = mpeg2desc.c compat.c
+spuunmux_CFLAGS = @LIBPNG_CFLAGS@ $(AM_CFLAGS)
+spuunmux_LDADD = $(LIBICONV) @LIBPNG_LIBS@
+mpeg2desc_SOURCES = common.h mpeg2desc.c compat.c
 mpeg2desc_LDADD = $(LIBICONV)
 edit = sed \
     -e 's, at sysconfdir\@,$(sysconfdir),g' \
@@ -303,10 +336,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -320,8 +351,11 @@ distclean-hdr:
 	-rm -f config.h stamp-h1
 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; \
@@ -355,25 +389,28 @@ uninstall-binPROGRAMS:
 
 clean-binPROGRAMS:
 	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-dvdauthor$(EXEEXT): $(dvdauthor_OBJECTS) $(dvdauthor_DEPENDENCIES) 
+dvdauthor$(EXEEXT): $(dvdauthor_OBJECTS) $(dvdauthor_DEPENDENCIES) $(EXTRA_dvdauthor_DEPENDENCIES) 
 	@rm -f dvdauthor$(EXEEXT)
 	$(LINK) $(dvdauthor_OBJECTS) $(dvdauthor_LDADD) $(LIBS)
-dvdunauthor$(EXEEXT): $(dvdunauthor_OBJECTS) $(dvdunauthor_DEPENDENCIES) 
+dvdunauthor$(EXEEXT): $(dvdunauthor_OBJECTS) $(dvdunauthor_DEPENDENCIES) $(EXTRA_dvdunauthor_DEPENDENCIES) 
 	@rm -f dvdunauthor$(EXEEXT)
 	$(LINK) $(dvdunauthor_OBJECTS) $(dvdunauthor_LDADD) $(LIBS)
-mpeg2desc$(EXEEXT): $(mpeg2desc_OBJECTS) $(mpeg2desc_DEPENDENCIES) 
+mpeg2desc$(EXEEXT): $(mpeg2desc_OBJECTS) $(mpeg2desc_DEPENDENCIES) $(EXTRA_mpeg2desc_DEPENDENCIES) 
 	@rm -f mpeg2desc$(EXEEXT)
 	$(LINK) $(mpeg2desc_OBJECTS) $(mpeg2desc_LDADD) $(LIBS)
-spumux$(EXEEXT): $(spumux_OBJECTS) $(spumux_DEPENDENCIES) 
+spumux$(EXEEXT): $(spumux_OBJECTS) $(spumux_DEPENDENCIES) $(EXTRA_spumux_DEPENDENCIES) 
 	@rm -f spumux$(EXEEXT)
 	$(LINK) $(spumux_OBJECTS) $(spumux_LDADD) $(LIBS)
-spuunmux$(EXEEXT): $(spuunmux_OBJECTS) $(spuunmux_DEPENDENCIES) 
+spuunmux$(EXEEXT): $(spuunmux_OBJECTS) $(spuunmux_DEPENDENCIES) $(EXTRA_spuunmux_DEPENDENCIES) 
 	@rm -f spuunmux$(EXEEXT)
-	$(LINK) $(spuunmux_OBJECTS) $(spuunmux_LDADD) $(LIBS)
+	$(spuunmux_LINK) $(spuunmux_OBJECTS) $(spuunmux_LDADD) $(LIBS)
 install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(nodist_bin_SCRIPTS)'; 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 \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -401,9 +438,7 @@ uninstall-nodist_binSCRIPTS:
 	@list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
 	files=`for p in $$list; do echo "$$p"; done | \
 	       sed -e 's,.*/,,;$(transform)'`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+	dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -425,7 +460,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dvdvob.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mpeg2desc.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/readxml.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spuunmux.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spuunmux-compat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spuunmux-conffile.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/spuunmux-spuunmux.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/subfont.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/subgen-encode.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/subgen-image.Po at am__quote@
@@ -448,6 +485,48 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
+spuunmux-spuunmux.o: spuunmux.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-spuunmux.o -MD -MP -MF $(DEPDIR)/spuunmux-spuunmux.Tpo -c -o spuunmux-spuunmux.o `test -f 'spuunmux.c' || echo '$(srcdir)/'`spuunmux.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-spuunmux.Tpo $(DEPDIR)/spuunmux-spuunmux.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='spuunmux.c' object='spuunmux-spuunmux.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-spuunmux.o `test -f 'spuunmux.c' || echo '$(srcdir)/'`spuunmux.c
+
+spuunmux-spuunmux.obj: spuunmux.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-spuunmux.obj -MD -MP -MF $(DEPDIR)/spuunmux-spuunmux.Tpo -c -o spuunmux-spuunmux.obj `if test -f 'spuunmux.c'; then $(CYGPATH_W) 'spuunmux.c'; else $(CYGPATH_W) '$(srcdir)/spuunmux.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-spuunmux.Tpo $(DEPDIR)/spuunmux-spuunmux.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='spuunmux.c' object='spuunmux-spuunmux.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-spuunmux.obj `if test -f 'spuunmux.c'; then $(CYGPATH_W) 'spuunmux.c'; else $(CYGPATH_W) '$(srcdir)/spuunmux.c'; fi`
+
+spuunmux-compat.o: compat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-compat.o -MD -MP -MF $(DEPDIR)/spuunmux-compat.Tpo -c -o spuunmux-compat.o `test -f 'compat.c' || echo '$(srcdir)/'`compat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-compat.Tpo $(DEPDIR)/spuunmux-compat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='compat.c' object='spuunmux-compat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-compat.o `test -f 'compat.c' || echo '$(srcdir)/'`compat.c
+
+spuunmux-compat.obj: compat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-compat.obj -MD -MP -MF $(DEPDIR)/spuunmux-compat.Tpo -c -o spuunmux-compat.obj `if test -f 'compat.c'; then $(CYGPATH_W) 'compat.c'; else $(CYGPATH_W) '$(srcdir)/compat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-compat.Tpo $(DEPDIR)/spuunmux-compat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='compat.c' object='spuunmux-compat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-compat.obj `if test -f 'compat.c'; then $(CYGPATH_W) 'compat.c'; else $(CYGPATH_W) '$(srcdir)/compat.c'; fi`
+
+spuunmux-conffile.o: conffile.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-conffile.o -MD -MP -MF $(DEPDIR)/spuunmux-conffile.Tpo -c -o spuunmux-conffile.o `test -f 'conffile.c' || echo '$(srcdir)/'`conffile.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-conffile.Tpo $(DEPDIR)/spuunmux-conffile.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='conffile.c' object='spuunmux-conffile.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-conffile.o `test -f 'conffile.c' || echo '$(srcdir)/'`conffile.c
+
+spuunmux-conffile.obj: conffile.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -MT spuunmux-conffile.obj -MD -MP -MF $(DEPDIR)/spuunmux-conffile.Tpo -c -o spuunmux-conffile.obj `if test -f 'conffile.c'; then $(CYGPATH_W) 'conffile.c'; else $(CYGPATH_W) '$(srcdir)/conffile.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/spuunmux-conffile.Tpo $(DEPDIR)/spuunmux-conffile.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='conffile.c' object='spuunmux-conffile.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spuunmux_CFLAGS) $(CFLAGS) -c -o spuunmux-conffile.obj `if test -f 'conffile.c'; then $(CYGPATH_W) 'conffile.c'; else $(CYGPATH_W) '$(srcdir)/conffile.c'; fi`
+
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -547,10 +626,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
diff --git a/src/compat.c b/src/compat.c
index 4ef76da..bf9bcac 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -14,6 +14,26 @@
     Useful string stuff
 */
 
+void strconcat
+  (
+    char * dest,
+    size_t maxdestlen,
+    const char * src
+  )
+  /* appends null-terminated src onto dest, ensuring length of contents
+    of latter (including terminating null) do not exceed maxdestlen. */
+  {
+    const size_t destlen = strlen(dest);
+    size_t srclen = strlen(src);
+    assert(destlen < maxdestlen);
+    if (srclen > maxdestlen - 1 - destlen)
+      {
+        srclen = maxdestlen - 1 - destlen;
+      } /*if*/
+    memcpy(dest + destlen, src, srclen);
+    dest[destlen + srclen] = 0;
+  } /*strconcat*/
+
 unsigned int strtounsigned
   (
     const char * s,
diff --git a/src/compat.h b/src/compat.h
index 12c7feb..126dcd7 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -98,9 +98,6 @@ typedef bool _Bool;
 
 #ifdef HAVE_FRIBIDI
 #define BUILDSPEC_FRIBIDI " fribidi"
-#ifndef HAVE_FRIBIDI2
-#define FriBidiParType FriBidiCharType
-#endif
 #else
 #define BUILDSPEC_FRIBIDI ""
 #endif
@@ -121,6 +118,15 @@ extern const char * default_charset;
 
 #endif /*HAVE_ICONV*/
 
+void strconcat
+  (
+    char * dest,
+    size_t maxdestlen,
+    const char * src
+  );
+  /* appends null-terminated src onto dest, ensuring length of contents
+    of latter (including terminating null) do not exceed maxdestlen. */
+
 unsigned int strtounsigned
   (
     const char * s,
diff --git a/src/conffile.c b/src/conffile.c
index a9b6346..0a6c14c 100644
--- a/src/conffile.c
+++ b/src/conffile.c
@@ -57,9 +57,9 @@ static char * xdg_make_home_relative
         strncpy(result, home, result_len);
         if (result[strlen(result) - 1] != '/')
           {
-            strncat(result, "/", result_len);
+            strconcat(result, result_len, "/");
           } /*if*/
-        strncat(result, path, result_len);
+        strconcat(result, result_len, path);
       }
     while (false);
     return
@@ -76,6 +76,11 @@ static char * xdg_get_config_home(void)
     if (result == 0)
       {
         to_dispose = xdg_make_home_relative(".config");
+        if (to_dispose == 0)
+          {
+            return
+                result;
+          }
         result = to_dispose;
       } /*if*/
     if (result != 0 && to_dispose == 0)
@@ -213,9 +218,9 @@ static int xdg_for_each_config_found_try_component
         thispath[dirpath_len] = 0;
         if (dirpath_len != 0 && dirpath[dirpath_len - 1] != '/')
           {
-            strncat(thispath, "/", thispath_maxlen);
+            strconcat(thispath, thispath_maxlen, "/");
           } /*if*/
-        strncat(thispath, context->itempath, thispath_maxlen);
+        strconcat(thispath, thispath_maxlen, context->itempath);
         if (stat(thispath, &statinfo) == 0)
           {
             status = context->action(thispath, context->actionarg);
@@ -248,7 +253,7 @@ static int xdg_for_each_config_found
     context.actionarg = actionarg;
     do /*once*/
       {
-        if (forwards)
+        if (home_path != 0 && forwards)
           {
             status = xdg_for_each_config_found_try_component
               (
@@ -269,7 +274,7 @@ static int xdg_for_each_config_found
           );
         if (status != 0)
             break;
-        if (!forwards)
+        if (home_path != 0 && !forwards)
           {
             status = xdg_for_each_config_found_try_component
               (
@@ -282,7 +287,8 @@ static int xdg_for_each_config_found
           } /*if*/
       }
     while (false);
-    free((void *)home_path);
+    if (home_path != 0)
+        free((void *)home_path);
     free((void *)search_path);
     return
         status;
diff --git a/src/config.h.in b/src/config.h.in
index 90144fa..775ad66 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -16,9 +16,6 @@
 /* whether FriBidi is available */
 #undef HAVE_FRIBIDI
 
-/* Whether Fribidi is version 2 */
-#undef HAVE_FRIBIDI2
-
 /* Define to 1 if you have the <ft2build.h> header file. */
 #undef HAVE_FT2BUILD_H
 
@@ -49,6 +46,9 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* define to 1 if C compiler allows nested routines */
+#undef HAVE_NESTED_ROUTINES
+
 /* Define to 1 if you have the `setmode' function. */
 #undef HAVE_SETMODE
 
@@ -115,6 +115,11 @@
 /* Version number of package */
 #undef VERSION
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
diff --git a/src/da-internal.h b/src/da-internal.h
index 2efdfcc..d146ba8 100644
--- a/src/da-internal.h
+++ b/src/da-internal.h
@@ -116,6 +116,9 @@ struct cell {
     int pauselen;
     int scellid; /* ID assigned to cell */
     int ecellid; /* ID assigned to next cell */
+      /* DVD-Video spec allows for cells to be grouped into programs nonsequentially,
+        and for the same cell to be part of more than one program. dvdauthor doesn't
+        currently support any of that, so cell IDs will always be sequential. */
     struct vm_statement *commands;
 };
 
@@ -190,7 +193,7 @@ struct pgcgroup { /* common info across a set of menus or a set of titles (<menu
     int numpgcs;
     int allentries; /* mask of entry types present */
     int numentries; /* number of entry types present */
-    struct vobgroup *vg; /* only for pstype==VTYPE_VTS, otherwise shared menugroup.vg field is used */
+    struct vobgroup *pg_vg; /* only for pstype==VTYPE_VTS, otherwise shared menugroup.mg_vg field is used */
 };
 
 struct langgroup { /* contents of a <menus> directive */
@@ -201,8 +204,8 @@ struct langgroup { /* contents of a <menus> directive */
 struct menugroup { /* contents specific to all collections of <menus> directives, either VTSM or VMGM */
     int numgroups; /* length of groups array */
     struct langgroup *groups; /* array, one entry per <menus> directive */
-    struct vobgroup *vg; /* common among all groups[i]->pg elements */
-      /* fixme: I don't think this works right with multiple <menus> ,,, </menus> sections,
+    struct vobgroup *mg_vg; /* common among all groups[i]->pg elements */
+      /* fixme: I don't think this works right with multiple <menus> ... </menus> sections,
         which the XML does allow */
 };
 
@@ -238,10 +241,10 @@ struct toc_summary {
     int numvts;
 };
 
-struct workset {
-    const struct toc_summary *titlesets;
-    const struct menugroup *menus;
-    const struct pgcgroup *titles;
+struct workset { /* overall parameters for generation of a domain (VMG or VTS) */
+    const struct toc_summary *titlesets; /* VMG only */
+    const struct menugroup *menus; /* VMG and VTS */
+    const struct pgcgroup *titles; /* VTS only */
 };
 
 /* following implemented in dvdauthor.c */
diff --git a/src/dvdauthor.c b/src/dvdauthor.c
index 3284580..d2e3539 100644
--- a/src/dvdauthor.c
+++ b/src/dvdauthor.c
@@ -1722,7 +1722,7 @@ struct pgcgroup *pgcgroup_new(vtypes type)
     memset(ps,0,sizeof(struct pgcgroup));
     ps->pstype=type;
     if (type == VTYPE_VTS)
-        ps->vg=vobgroup_new();
+        ps->pg_vg = vobgroup_new();
     return ps;
   }
 
@@ -1737,7 +1737,7 @@ void pgcgroup_free(struct pgcgroup *pg)
                 pgc_free(pg->pgcs[i]);
             free(pg->pgcs);
           } /*if*/
-        vobgroup_free(pg->vg);
+        vobgroup_free(pg->pg_vg);
         free(pg);
       } /*if*/
   } /*pgcgroup_free*/
@@ -1753,29 +1753,29 @@ void pgcgroup_add_pgc(struct pgcgroup *ps,struct pgc *p)
 
 int pgcgroup_set_video_attr(struct pgcgroup *va,int attr,const char *s)
 {
-    return vobgroup_set_video_attr(va->vg,attr,s);
+    return vobgroup_set_video_attr(va->pg_vg,attr,s);
 }
 
 int pgcgroup_set_audio_attr(struct pgcgroup *va,int attr,const char *s,int ch)
 {
-    return vobgroup_set_audio_attr(va->vg,attr,s,ch);
+    return vobgroup_set_audio_attr(va->pg_vg,attr,s,ch);
 }
 
 int pgcgroup_set_subpic_attr(struct pgcgroup *va,int attr,const char *s,int ch)
 {
-    return vobgroup_set_subpic_attr(va->vg,attr,s,ch);
+    return vobgroup_set_subpic_attr(va->pg_vg,attr,s,ch);
 }
 
 int pgcgroup_set_subpic_stream(struct pgcgroup *va,int ch,const char *m,int id)
 {
-    return vobgroup_set_subpic_stream(va->vg,ch,m,id);
+    return vobgroup_set_subpic_stream(va->pg_vg,ch,m,id);
 }
 
 struct menugroup *menugroup_new()
 {
     struct menugroup *mg=malloc(sizeof(struct menugroup));
     memset(mg,0,sizeof(struct menugroup));
-    mg->vg=vobgroup_new();
+    mg->mg_vg = vobgroup_new();
     return mg;
 }
 
@@ -1790,7 +1790,7 @@ void menugroup_free(struct menugroup *mg)
                 pgcgroup_free(mg->groups[i].pg);
             free(mg->groups);
           } /*if*/
-        vobgroup_free(mg->vg);
+        vobgroup_free(mg->mg_vg);
         free(mg);
       } /*if*/
   } /*menugroup_free*/
@@ -1813,22 +1813,22 @@ void menugroup_add_pgcgroup(struct menugroup *mg, const char *lang, struct pgcgr
 
 int menugroup_set_video_attr(struct menugroup *va,int attr,const char *s)
 {
-    return vobgroup_set_video_attr(va->vg,attr,s);
+    return vobgroup_set_video_attr(va->mg_vg,attr,s);
 }
 
 int menugroup_set_audio_attr(struct menugroup *va,int attr,const char *s,int ch)
 {
-    return vobgroup_set_audio_attr(va->vg,attr,s,ch);
+    return vobgroup_set_audio_attr(va->mg_vg,attr,s,ch);
 }
 
 int menugroup_set_subpic_attr(struct menugroup *va,int attr,const char *s,int ch)
 {
-    return vobgroup_set_subpic_attr(va->vg,attr,s,ch);
+    return vobgroup_set_subpic_attr(va->mg_vg,attr,s,ch);
 }
 
 int menugroup_set_subpic_stream(struct menugroup *va,int ch,const char *m,int id)
 {
-    return vobgroup_set_subpic_stream(va->vg,ch,m,id);
+    return vobgroup_set_subpic_stream(va->mg_vg,ch,m,id);
 }
 
 void dvdauthor_enable_jumppad()
@@ -1850,7 +1850,7 @@ void dvdauthor_enable_allgprm()
 }
 
 void dvdauthor_vmgm_gen(struct pgc *fpc, struct menugroup *menus, const char *fbase)
-  /* generates a VMG, taking into account all already-generated titlesets. */
+  /* generates the VMG, taking into account all already-generated titlesets. */
   {
     DIR *d;
     struct dirent *de;
@@ -1870,7 +1870,7 @@ void dvdauthor_vmgm_gen(struct pgc *fpc, struct menugroup *menus, const char *fb
     for (i = 0; i < menus->numgroups; i++)
       {
         validatesummary(menus->groups[i].pg);
-        pgcgroup_createvobs(menus->groups[i].pg, menus->vg);
+        pgcgroup_createvobs(menus->groups[i].pg, menus->mg_vg);
         forceaddentry(menus->groups[i].pg, 4); /* entry=title */
       } /*for*/
     fprintf(stderr, "INFO: dvdauthor creating table of contents\n");
@@ -1930,21 +1930,21 @@ void dvdauthor_vmgm_gen(struct pgc *fpc, struct menugroup *menus, const char *fb
         fprintf(stderr, "ERR:  No .IFO files to process\n");
         exit(1);
       } /*if*/
-    if (menus->vg->numvobs != 0)
+    if (menus->mg_vg->numvobs != 0)
       {
         fprintf(stderr, "INFO: Creating menu for TOC\n");
         snprintf(fbuf, sizeof fbuf, "%s/VIDEO_TS.VOB", vtsdir);
-        FindVobus(fbuf, menus->vg, VTYPE_VMGM);
-        MarkChapters(menus->vg);
-        setattr(menus->vg, VTYPE_VMGM);
+        FindVobus(fbuf, menus->mg_vg, VTYPE_VMGM);
+        MarkChapters(menus->mg_vg);
+        setattr(menus->mg_vg, VTYPE_VMGM);
         fprintf(stderr, "\n");
-        FixVobus(fbuf, menus->vg, &ws, VTYPE_VMGM);
+        FixVobus(fbuf, menus->mg_vg, &ws, VTYPE_VMGM);
       }
     else
       /* unconditional because there will always be at least one PGC,
         namely the FPC (explicit or default) */
       {
-        set_video_format_attr(menus->vg, VTYPE_VMGM); /* for the sake of buildtimeeven */
+        set_video_format_attr(menus->mg_vg, VTYPE_VMGM); /* for the sake of buildtimeeven */
       } /*if*/
   /* (re)generate VMG IFO */
     snprintf(fbuf, sizeof fbuf, "%s/VIDEO_TS.IFO", vtsdir);
@@ -1973,12 +1973,12 @@ void dvdauthor_vts_gen(struct menugroup *menus, struct pgcgroup *titles, const c
     for (i = 0; i < menus->numgroups; i++)
       {
         validatesummary(menus->groups[i].pg);
-        pgcgroup_createvobs(menus->groups[i].pg, menus->vg);
+        pgcgroup_createvobs(menus->groups[i].pg, menus->mg_vg);
         forceaddentry(menus->groups[i].pg, 0x80); /* entry=ptt? */
         checkaddentry(menus->groups[i].pg, 0x08); /* entry=root */
       } /*for*/
     validatesummary(titles);
-    pgcgroup_createvobs(titles, titles->vg);
+    pgcgroup_createvobs(titles, titles->pg_vg);
     if (titles->numpgcs == 0)
       {
         fprintf(stderr, "ERR:  no titles defined\n");
@@ -1990,26 +1990,26 @@ void dvdauthor_vts_gen(struct menugroup *menus, struct pgcgroup *titles, const c
         snprintf(realfbase, sizeof realfbase, "%s/VIDEO_TS/VTS_%02d", fbase, vtsnum);
         fbase = realfbase;
       } /*if*/
-    if (menus->vg->numvobs != 0)
+    if (menus->mg_vg->numvobs != 0)
       {
-        FindVobus(fbase, menus->vg, VTYPE_VTSM);
-        MarkChapters(menus->vg);
-        setattr(menus->vg, VTYPE_VTSM);
+        FindVobus(fbase, menus->mg_vg, VTYPE_VTSM);
+        MarkChapters(menus->mg_vg);
+        setattr(menus->mg_vg, VTYPE_VTSM);
       }
-    else if (menus->vg->numallpgcs != 0)
+    else if (menus->mg_vg->numallpgcs != 0)
       {
-        set_video_format_attr(menus->vg, VTYPE_VTSM); /* for the sake of buildtimeeven */
+        set_video_format_attr(menus->mg_vg, VTYPE_VTSM); /* for the sake of buildtimeeven */
       } /*if*/
-    FindVobus(fbase, titles->vg, VTYPE_VTS);
-    MarkChapters(titles->vg);
-    setattr(titles->vg, VTYPE_VTS);
-    if (!menus->vg->numvobs) // for undefined menus, we'll just copy the video type of the title
+    FindVobus(fbase, titles->pg_vg, VTYPE_VTS);
+    MarkChapters(titles->pg_vg);
+    setattr(titles->pg_vg, VTYPE_VTS);
+    if (!menus->mg_vg->numvobs) // for undefined menus, we'll just copy the video type of the title
       {
-        menus->vg->vd = titles->vg->vd;
+        menus->mg_vg->vd = titles->pg_vg->vd;
       } /*if*/
     fprintf(stderr, "\n");
     WriteIFOs(fbase, &ws);
-    if (menus->vg->numvobs)
-        FixVobus(fbase, menus->vg, &ws, VTYPE_VTSM);
-    FixVobus(fbase, titles->vg, &ws, VTYPE_VTS);
+    if (menus->mg_vg->numvobs)
+        FixVobus(fbase, menus->mg_vg, &ws, VTYPE_VTSM);
+    FixVobus(fbase, titles->pg_vg, &ws, VTYPE_VTS);
   } /*dvdauthor_vts_gen*/
diff --git a/src/dvdcli.c b/src/dvdcli.c
index 2bf8af2..059d895 100644
--- a/src/dvdcli.c
+++ b/src/dvdcli.c
@@ -335,14 +335,14 @@ static void usage()
                 fprintf(stderr, "ERR:  Must first specify -t, -m, or -x.\n"); \
                 return 1;                                                     \
               } /*if*/                                                        \
-            if (istoc && curva)                                               \
+            if (istoc && istitle)                                             \
               {                                                               \
                 fprintf(stderr, "ERR:  TOC cannot have titles\n");            \
                 return 1;                                                     \
               } /*if*/                                                        \
-            if (!vc)                                                          \
+            if (!va[istitle])                                                          \
               {                                                               \
-                va[curva] = vc = pgcgroup_new((int)istoc + 1 - curva);        \
+                va[istitle] = pgcgroup_new((int)istoc + 1 - (int)istitle); \
               } /*if*/
 
 #define MAINDEFPGC                                                   \
@@ -358,7 +358,7 @@ static void usage()
 #define FLUSHPGC                                                     \
             if (curpgc)                                              \
               {                                                      \
-                pgcgroup_add_pgc(va[curva], curpgc);                 \
+                pgcgroup_add_pgc(va[istitle], curpgc);               \
                 curpgc = 0;                                          \
               } /*if*/
 
@@ -368,10 +368,9 @@ int main(int argc, char **argv)
     struct menugroup *mg;
     char *fbase = 0; /* output directory name */
     char * xmlfile = 0; /* name of XML control file, if any */
-    int curva = 1; /* index into va */
+    bool istitle = true; /* index into va */
     bool istoc = false, /* true if doing VMG, false if doing titleset */
         usedtocflag = false; /* indicates that istoc can no longer be changed */
-    int l;
     struct pgc *curpgc = 0,* fpc = 0;
     struct source *curvob = 0;
 #ifdef HAVE_GETOPT_LONG
@@ -433,7 +432,6 @@ int main(int argc, char **argv)
 
     while (true)
       {
-        struct pgcgroup *vc = va[curva];
         int c = GETOPTFUNC(argc, argv, "f:o:O:v:a:s:hc:Cp:Pmtb:Ti:e:x:jgn");
         if (c == -1)
             break;
@@ -500,7 +498,7 @@ int main(int argc, char **argv)
             FLUSHPGC
             usedtocflag = true; // force -T to occur before -m
             hadchapter = chapters_neither; /* reset for new menu */
-            curva = 0;
+            istitle = false;
         break;
 
         case 't':
@@ -513,25 +511,25 @@ int main(int argc, char **argv)
             FLUSHPGC
             usedtocflag = true;
             hadchapter = chapters_neither; /* reset for new title */
-            curva = 1;
+            istitle = true;
         break;
             
         case 'a':
             NOXML
             MAINDEF
-            parseaudioopts(vc, optarg);
+            parseaudioopts(va[istitle], optarg);
         break;
         
         case 'v':
             NOXML
             MAINDEF
-            parsevideoopts(vc, optarg);
+            parsevideoopts(va[istitle], optarg);
         break;
 
         case 's':
             NOXML
             MAINDEF
-            parsesubpictureopts(vc, optarg);
+            parsesubpictureopts(va[istitle], optarg);
         break;
 
         case 'b':
@@ -566,7 +564,7 @@ int main(int argc, char **argv)
         case 'e':
             NOXML
             MAINDEFPGC
-            if (curva)
+            if (istitle)
               {
                 fprintf(stderr, "ERR:  Cannot specify an entry for a title.\n");
                 return 1;
@@ -621,7 +619,7 @@ int main(int argc, char **argv)
                 fprintf(stderr, "ERR:  cannot list -c twice for one file.\n");
                 return 1;
               } /*if*/
-            MAINDEFVOB;
+            MAINDEFVOB
             hadchapter = chapters_chapters;
             if (optarg)
                 parsechapters(optarg, curvob, 0);
@@ -646,7 +644,7 @@ int main(int argc, char **argv)
             fprintf(stderr, "ERR:  Chapters defined without a file source.\n");
             return 1;
           } /*if*/
-        FLUSHPGC;
+        FLUSHPGC
         if (!va[0])
           {
             va[0] = pgcgroup_new(istoc ? VTYPE_VMGM : VTYPE_VTSM);
@@ -671,7 +669,7 @@ int main(int argc, char **argv)
           } /*if*/
         if (fbase)
           {
-            l = strlen(fbase);
+            const int l = strlen(fbase);
             if (l && fbase[l - 1] == '/')
                 fbase[l - 1] = 0;
           } /*if*/
@@ -802,6 +800,26 @@ static void dvdauthor_allgprm(const char *s)
         dvdauthor_enable_allgprm();
 }
 
+static void dvdauthor_video_format
+  (
+    const char * s
+  )
+  {
+    if (!strcmp(s, "ntsc") || !strcmp(s, "NTSC"))
+      {
+        default_video_format = VF_NTSC;
+      }
+    else if (!strcmp(s, "pal") || !strcmp(s, "PAL"))
+      {
+        default_video_format = VF_PAL;
+      }
+    else
+      {
+        fprintf(stderr, "ERR:  Unrecognized video format \"%s\"\n", s);
+        parser_err = true;
+      } /*if*/
+  } /*dvdauthor_video_format*/
+
 static void getfbase()
   {
     if (!writeoutput)
@@ -1340,6 +1358,7 @@ static struct elemattr attrs[]={
     {"dvdauthor","dest",dvdauthor_outputdir},
     {"dvdauthor","jumppad",dvdauthor_jumppad},
     {"dvdauthor","allgprm",dvdauthor_allgprm},
+    {"dvdauthor","format",dvdauthor_video_format},
 
     {"menus","lang",menus_lang},
 
diff --git a/src/dvdcompile.c b/src/dvdcompile.c
index be57c82..293613b 100644
--- a/src/dvdcompile.c
+++ b/src/dvdcompile.c
@@ -488,7 +488,7 @@ static unsigned char *compilecs
                       /* put new value/regnr into audio/subpicture/angle field as appropriate */
                     buf += 8;
                   }
-                else
+                else /* complex expression */
                   {
                     const int r = nexttarget(0);
                     buf = compileexpr(buf, r, cs->param);
@@ -520,7 +520,7 @@ static unsigned char *compilecs
                           /* SetHL_BTNN direct */
                     buf += 8;
                   }
-                else
+                else /* complex expression */
                   {
                     const int r = nexttarget(0);
                     buf = compileexpr(buf, r, cs->param);
@@ -761,7 +761,7 @@ static unsigned char *compilecs
               ||
                   i1 == 1 /*jump to VMGM*/ && i2 >= 128 /*title*/
               ||
-                  ismenu == VTYPE_VMGM && i2 >= 128 && cs->i3 /*chapter/program/cell*/
+                  ismenu == VTYPE_VMGM && i2 >= 128 /*title*/ && cs->i3 /*chapter/program/cell*/
               )
               {
                 //  VMGM    TS  TPGC    CHXX
@@ -781,12 +781,22 @@ static unsigned char *compilecs
                   {
                     if (!i1)
                         i1 = 1; /* make VMGM explicit */
-                    write8(buf, 0x71, 0x00, 0x00, 0x0F, i2, i1, 0x00, 0x00); buf += 8;
-                    write8(buf, 0x71, 0x00, 0x00, 0x0E, 0x00, cs->i3, 0x00, 0x00); buf += 8;
-                    write8(buf, 0x30, ismenu != VTYPE_VTS ? 0x06 : 0x08, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00); buf += 8;
+                    write8(buf, 0x71, 0x00, 0x00, 0x0F, i2, i1, 0x00, 0x00);
+                      /* g15 = i2 << 8 | i1 */
+                    buf += 8;
+                    write8(buf, 0x71, 0x00, 0x00, 0x0E, 0x00, cs->i3, 0x00, 0x00);
+                      /* g14 = cs->i3 */
+                    buf += 8;
+                    write8(buf, 0x30, ismenu != VTYPE_VTS ? 0x06 : 0x08, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00);
+                      /* JumpSS/CallSS VMGM menu entry title */
+                    buf += 8;
                   }
                 else
                   {
+                  /* JumpTT allows directly jumping from VMGM to any titleset, but that
+                    requires global title numbers, not titleset-local title numbers,
+                    and I only work these out later when putting together the final VMGM,
+                    which is why I can't handle it here without the jumppad */
                     fprintf(stderr, "ERR:  That form of jumping is not allowed\n");
                     return 0;
                   } /*if*/
@@ -927,7 +937,23 @@ static unsigned char *compilecs
                         return 0;
                       } /*if*/
                   } /*if*/
-                write8(buf, 0x30, ismenu == VTYPE_VMGM ? 0x02 : (cs->i3 ? 0x05 : 0x03), 0x00, cs->i3, 0x00, i2 - 128, 0x00, 0x00);
+                write8
+                  (
+                    buf,
+                    0x30,
+                    ismenu == VTYPE_VMGM ?
+                        0x02 /*JumpTT*/
+                    : cs->i3 ?
+                        0x05 /*JumpVTS_PTT*/
+                    :
+                        0x03 /*JumpVTS_TT*/,
+                    0x00,
+                    cs->i3, /* chapter if present */
+                    0x00,
+                    i2 - 128, /* title nr */
+                    0x00,
+                    0x00
+                  );
                 buf += 8;
               } /*if*/
           }
diff --git a/src/dvdifo.c b/src/dvdifo.c
index 07a8f0c..315eac2 100644
--- a/src/dvdifo.c
+++ b/src/dvdifo.c
@@ -204,7 +204,7 @@ static int get_pgc_duration_seconds(const struct pgcgroup *va, int c)
     // an exact multiple of 90090*units; if so, then the last entry of the
     // TMAPT table cannot be properly computed, because that entry will have
     // fallen off the end of the VOBU table
-    return pts_ticks_to_seconds(va->vg, getptsspan(va->pgcs[c]) - 1);
+    return pts_ticks_to_seconds(va->pg_vg, getptsspan(va->pgcs[c]) - 1);
   } /*get_pgc_duration_seconds*/
 
 static int secunit(int ns)
@@ -281,15 +281,15 @@ static void CreateTMAPT(FILE *h, const struct pgcgroup *va)
           /* write VTS_TMAP entries */
             const struct vobuinfo *vobu1;
             // I don't know why I ever did this
-            // ptsbase = -getframepts(va->vg);
+            // ptsbase = -getframepts(va->pg_vg);
             ptsbase = 0; // this matches Bullitt
-            vobu1 = globalfindvobu(thispgc, ptsbase + pts_seconds_to_ticks(va->vg, units));
+            vobu1 = globalfindvobu(thispgc, ptsbase + pts_seconds_to_ticks(va->pg_vg, units));
             for (j = 0; j < numtmapt; j++)
               {
                 const struct vobuinfo * const vobu2 = globalfindvobu
                   (
                     thispgc,
-                    ptsbase + pts_seconds_to_ticks(va->vg, (j + 2) * units)
+                    ptsbase + pts_seconds_to_ticks(va->pg_vg, (j + 2) * units)
                   );
                 write4(buf, vobu1->sector);
                 if (!vobu2 || vobu1->vobcellid != vobu2->vobcellid)
@@ -552,7 +552,7 @@ static bool needmenus(const struct menugroup *mg)
 {
     if (!mg ) return false;
     if( !mg->numgroups ) return false;
-    if( !mg->groups[0].pg->numpgcs ) return false;
+    if( !mg->groups[0].pg->numpgcs ) return false; /* fixme: what about checking rest of groups? */
     return true;
 }
 
@@ -588,33 +588,33 @@ static void WriteIFO(FILE *h, const struct workset *ws)
     if (jumppad || forcemenus)
       {
         write4(buf + 0xD8, nextsector); // VTSM_C_ADT
-        nextsector += CreateCellAddressTable(0, ws->menus->vg);
+        nextsector += CreateCellAddressTable(0, ws->menus->mg_vg);
 
         write4(buf + 0xDC, nextsector); // VTSM_VOBU_ADMAP
-        nextsector += numsectVOBUAD(ws->menus->vg);
+        nextsector += numsectVOBUAD(ws->menus->mg_vg);
       } /*if*/
 
     write4(buf + 0xE0, nextsector); // VTS_C_ADT
-    nextsector += CreateCellAddressTable(0, ws->titles->vg);
+    nextsector += CreateCellAddressTable(0, ws->titles->pg_vg);
 
     write4(buf + 0xE4, nextsector); // VTS_VOBU_ADMAP
-    nextsector += numsectVOBUAD(ws->titles->vg);
+    nextsector += numsectVOBUAD(ws->titles->pg_vg);
 
     write4(buf + 28, nextsector - 1); /* last sector of IFO */
     if (jumppad || forcemenus)
       {
         write4(buf + 0xC0, nextsector); /* start sector of menu VOB */
-        nextsector += getvoblen(ws->menus->vg);
+        nextsector += getvoblen(ws->menus->mg_vg);
       } /*if*/
     write4(buf + 0xC4, nextsector); /* start sector of title VOB */
     if (ws->titles->numpgcs)
-        nextsector += getvoblen(ws->titles->vg);
+        nextsector += getvoblen(ws->titles->pg_vg);
     nextsector += read4(buf + 28); /* offset by last sector of IFO */
     write4(buf + 12, nextsector); /* gives last sector of title set (last sector of BUP) */
 
     if (jumppad || forcemenus)
-        BuildAVInfo(buf + 256, ws->menus->vg);
-    BuildAVInfo(buf + 512, ws->titles->vg);
+        BuildAVInfo(buf + 256, ws->menus->mg_vg);
+    BuildAVInfo(buf + 512, ws->titles->pg_vg);
     nfwrite(buf, 2048, h);
 
     // sect 1: VTS_PTT_SRPT
@@ -631,11 +631,11 @@ static void WriteIFO(FILE *h, const struct workset *ws)
 
     if (jumppad || forcemenus)
       {
-        CreateCellAddressTable(h, ws->menus->vg);
-        CreateVOBUAD(h, ws->menus->vg);
+        CreateCellAddressTable(h, ws->menus->mg_vg);
+        CreateVOBUAD(h, ws->menus->mg_vg);
       } /*if*/
-    CreateCellAddressTable(h, ws->titles->vg);
-    CreateVOBUAD(h, ws->titles->vg);
+    CreateCellAddressTable(h, ws->titles->pg_vg);
+    CreateVOBUAD(h, ws->titles->pg_vg);
   } /*WriteIFO*/
 
 void WriteIFOs(const char *fbase, const struct workset *ws)
@@ -732,11 +732,11 @@ void TocGen(const struct workset *ws, const struct pgc *fpc, const char *fname)
         write4(buf + 0xd8, nextsector);
           /* sector pointer to VMGM_C_ADT (menu cell address table) */
           /* I make it follow VMG_VTS_ATRT */
-        nextsector += CreateCellAddressTable(0, ws->menus->vg); /* how much room it will need */
+        nextsector += CreateCellAddressTable(0, ws->menus->mg_vg); /* how much room it will need */
 
         write4(buf + 0xdc, nextsector);
           /* sector pointer to VMGM_VOBU_ADMAP (menu VOBU address map) */
-        nextsector += numsectVOBUAD(ws->menus->vg);
+        nextsector += numsectVOBUAD(ws->menus->mg_vg);
       } /*if*/
 
     write4(buf + 0x1c, nextsector - 1); /* last sector of IFO */
@@ -744,15 +744,15 @@ void TocGen(const struct workset *ws, const struct pgc *fpc, const char *fname)
     if (jumppad || forcemenus)
       {
         write4(buf + 0xc0, nextsector); /* start sector of menu VOB */
-        vtsstart += getvoblen(ws->menus->vg);
+        vtsstart += getvoblen(ws->menus->mg_vg);
       } /*if*/
     write4(buf + 0xc, vtsstart - 1); /* last sector of VMG set (last sector of BUP) */
 
     if (forcemenus)
-        BuildAVInfo(buf + 256, ws->menus->vg);
+        BuildAVInfo(buf + 256, ws->menus->mg_vg);
 
   /* create FPC at 0x400 as promised */
-    buf[0x407] = (getratedenom(ws->menus->vg) == 90090 ? 3 : 1) << 6;
+    buf[0x407] = (getratedenom(ws->menus->mg_vg) == 90090 ? 3 : 1) << 6;
       // only set frame rate XXX: should check titlesets if there is no VMGM menu
     buf[0x4e5] = 0xec; /* offset to command table, low byte */
     offset = 0x4f4; /* commands start here, after 8-byte header of command table */
@@ -854,8 +854,8 @@ void TocGen(const struct workset *ws, const struct pgc *fpc, const char *fname)
 
     if (jumppad || forcemenus)
       {
-        CreateCellAddressTable(h, ws->menus->vg); /* actually generate VMGM_C_ADT */
-        CreateVOBUAD(h, ws->menus->vg); /* generate VMGM_VOBU_ADMAP */
+        CreateCellAddressTable(h, ws->menus->mg_vg); /* actually generate VMGM_C_ADT */
+        CreateVOBUAD(h, ws->menus->mg_vg); /* generate VMGM_VOBU_ADMAP */
       } /*if*/
     fflush(h);
     if (errno != 0)
diff --git a/src/dvdpgc.c b/src/dvdpgc.c
index 899b411..42e1647 100644
--- a/src/dvdpgc.c
+++ b/src/dvdpgc.c
@@ -65,7 +65,7 @@ static int genjumppad(unsigned char *buf, vtypes ismenu, int entry, const struct
   {
     unsigned char *cbuf = buf;
     int i, j, k;
-    if (jumppad && ismenu == VTYPE_VTSM && entry == 7)
+    if (jumppad && ismenu == VTYPE_VTSM && entry == 7 /* root menu? */)
       {
         // *** VTSM jumppad
         write8(cbuf,0x61,0x00,0x00,0x0E,0x00,0x0F,0x00,0x00); cbuf+=8; // g[14]=g[15];
@@ -96,7 +96,7 @@ static int genjumppad(unsigned char *buf, vtypes ismenu, int entry, const struct
               } /*for*/
           } /*for*/
       }
-    else if (jumppad && ismenu == VTYPE_VMGM && entry == 2)
+    else if (jumppad && ismenu == VTYPE_VMGM && entry == 2 /* title menu */)
       {
         // *** VMGM jumppad
         // remap all VMGM TITLE X -> TITLESET X TITLE Y
@@ -159,7 +159,7 @@ static int jumppgc(unsigned char *buf,int pgc,vtypes ismenu,int entry,const stru
 static int genpgc(unsigned char *buf,const struct workset *ws,const struct pgcgroup *group,int pgc,vtypes ismenu,int entry)
 /* generates a PGC entry for an IFO file in buf. */
   {
-    const struct vobgroup *va = (ismenu != VTYPE_VTS ? ws->menus->vg : ws->titles->vg);
+    const struct vobgroup *va = (ismenu != VTYPE_VTS ? ws->menus->mg_vg : ws->titles->pg_vg);
     const struct pgc * const thispgc = group->pgcs[pgc];
     int i, j, d;
 
diff --git a/src/dvdunauthor.c b/src/dvdunauthor.c
index 8c8af16..fad5a5f 100644
--- a/src/dvdunauthor.c
+++ b/src/dvdunauthor.c
@@ -1080,6 +1080,7 @@ static void getVobs(dvd_reader_t *dvd, const ifo_handle_t *ifo, int titleset, in
     const cell_adr_t *cells;
     int numcells,i,j,totalsect,numsect;
     clock_t start,now,clkpsec;
+    struct tms unused_tms;
 
     cptr = titlef ? ifo->vts_c_adt : ifo->menu_c_adt;
     if (cptr)
@@ -1106,7 +1107,7 @@ static void getVobs(dvd_reader_t *dvd, const ifo_handle_t *ifo, int titleset, in
     for (i = 0; i < numcells; i++)
         totalsect += cells[i].last_sector - cells[i].start_sector + 1;
     clkpsec = sysconf(_SC_CLK_TCK);
-    start = times(NULL);
+    start = times(&unused_tms);
     
     for (i = 0; i < numcells; i++)
       {
@@ -1158,7 +1159,7 @@ static void getVobs(dvd_reader_t *dvd, const ifo_handle_t *ifo, int titleset, in
             int rl = cells[i].last_sector + 1 - b;
             if (rl > BIGBLOCKSECT)
                 rl = BIGBLOCKSECT;
-            now = times(NULL);
+            now = times(&unused_tms);
             if (now-start > 3 * clkpsec && numsect > 0)
               {
                 const int rmn = (totalsect - numsect) * (now - start) / (numsect * clkpsec);
diff --git a/src/dvdvmy.c b/src/dvdvmy.c
index bdddef9..f807d0e 100644
--- a/src/dvdvmy.c
+++ b/src/dvdvmy.c
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 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
@@ -46,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.5"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -75,7 +73,7 @@
 
 /* Copy the first part of user declarations.  */
 
-/* Line 189 of yacc.c  */
+/* Line 268 of yacc.c  */
 #line 1 "dvdvmy.y"
 
 
@@ -106,8 +104,8 @@
 
 
 
-/* Line 189 of yacc.c  */
-#line 111 "dvdvmy.c"
+/* Line 268 of yacc.c  */
+#line 109 "dvdvmy.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -214,7 +212,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 214 of yacc.c  */
+/* Line 293 of yacc.c  */
 #line 91 "dvdvmy.y"
 
     unsigned int int_val;
@@ -223,8 +221,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 214 of yacc.c  */
-#line 228 "dvdvmy.c"
+/* Line 293 of yacc.c  */
+#line 226 "dvdvmy.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -235,8 +233,8 @@ typedef union YYSTYPE
 /* Copy the second part of user declarations.  */
 
 
-/* Line 264 of yacc.c  */
-#line 240 "dvdvmy.c"
+/* Line 343 of yacc.c  */
+#line 238 "dvdvmy.c"
 
 #ifdef short
 # undef short
@@ -286,7 +284,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -339,11 +337,11 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -366,24 +364,24 @@ YYID (yyi)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
 	     && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -412,23 +410,7 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
-#  endif
-# endif
+# define YYCOPY_NEEDED 1
 
 /* Relocate STACK from its old location to the new one.  The
    local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -448,6 +430,26 @@ union yyalloc
 
 #endif
 
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  46
 /* YYLAST -- Last index in YYTABLE.  */
@@ -651,8 +653,8 @@ static const yytype_uint8 yyr2[] =
        4,     4,     4,     5,     1,     3
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
@@ -719,8 +721,7 @@ static const yytype_int16 yypgoto[] =
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
 static const yytype_uint8 yytable[] =
 {
@@ -767,6 +768,12 @@ static const yytype_uint8 yytable[] =
      121,   122
 };
 
+#define yypact_value_is_default(yystate) \
+  ((yystate) == (-57))
+
+#define yytable_value_is_error(yytable_value) \
+  YYID (0)
+
 static const yytype_int8 yycheck[] =
 {
        0,    48,    49,    50,    51,    52,    53,    54,    55,    56,
@@ -849,9 +856,18 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL		goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -861,7 +877,6 @@ do								\
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
       YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
@@ -903,19 +918,10 @@ while (YYID (0))
 #endif
 
 
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
+/* This macro is provided for backward compatibility. */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-#  define YY_LOCATION_PRINT(File, Loc)			\
-     fprintf (File, "%d.%d-%d.%d",			\
-	      (Loc).first_line, (Loc).first_column,	\
-	      (Loc).last_line,  (Loc).last_column)
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 #endif
 
 
@@ -1107,7 +1113,6 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-
 
 #if YYERROR_VERBOSE
 
@@ -1210,115 +1215,142 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
-    {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-	 constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-		    + sizeof yyexpecting - 1
-		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-		       * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-	 YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-	  {
-	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-	      {
-		yycount = 1;
-		yysize = yysize0;
-		yyformat[sizeof yyunexpected - 1] = '\0';
-		break;
-	      }
-	    yyarg[yycount++] = yytname[yyx];
-	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-	    yysize_overflow |= (yysize1 < yysize);
-	    yysize = yysize1;
-	    yyfmt = yystpcpy (yyfmt, yyprefix);
-	    yyprefix = yyor;
-	  }
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  YYSIZE_T yysize1;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = 0;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
+    {
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+                if (! (yysize <= yysize1
+                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  return 2;
+                yysize = yysize1;
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-	return YYSIZE_MAXIMUM;
+  yysize1 = yysize + yystrlen (yyformat);
+  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    return 2;
+  yysize = yysize1;
 
-      if (yyresult)
-	{
-	  /* Avoid sprintf, as that infringes on the user's name space.
-	     Don't have undefined behavior even if the translation
-	     produced a string with the wrong number of "%s"s.  */
-	  char *yyp = yyresult;
-	  int yyi = 0;
-	  while ((*yyp = *yyf) != '\0')
-	    {
-	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-		{
-		  yyp += yytnamerr (yyp, yyarg[yyi++]);
-		  yyf += 2;
-		}
-	      else
-		{
-		  yyp++;
-		  yyf++;
-		}
-	    }
-	}
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
-
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1351,6 +1383,7 @@ yydestruct (yymsg, yytype, yyvaluep)
     }
 }
 
+
 /* Prevent warnings from -Wmissing-prototypes.  */
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
@@ -1377,10 +1410,9 @@ YYSTYPE yylval;
 int yynerrs;
 
 
-
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
+/*----------.
+| yyparse.  |
+`----------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1404,8 +1436,6 @@ yyparse ()
 #endif
 #endif
 {
-
-
     int yystate;
     /* Number of tokens to shift before error messages enabled.  */
     int yyerrstatus;
@@ -1560,7 +1590,7 @@ yybackup:
 
   /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
@@ -1591,8 +1621,8 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-	goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
@@ -1647,133 +1677,133 @@ yyreduce:
     {
         case 2:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 102 "dvdvmy.y"
     {
     dvd_vm_parsed_cmd=(yyval.statement);
-;}
+}
     break;
 
   case 3:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 107 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 4:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 110 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (2)].statement);
     (yyval.statement)->next=(yyvsp[(2) - (2)].statement);
-;}
+}
     break;
 
   case 5:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 116 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 6:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 119 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 7:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 122 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_EXIT;
-;}
+}
     break;
 
   case 8:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 126 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=16;
-;}
+}
     break;
 
   case 9:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 131 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_GOTO;
     (yyval.statement)->s1=(yyvsp[(2) - (3)].str_val);
-;}
+}
     break;
 
   case 10:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 136 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LABEL;
     (yyval.statement)->s1=(yyvsp[(1) - (2)].str_val);
-;}
+}
     break;
 
   case 11:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 141 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_BREAK;
-;}
+}
     break;
 
   case 12:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 145 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 13:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 148 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(2) - (3)].statement);
-;}
+}
     break;
 
   case 14:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 151 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 15:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 156 "dvdvmy.y"
     {
     if ((yyvsp[(2) - (2)].int_val) < 1 || (yyvsp[(2) - (2)].int_val) > 99)
@@ -1781,30 +1811,30 @@ yyreduce:
         yyerror("titleset number out of range");
       } /*if*/
     (yyval.int_val)=((yyvsp[(2) - (2)].int_val))+1;
-;}
+}
     break;
 
   case 16:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 163 "dvdvmy.y"
     {
     (yyval.int_val)=1;
-;}
+}
     break;
 
   case 17:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 166 "dvdvmy.y"
     {
     (yyval.int_val)=0;
-;}
+}
     break;
 
   case 18:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 171 "dvdvmy.y"
     {
     if ((yyvsp[(2) - (2)].int_val) < 1 || (yyvsp[(2) - (2)].int_val) > 99)
@@ -1812,84 +1842,84 @@ yyreduce:
         yyerror("menu number out of range");
       } /*if*/
     (yyval.int_val)=(yyvsp[(2) - (2)].int_val);
-;}
+}
     break;
 
   case 19:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 178 "dvdvmy.y"
     {
     (yyval.int_val)=120; // default entry
-;}
+}
     break;
 
   case 20:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 181 "dvdvmy.y"
     {
     (yyval.int_val)=122;
-;}
+}
     break;
 
   case 21:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 184 "dvdvmy.y"
     {
     (yyval.int_val)=123;
-;}
+}
     break;
 
   case 22:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 187 "dvdvmy.y"
     {
     (yyval.int_val)=124;
-;}
+}
     break;
 
   case 23:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 190 "dvdvmy.y"
     {
     (yyval.int_val)=125;
-;}
+}
     break;
 
   case 24:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 193 "dvdvmy.y"
     {
     (yyval.int_val)=126;
-;}
+}
     break;
 
   case 25:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 196 "dvdvmy.y"
     {
     (yyval.int_val)=127;
-;}
+}
     break;
 
   case 26:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 199 "dvdvmy.y"
     {
     (yyval.int_val)=121;
-;}
+}
     break;
 
   case 27:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 202 "dvdvmy.y"
     {
     if ((yyvsp[(2) - (2)].int_val) < 1 || (yyvsp[(2) - (2)].int_val) > 99)
@@ -1897,21 +1927,21 @@ yyreduce:
         yyerror("title number out of range");
       } /*if*/
     (yyval.int_val)=((yyvsp[(2) - (2)].int_val))|128;
-;}
+}
     break;
 
   case 28:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 209 "dvdvmy.y"
     {
     (yyval.int_val)=0;
-;}
+}
     break;
 
   case 29:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 214 "dvdvmy.y"
     {
     if ((yyvsp[(2) - (2)].int_val) < 1 || (yyvsp[(2) - (2)].int_val) > 65535)
@@ -1919,21 +1949,21 @@ yyreduce:
         yyerror("chapter number out of range");
       } /*if*/
     (yyval.int_val)=(yyvsp[(2) - (2)].int_val);
-;}
+}
     break;
 
   case 30:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 221 "dvdvmy.y"
     {
     (yyval.int_val)=0;
-;}
+}
     break;
 
   case 31:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 226 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
@@ -1942,12 +1972,12 @@ yyreduce:
     (yyval.statement)->i1=(yyvsp[(2) - (5)].int_val);
     (yyval.statement)->i2=(yyvsp[(3) - (5)].int_val);
     (yyval.statement)->i3=(yyvsp[(4) - (5)].int_val);
-;}
+}
     break;
 
   case 32:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 234 "dvdvmy.y"
     {
     if ((yyvsp[(3) - (4)].int_val) < 1 || (yyvsp[(3) - (4)].int_val) > 65535)
@@ -1957,12 +1987,12 @@ yyreduce:
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_JUMP;
     (yyval.statement)->i3=2*65536+(yyvsp[(3) - (4)].int_val);
-;}
+}
     break;
 
   case 33:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 243 "dvdvmy.y"
     {
     if ((yyvsp[(3) - (4)].int_val) < 1 || (yyvsp[(3) - (4)].int_val) > 65535)
@@ -1972,133 +2002,133 @@ yyreduce:
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_JUMP;
     (yyval.statement)->i3=65536+(yyvsp[(3) - (4)].int_val);
-;}
+}
     break;
 
   case 34:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 252 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=1;
-;}
+}
     break;
 
   case 35:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 257 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=2;
-;}
+}
     break;
 
   case 36:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 262 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=3;
-;}
+}
     break;
 
   case 37:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 267 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=5;
-;}
+}
     break;
 
   case 38:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 272 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=6;
-;}
+}
     break;
 
   case 39:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 277 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=7;
-;}
+}
     break;
 
   case 40:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 282 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=9;
-;}
+}
     break;
 
   case 41:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 287 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=10;
-;}
+}
     break;
 
   case 42:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 292 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=11;
-;}
+}
     break;
 
   case 43:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 297 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=12;
-;}
+}
     break;
 
   case 44:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 302 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_LINK;
     (yyval.statement)->i1=13;
-;}
+}
     break;
 
   case 45:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 309 "dvdvmy.y"
     {
     if ((yyvsp[(2) - (2)].int_val) < 1 || (yyvsp[(2) - (2)].int_val) > 65535)
@@ -2106,21 +2136,21 @@ yyreduce:
         yyerror("resume cell number out of range");
       } /*if*/
     (yyval.int_val)=(yyvsp[(2) - (2)].int_val);
-;}
+}
     break;
 
   case 46:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 316 "dvdvmy.y"
     {
     (yyval.int_val)=0;
-;}
+}
     break;
 
   case 47:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 321 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
@@ -2130,426 +2160,426 @@ yyreduce:
     (yyval.statement)->i2=(yyvsp[(3) - (6)].int_val);
     (yyval.statement)->i3=(yyvsp[(4) - (6)].int_val);
     (yyval.statement)->i4=(yyvsp[(5) - (6)].int_val);
-;}
+}
     break;
 
   case 48:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 332 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(1) - (1)].int_val);
-;}
+}
     break;
 
   case 49:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 335 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(1) - (1)].int_val)+0x80;
-;}
+}
     break;
 
   case 50:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 338 "dvdvmy.y"
     {
     (yyval.int_val)=0x81;
-;}
+}
     break;
 
   case 51:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 341 "dvdvmy.y"
     {
     (yyval.int_val)=0x82;
-;}
+}
     break;
 
   case 52:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 344 "dvdvmy.y"
     {
     (yyval.int_val)=0x83;
-;}
+}
     break;
 
   case 53:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 347 "dvdvmy.y"
     {
     (yyval.int_val)=0x88;
-;}
+}
     break;
 
   case 54:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 350 "dvdvmy.y"
     {
     (yyval.int_val)=0x80+20;
-;}
+}
     break;
 
   case 55:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 355 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(1) - (1)].int_val)-256;
-;}
+}
     break;
 
   case 56:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 358 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(1) - (1)].int_val);
-;}
+}
     break;
 
   case 57:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 363 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(2) - (3)].statement);
-;}
+}
     break;
 
   case 58:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 366 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_VAL;
     (yyval.statement)->i1=(yyvsp[(1) - (1)].int_val);
-;}
+}
     break;
 
   case 59:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 371 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_ADD,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 60:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 374 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_SUB,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 61:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 377 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_MUL,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 62:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 380 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_DIV,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 63:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 383 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_MOD,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 64:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 386 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_AND,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 65:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 389 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_OR, (yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 66:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 392 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_AND,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 67:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 395 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_OR, (yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 68:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 398 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_XOR,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 69:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 401 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_RND;
     (yyval.statement)->param=(yyvsp[(3) - (4)].statement);
-;}
+}
     break;
 
   case 70:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 408 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(2) - (3)].statement);
-;}
+}
     break;
 
   case 71:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 411 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_EQ,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 72:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 414 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_NE,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 73:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 417 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_GTE,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 74:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 420 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_GT,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 75:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 423 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LTE,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 76:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 426 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LT,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 77:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 429 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LOR,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 78:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 432 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LAND,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 79:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 435 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LOR,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 80:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 438 "dvdvmy.y"
     {
     (yyval.statement)=statement_expression((yyvsp[(1) - (3)].statement),VM_LAND,(yyvsp[(3) - (3)].statement));
-;}
+}
     break;
 
   case 81:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 441 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_NOT;
     (yyval.statement)->param=(yyvsp[(2) - (2)].statement);
-;}
+}
     break;
 
   case 82:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 448 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(1) - (1)].int_val);
-;}
+}
     break;
 
   case 83:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 451 "dvdvmy.y"
     {
     (yyval.int_val)=(yyvsp[(2) - (2)].int_val)+0x20;
-;}
+}
     break;
 
   case 84:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 456 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
     (yyval.statement)->op=VM_SET;
     (yyval.statement)->i1=(yyvsp[(1) - (4)].int_val);
     (yyval.statement)->param=(yyvsp[(3) - (4)].statement);
-;}
+}
     break;
 
   case 85:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 462 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_ADD,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 86:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 465 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_SUB,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 87:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 468 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_MUL,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 88:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 471 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_DIV,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 89:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 474 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_MOD,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 90:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 477 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_AND,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 91:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 480 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_OR,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 92:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 483 "dvdvmy.y"
     {
     (yyval.statement)=statement_setop((yyvsp[(1) - (4)].int_val),VM_XOR,(yyvsp[(3) - (4)].statement));
-;}
+}
     break;
 
   case 93:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 488 "dvdvmy.y"
     {
     (yyval.statement)=statement_new();
@@ -2558,34 +2588,45 @@ yyreduce:
     (yyvsp[(3) - (5)].statement)->next=statement_new();
     (yyvsp[(3) - (5)].statement)->next->op=VM_IF;
     (yyvsp[(3) - (5)].statement)->next->param=(yyvsp[(5) - (5)].statement);
-;}
+}
     break;
 
   case 94:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 498 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (1)].statement);
-;}
+}
     break;
 
   case 95:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 501 "dvdvmy.y"
     {
     (yyval.statement)=(yyvsp[(1) - (3)].statement);
     (yyval.statement)->param->next->next=(yyvsp[(3) - (3)].statement);
-;}
+}
     break;
 
 
 
-/* Line 1455 of yacc.c  */
-#line 2587 "dvdvmy.c"
+/* Line 1806 of yacc.c  */
+#line 2617 "dvdvmy.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -2613,6 +2654,10 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
@@ -2620,37 +2665,36 @@ yyerrlab:
 #if ! YYERROR_VERBOSE
       yyerror (YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-	  {
-	    YYSIZE_T yyalloc = 2 * yysize;
-	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
-	    if (yymsg != yymsgbuf)
-	      YYSTACK_FREE (yymsg);
-	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-	    if (yymsg)
-	      yymsg_alloc = yyalloc;
-	    else
-	      {
-		yymsg = yymsgbuf;
-		yymsg_alloc = sizeof yymsgbuf;
-	      }
-	  }
-
-	if (0 < yysize && yysize <= yymsg_alloc)
-	  {
-	    (void) yysyntax_error (yymsg, yystate, yychar);
-	    yyerror (yymsg);
-	  }
-	else
-	  {
-	    yyerror (YY_("syntax error"));
-	    if (yysize != 0)
-	      goto yyexhaustedlab;
-	  }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
@@ -2709,7 +2753,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
 	{
 	  yyn += YYTERROR;
 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2768,8 +2812,13 @@ yyexhaustedlab:
 
 yyreturn:
   if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-		 yytoken, &yylval);
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
diff --git a/src/dvdvmy.h b/src/dvdvmy.h
index c50aedb..dcb7903 100644
--- a/src/dvdvmy.h
+++ b/src/dvdvmy.h
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 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
@@ -119,7 +117,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 1676 of yacc.c  */
+/* Line 2068 of yacc.c  */
 #line 91 "dvdvmy.y"
 
     unsigned int int_val;
@@ -128,8 +126,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 1676 of yacc.c  */
-#line 133 "dvdvmy.h"
+/* Line 2068 of yacc.c  */
+#line 131 "dvdvmy.h"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/src/dvdvob.c b/src/dvdvob.c
index 75282bb..0fce216 100644
--- a/src/dvdvob.c
+++ b/src/dvdvob.c
@@ -784,11 +784,14 @@ static void printpts(pts_t pts)
     fprintf(stderr,"%d.%03d",(int)(pts/90000),(int)((pts/90)%1000));
   }
 
-enum { CR_BEGIN0,   CR_BEGIN1,    CR_BEGIN2,    CR_BEGIN3, CR_SKIP0,
-       CR_SKIP1,    CR_NEXTOFFS0, CR_NEXTOFFS1, CR_WAIT,   CR_CMD,
-       CR_SKIPWAIT, CR_COL0,      CR_COL1,      CR_CHGARG, CR_CHGLN0,
-       CR_CHGLN1,   CR_CHGLN2,    CR_CHGLN3,    CR_CHGPX0, CR_CHGPX1,
-       CR_CHGPX2 };
+enum /* states for SPU parser */
+  {
+    CR_BEGIN0,   CR_BEGIN1,    CR_BEGIN2,    CR_BEGIN3, CR_SKIP0,
+    CR_SKIP1,    CR_NEXTOFFS0, CR_NEXTOFFS1, CR_WAIT,   CR_CMD,
+    CR_SKIPWAIT, CR_COL0,      CR_COL1,      CR_CHGARG, CR_CHGLN0,
+    CR_CHGLN1,   CR_CHGLN2,    CR_CHGLN3,    CR_CHGPX0, CR_CHGPX1,
+    CR_CHGPX2,
+  };
 
 static char *readpstr(const unsigned char *b, int *i)
 /* extracts a null-terminated string beginning at b[*i], advances *i past it and returns
@@ -1344,7 +1347,7 @@ int FindVobus(const char *fbase, struct vobgroup *va, vtypes ismenu)
                     has_gop(buf)
               )
               {
-                // create VOBU
+                // create VOBU, from Martin Crossley
                 if (!hadfirstvobu)
                   { /* let user know the first time this happens */
                     fprintf
@@ -1645,7 +1648,7 @@ int FindVobus(const char *fbase, struct vobgroup *va, vtypes ismenu)
                     memcpy(mp2hdr[index].buf, buf + dptr + len - 3, 3);
                     audiodesc_set_audio_attr(&thisvob->audch[audch].ad, &thisvob->audch[audch]. adwarn, AUDIO_SAMPLERATE, "48khz");
                   } /*if*/
-              /* at this point, pts1 is the duration of the audio in the packet */
+              /* at this point, pts1 is the duration of the audio in the packet (0 for subpicture) */
                 if (haspts)
                   {
                     pts0 = readpts(buf + 23 + sysoffs);
@@ -1704,8 +1707,9 @@ int FindVobus(const char *fbase, struct vobgroup *va, vtypes ismenu)
                             fprintf
                               (
                                 stderr,
-                                "WARN: Audio pts for channel %d moves backwards by %"
+                                "WARN: %s pts for channel %d moves backwards by %"
                                     PRId64 "; please remultiplex input.\n",
+                                audch >= 32 ? "Subpicture" : "Audio",
                                 audch,
                                 ach->audpts[ach->numaudpts - 1].pts[1] - pts0
                               );
@@ -1958,7 +1962,7 @@ static pts_t pabs(pts_t pts)
     return pts;
   } /*pabs*/
 
-static int findnearestvobu(struct vobgroup *pg, struct vob *va, pts_t pts)
+static int findnearestvobu(struct vob *va, pts_t pts)
   /* returns the index of the VOBU closest in time to pts. */
   {
     int l = 0, h = va->numvobus - 1, i;
@@ -1995,7 +1999,7 @@ void MarkChapters(struct vobgroup *va)
             for (k = 0; k < thissource->numcells; k++)
               {
                 int v;
-                v = findnearestvobu(va, thissource->vob, thissource->cells[k].startpts);
+                v = findnearestvobu(thissource->vob, thissource->cells[k].startpts);
                 if (v >= 0 && v < thissource->vob->numvobus)
                   {
                     if (thissource->cells[k].ischapter != CELL_NEITHER) /* from Wolfgang Wershofen */
@@ -2025,7 +2029,7 @@ void MarkChapters(struct vobgroup *va)
                   } /*if*/
                 if (thissource->cells[k].endpts >= 0)
                   {
-                    v = findnearestvobu(va, thissource->vob, thissource->cells[k].endpts);
+                    v = findnearestvobu(thissource->vob, thissource->cells[k].endpts);
                     if (v >= 0 && v < thissource->vob->numvobus)
                         thissource->vob->vobu[v].vobcellid = 1; /* another cell should start here */
                   }
diff --git a/src/mpeg2desc.c b/src/mpeg2desc.c
index 52c328c..55d9ff6 100644
--- a/src/mpeg2desc.c
+++ b/src/mpeg2desc.c
@@ -25,6 +25,7 @@
 
 #include "compat.h"
 
+#include <setjmp.h>
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -32,15 +33,15 @@
 // this is needed for FreeBSD and Windows
 #include <sys/time.h>
 
-#include <netinet/in.h>
-
+#include "common.h"
 
 // #define SHOWDATA
 
-int pos=0;
-int queuedlen=0;
+static unsigned int
+    inputpos = 0, /* position in stdin */
+    queuedlen = 0; /* total nr bytes awaiting writing to output files */
 
-char *frametype="0IPB4567";
+const char * const frametype = "0IPB4567";
 
 #define SCRTIME 27000000
 #define PTSTIME 90000
@@ -49,552 +50,559 @@ char *frametype="0IPB4567";
 
 #define BUFLEN (65536)
 
-struct fdbuf {
+struct fdbuf
+  {
     int pos,len;
     struct fdbuf *next;
     unsigned char buf[BUFLEN];
-};
+  };
+
+#define MAX_FILES 256
+  /* how many output files I can write at once -- can't have
+    more than this number of MPEG streams anyway */
 
-struct ofd {
+/* values for ofd.fd: */
+#define FD_TOOPEN (-2) /* open file named ofd.fname on first write */
+#define FD_CLOSED (-1)
+
+struct ofd
+  {
     int fd;
     char *fname;
-    struct fdbuf *firstbuf,**lastbufptr;
+    struct fdbuf *firstbuf,**lastbufptr; /* queue of buffers awaiting writing */
     int len;
     bool isvalid;
-} outputfds[256];
+  } outputfds[256]; /* files to write, indexed by stream id */
 
-static int ofdlist[256],numofd;
+static int
+    ofdlist[MAX_FILES], /* indexes of used entries in outputfds */
+    numofd; /* contiguous used size of ofdlist */
 
-static int firstpts[256];
+static int firstpts[256]; /* indexed by stream id */
 
 static bool
+    outputenglish = true,
+    nounknown = false,
     closing = false,
     outputmplex = false;
-
-static fd_set rfd,wfd;
-
-
-int64_t readpts(unsigned char *buf)
-{
-    int64_t a1,a2,a3,pts;
-    
-    a1=(buf[0]&0xf)>>1;
-    a2=((buf[1]<<8)|buf[2])>>1;
-    a3=((buf[3]<<8)|buf[4])>>1;
-    pts=(((int64_t)a1)<<30)|
-        (a2<<15)|
-        a3;
-    return pts;
-}
-
-bool hasbecomevalid(int stream,struct ofd *o)
-{
+static int
+    audiodrop = 0;
+
+static fd_set
+  /* should be local to dowork routine */
+    rfd, wfd;
+
+static int64_t readpts(const unsigned char *buf)
+  {
+    return
+            (int64_t)((buf[0] & 0xf) >> 1) << 30
+        |
+            ((int64_t)buf[1] << 8 | buf[2]) >> 1 << 15
+        |
+            ((int64_t)buf[3] << 8 | buf[4]) >> 1;
+  } /*readpts*/
+
+static bool hasbecomevalid(int stream, const struct ofd *o)
+  /* checks if there is a valid packet header at the start of the data to be
+    written to the specified output stream. Assumes there is at least 4 bytes
+    of data waiting to be written. */
+  {
     unsigned char quad[4];
-    struct fdbuf *f1=o->firstbuf,*f2;
+    const struct fdbuf * const f1 = o->firstbuf;
+    const struct fdbuf *f2;
     int i;
     unsigned int realquad;
 
-    if( f1 )
-        f2=f1->next;
+    if (f1)
+        f2 = f1->next;
     else
-        f2=0;
-    for( i=0; i<4; i++ ) {
-        if( f1->len-f1->pos-i > 0 )
-            quad[i]=f1->buf[f1->pos+i];
+        f2 = 0;
+    for (i = 0; i < 4; i++)
+      {
+        if (f1->len - f1->pos - i > 0)
+            quad[i] = f1->buf[f1->pos + i];
         else
-            quad[i]=f2->buf[f2->pos+i-(f1->len-f1->pos)];
-    }
-    realquad=(quad[0]<<24)|
-        (quad[1]<<16)|
-        (quad[2]<<8)|
-        quad[3];
-    if( stream>=0xC0 && stream<0xE0 && (realquad&0xFFE00000)==0xFFE00000 )
+            quad[i] = f2->buf[f2->pos + i - (f1->len - f1->pos)];
+      } /*for*/
+    realquad =
+            quad[0] << 24
+        |
+            quad[1] << 16
+        |
+            quad[2] << 8
+        |
+            quad[3];
+    if (stream >= MPID_AUDIO_FIRST && stream <= MPID_AUDIO_LAST && (realquad & 0xFFE00000) == 0xFFE00000)
         return true;
-    if( stream>=0xE0 && realquad==0x1B3 )
+    if (stream >= MPID_VIDEO_FIRST && stream <= MPID_VIDEO_LAST && realquad == 0x100 + MPID_SEQUENCE)
         return true;
     return false;
-}
-
-bool dowork(bool checkin)
-{
-    int i,n=-1;
+  } /*hasbecomevalid*/
+
+static bool dowork
+  (
+    bool checkin /* whether to check if bytes are available to be read from stdin */
+  )
+  /* writes pending packets to output streams. This is done concurrently to allow
+    for use with pipes. Returns true iff stdin has input available. */
+  {
+    int highestfd = -1;
     struct timeval tv;
-    
-    if( !numofd )
+    if (!numofd)
         return checkin;
-    if( checkin ) {
-        FD_SET(STDIN_FILENO,&rfd);
-        n=STDIN_FILENO;
-    } else {
-        FD_CLR(STDIN_FILENO,&rfd);
-    }
-    while (true) {
-        int minq=-1;
-        for( i=0; i<numofd; i++ ) {
-            struct ofd *o=&outputfds[ofdlist[i]];
-
-            if( o->fd != -1 ) {
-                if( o->fd == -2 ) {
+    if (checkin)
+      {
+        FD_SET(STDIN_FILENO, &rfd);
+        highestfd = STDIN_FILENO;
+      }
+    else
+      {
+        FD_CLR(STDIN_FILENO, &rfd);
+      } /*if*/
+    while (true)
+      {
+        int i, minq = -1;
+        for (i = 0; i < numofd; i++)
+          {
+            struct ofd *o = &outputfds[ofdlist[i]];
+            if (o->fd != FD_CLOSED)
+              {
+                if (o->fd == FD_TOOPEN)
+                  {
                     int fd;
-                    fd=open(o->fname,O_CREAT|O_WRONLY|O_NONBLOCK,0666);
-                    if( fd == -1 && errno == ENXIO ) {
-                        continue;
-                    }
-                    if( fd == -1 ) {
+                    fd = open(o->fname, O_CREAT | O_WRONLY | O_NONBLOCK, 0666);
+                    if (fd == -1 && errno == ENXIO)
+                      {
+                        continue; /* try again later, in case pipe not created yet */
+                      } /*if*/
+                    if (fd == -1)
+                      {
                         fprintf(stderr,"Cannot open %s: %s\n",o->fname,strerror(errno));
                         exit(1);
-                    }
-                    o->fd=fd;
-                }
+                      } /*if*/
+                    o->fd = fd;
+                  } /*if*/
                 // at this point, fd >= 0 
-                if( minq == -1 || o->len < minq ) {
-                    minq=o->len;
-                }
-                if( (o->len > 0 && o->isvalid) || o->len >= 4 ) {
-                    if( o->fd>n )
-                        n=o->fd;
-                    FD_SET(o->fd,&wfd);
-                } else {
-                    FD_CLR(o->fd,&wfd);
-                    if( closing ) {
+                if (minq == -1 || o->len < minq)
+                  {
+                    minq = o->len;
+                  } /*if*/
+                if ((o->len > 0 && o->isvalid) || o->len >= 4)
+                  {
+                    if (o->fd > highestfd)
+                        highestfd = o->fd;
+                    FD_SET(o->fd, &wfd);
+                  }
+                else
+                  {
+                    FD_CLR(o->fd, &wfd);
+                    if (closing)
+                      {
                         close(o->fd);
-                        o->fd=-1;
-                    }
-                }
-            }
-        }
+                        o->fd = FD_CLOSED;
+                      } /*if*/
+                  } /*if*/
+              } /*if*/
+          } /*for*/
         // if all the open files have more then WAITLEN bytes of data
         // queued up, then don't process anymore
-        if( minq >= WAITLEN ) {
-            FD_CLR(STDIN_FILENO,&rfd);
+        if (minq >= WAITLEN)
+          {
+            FD_CLR(STDIN_FILENO, &rfd);
             break;
-        } else if( minq >= 0 || outputmplex ) // as long as one file is open, continue
+          }
+        else if (minq >= 0 || outputmplex) // as long as one file is open, continue
             break;
         sleep(1);
-    }
-    if( n == -1 )
-        return false;
-    tv.tv_sec=1; // set timeout to 1 second just in case any files need to be opened
-    tv.tv_usec=0;
-    i=select(n+1,&rfd,&wfd,NULL,&tv);
-    if( i > 0 ) {
-        for( i=0; i<numofd; i++ ) {
-            struct ofd *o=&outputfds[ofdlist[i]];
-            if( o->fd >= 0 && FD_ISSET( o->fd, &wfd ) ) {
-                struct fdbuf *f=o->firstbuf;
-                if( !o->isvalid && hasbecomevalid(ofdlist[i],o) )
+      } /*while*/
+    if (highestfd == -1)
+        return false; /* nothing to do */
+    tv.tv_sec = 1; // set timeout to 1 second just in case any files need to be opened
+    tv.tv_usec = 0;
+    if (select(highestfd + 1, &rfd, &wfd, NULL, &tv) > 0)
+      {
+        int i;
+        for (i = 0; i < numofd; i++)
+          {
+            struct ofd * const o = &outputfds[ofdlist[i]];
+            if (o->fd >= 0 && FD_ISSET(o->fd, &wfd))
+              {
+                struct fdbuf * const f = o->firstbuf;
+                int written;
+                if (!o->isvalid && hasbecomevalid(ofdlist[i], o))
                     o->isvalid = true;
-
-                if( o->isvalid )
-                    n=write(o->fd,f->buf+f->pos,f->len-f->pos);
-                else if( f->len-f->pos > 0 )
-                    n=1;
+                if (o->isvalid)
+                    written = write(o->fd, f->buf + f->pos, f->len - f->pos);
+                else if (f->len - f->pos > 0)
+                    written = 1; /* discard one byte while waiting for valid packet */
                 else
-                    n=0;
-
-                if( n == -1 ) {
+                    written = 0;
+                if (written == -1)
+                  {
                     fprintf(stderr,"Error writing to fifo: %s\n",strerror(errno));
                     exit(1);
-                }
-                queuedlen-=n;
-                f->pos+=n;
-                if( f->pos == f->len ) {
-                    o->firstbuf=f->next;
-                    if( o->lastbufptr == &f->next )
-                        o->lastbufptr=&o->firstbuf;
+                  } /*if*/
+                queuedlen -= written;
+                f->pos += written;
+                if (f->pos == f->len)
+                  {
+                  /* finished writing buffer at head of queue */
+                    o->firstbuf = f->next;
+                    if (o->lastbufptr == &f->next)
+                        o->lastbufptr = &o->firstbuf;
                     free(f);
-                }
-                o->len-=n;
-            }
-        }
-        if( FD_ISSET( STDIN_FILENO, &rfd ) )
+                  } /*if*/
+                o->len -= written;
+              } /*if*/
+          } /*for*/
+        if (FD_ISSET(STDIN_FILENO, &rfd))
             return true;
-    }
+      } /*if*/
     return false;
-}
-
-int forceread(void *ptr,int len,FILE *h)
-{
-    while(!dowork(true));
-    if( fread(ptr,1,len,h) != len ) {
-        fprintf(stderr,"Could not read\n");
-        closing = true;
-        while( queuedlen )
-            dowork(false);
-        exit(1);
-    }
-    pos+=len;
-    return len;
-}
-
-int forceread1(void *ptr,FILE *h)
-{
-    int v=fgetc(h);
-
-    if( v<0 ) {
-        fprintf(stderr,"Could not read\n");
-        closing = true;
-        while( queuedlen )
-            dowork(false);
-        exit(1);
-    }
-    ((unsigned char *)ptr)[0]=v;
-    pos+=1;
-    return 1;
-}
-
-void writetostream(int stream,unsigned char *buf,int len)
-{
-    struct ofd *o=&outputfds[stream];
-
-    if( o->fd == -1 )
+  } /*dowork*/
+
+static void flushwork(void)
+  /* flushes the work queue. */
+  {
+    closing = true;
+    while (queuedlen)
+        dowork(false);
+  } /*flushwork*/
+
+static void forceread(void *ptr, int len, bool required)
+  /* reads the specified number of bytes from standard input, finishing processing
+    if EOF is reached. */
+  {
+    int nrbytes;
+    while (!dowork(true))
+      /* flush output queues while waiting for more input */;
+    nrbytes = fread(ptr, 1, len, stdin);
+    if (nrbytes != len)
+      {
+        bool success = true;
+        if (nrbytes < 0)
+          {
+            fprintf(stderr, "Error %d reading: %s\n", errno, strerror(errno));
+            success = false;
+          }
+        else if (nrbytes < len && required)
+          {
+            fprintf(stderr, "Unexpected read EOF\n");
+            success = false;
+          } /*if*/
+        flushwork();
+        exit(success ? 0 : 1);
+      } /*if*/
+    inputpos += len;
+  } /*forceread*/
+
+static void writetostream(int stream, unsigned char *buf, int len)
+  /* queues more data to be written to the output file for the specified stream id,
+    if I am writing it. */
+  {
+    struct ofd * const o = &outputfds[stream];
+    if (o->fd == FD_CLOSED) /* not extracting this stream */
         return;
-
-    while( len > 0 ) {
+    while (len > 0)
+      {
         int thislen;
         struct fdbuf *fb;
-        if( !o->lastbufptr[0] ) {
-            o->lastbufptr[0]=malloc(sizeof(struct fdbuf));
-            o->lastbufptr[0]->pos=0;
-            o->lastbufptr[0]->len=0;
-            o->lastbufptr[0]->next=0;
-        }
-        fb=o->lastbufptr[0];
-        thislen=BUFLEN-fb->len;
-        if( !thislen ) {
-            o->lastbufptr=&fb->next;
+        if (!o->lastbufptr[0])
+          {
+            o->lastbufptr[0] = malloc(sizeof(struct fdbuf));
+            o->lastbufptr[0]->pos = 0;
+            o->lastbufptr[0]->len = 0;
+            o->lastbufptr[0]->next = 0;
+          } /*if*/
+        fb = o->lastbufptr[0];
+        thislen = BUFLEN - fb->len;
+        if (!thislen)
+          {
+            o->lastbufptr = &fb->next;
             continue;
-        }
-        if( thislen > len )
-            thislen=len;
-        
-        o->len+=thislen;
-        memcpy(fb->buf+fb->len,buf,thislen);
-        fb->len+=thislen;
-        len-=thislen;
-        buf+=thislen;
-        queuedlen+=thislen;
-    }
-}
-
-int main(int argc,char **argv)
-{
-    unsigned int hdr=0;
-    bool mpeg2 = true;
-    unsigned char c,buf[200];
-    bool outputenglish = true, skiptohdr = false, nounknown = false;
-    int outputstream = 0, oc, i,audiodrop=0;
-
-    for( oc=0; oc<256; oc++ )
-        outputfds[oc].fd=-1;
-
-    while( -1 != (oc=getopt(argc,argv,"ha:v:o:msd:u")) ) {
-        switch(oc) {
-        case 'd':
-            audiodrop=strtounsigned(optarg, "audio drop count");
-            break;
-
-        case 'a':
-        case 'v':
-            if( outputstream ) {
-                fprintf(stderr,"can only output one stream to stdout at a time\n; use -o to output more than\none stream\n");
-                exit(1);
-            }
-            outputstream=((oc=='a')?0xc0:0xe0)+strtounsigned(optarg, "stream id");
-            break;
-
-        case 'm':
-            outputmplex = true;
-            break;
-
-        case 's':
-            skiptohdr = true;
-            break;
-
-        case 'o':
-            if( !outputstream ) {
-                fprintf(stderr,"no stream selected for '%s'\n",optarg);
-                exit(1);
-            }
-            outputfds[outputstream].fd=-2;
-            outputfds[outputstream].fname=optarg;
-            outputstream=0;
-            break;
-
-        case 'u':
-            nounknown = true;
-            break;
-
-            // case 'h':
-        default:
-            fprintf(stderr,
-                    "usage: mpeg2desc [options] < movie.mpg\n"
-                    "\t-a #: output audio stream # to stdout\n"
-                    "\t-v #: output video stream # to stdout\n"
-                    "\t-o FILE: output previous stream to FILE instead of stdout\n"
-                    "\t-s: skip to first valid header -- ensures mplex can handle output\n"
-                    "\t-m: output mplex offset to stdout\n"
-                    "\t-u: ignore unknown hdrs\n"
-                    "\t-h: help\n"
-                );
-            exit(1);
-        }
-    }
-    if( outputstream ) {
-        outputenglish = false;
-        outputfds[outputstream].fd=STDOUT_FILENO;
-    }
-    if( outputmplex ) {
-        if( !outputenglish ) {
-            fprintf(stderr,"Cannot output a stream and the mplex offset at the same time\n");
-            exit(1);
-        }
-        outputenglish = false;
-    }
-    numofd=0;
-    for( oc=0; oc<256; oc++ )
-        if( outputfds[oc].fd != -1 ) {
-            ofdlist[numofd++]=oc;
-            outputfds[oc].firstbuf=0;
-            outputfds[oc].lastbufptr=&outputfds[oc].firstbuf;
-            outputfds[oc].len=0;
-            outputfds[oc].isvalid = !skiptohdr;
-        }
-    FD_ZERO(&rfd);
-    FD_ZERO(&wfd);    
-
-    for( i=0; i<256; i++ ) {
-        firstpts[i]=-1;
-    }
-
-    forceread(&hdr,4,stdin);
-    while (true) {
-        int disppos=pos-4;
-        switch( ntohl(hdr) ) {
-            // start codes:
-        case 0x100: // picture header
-            forceread(buf,4,stdin);
-            if( outputenglish )
-                printf("%08x: picture hdr, frametype=%c, temporal=%d\n",disppos,frametype[(buf[1]>>3)&7],(buf[0]<<2)|(buf[1]>>6));
-            forceread(&hdr,4,stdin);
-            break;
-
-        case 0x1b3: // sequence header
-            forceread(buf,8,stdin);
-            if( outputenglish )
-                printf("%08x: sequence hdr: %dx%d, a/f:%02x, bitrate=%d\n"
-                       ,disppos
-                       ,(buf[0]<<4)|(buf[1]>>4)
-                       ,((buf[1]<<8)&0xf00)|(buf[2])
-                       ,buf[3]
-                       ,(buf[4]<<10)|(buf[5]<<2)|(buf[6]>>6)
-                    );
-            if( buf[7]&2 )
-                forceread(buf+8,64,stdin);
-            if( buf[7]&1 )
-                forceread(buf+8,64,stdin);
-            forceread(&hdr,4,stdin);
-            break;
-
-        case 0x1b5: // extension header
-            forceread(buf,1,stdin);
-            switch( buf[0]>>4 ) {
+          } /*if*/
+        if (thislen > len)
+            thislen = len;
+        o->len += thislen;
+        memcpy(fb->buf + fb->len, buf, thislen);
+        fb->len += thislen;
+        len -= thislen;
+        buf += thislen;
+        queuedlen += thislen;
+      } /*while*/
+  } /*writetostream*/
+
+static void process_packets
+  (
+    void (*readinput)(void *ptr, int len, bool required),
+    bool recursed
+  )
+  {
+    unsigned char hdr[4];
+    unsigned char buf[200];
+    bool fetchhdr = true;
+    while (true)
+      {
+        const int disppos = fetchhdr ? inputpos : inputpos - 4; /* where packet actually started */
+        bool handled = true;
+        int hdrid;
+        if (fetchhdr)
+          {
+            readinput(hdr, 4, false);
+          } /*if*/
+        fetchhdr = true; /* initial assumption */
+        hdrid =
+                hdr[0] << 24
+            |
+                hdr[1] << 16
+            |
+                hdr[2] << 8
+            |
+                hdr[3];
+        switch (hdrid)
+          {
+      // start codes:
+        case 0x100 + MPID_PICTURE: // picture header
+            readinput(buf, 4, true);
+            if (outputenglish)
+                printf
+                  (
+                    "%08x: picture hdr, frametype=%c, temporal=%d\n",
+                    disppos,
+                    frametype[buf[1] >> 3 & 7],
+                    buf[0] << 2 | buf[1] >> 6
+                  );
+        break;
+
+        case 0x100 + MPID_SEQUENCE: // sequence header
+            readinput(buf, 8, true);
+            if (outputenglish)
+                printf
+                  (
+                    "%08x: sequence hdr: %dx%d, a/f:%02x, bitrate=%d\n",
+                    disppos,
+                    buf[0] << 4 | buf[1] >> 4,
+                    buf[1] << 8 & 0xf00 | buf[2],
+                    buf[3],
+                    buf[4] << 10 | buf[5] << 2 | buf[6] >> 6
+                  );
+            if (buf[7] & 2)
+                readinput(buf + 8, 64, true);
+            if (buf[7] & 1)
+                readinput(buf + 8, 64, true);
+        break;
+
+        case 0x100 + MPID_EXTENSION: // extension header
+            readinput(buf, 1, true);
+            switch (buf[0] >> 4)
+              {
             case 1:
-                if( outputenglish )
-                    printf("%08x: sequence extension hdr\n",disppos);
-                forceread(buf+1,5,stdin);
-                break;
+                if (outputenglish)
+                    printf("%08x: sequence extension hdr\n", disppos);
+                readinput(buf + 1, 5, true);
+            break;
             case 2:
-                if( outputenglish )
-                    printf("%08x: sequence display extension hdr\n",disppos);
-                forceread(buf+1,(buf[0]&1)?7:3,stdin);
-                break;
+                if (outputenglish)
+                    printf("%08x: sequence display extension hdr\n", disppos);
+                readinput(buf + 1, (buf[0] & 1) ? 7 : 3, true);
+            break;
             case 7:
-                if( outputenglish )
-                    printf("%08x: picture display extension hdr\n",disppos);
-                break;
+                if (outputenglish)
+                    printf("%08x: picture display extension hdr\n", disppos);
+            break;
             case 8:
-                forceread(buf+1,4,stdin);
-                if( buf[4]&64 )
-                    forceread(buf+5,2,stdin);
-                if( outputenglish ) {
-                    printf("%08x: picture coding extension hdr%s%s\n",
-                           disppos,
-                           (buf[3]&0x80)?", top":", bottom",
-                           (buf[3]&2)?", repeat":"");
-                }
-                break;
-            default:
-                if( outputenglish )
-                    printf("%08x: extension hdr %x\n",disppos,buf[0]>>4);
-                break;
-            }
-            forceread(&hdr,4,stdin);
+                readinput(buf + 1, 4, true);
+                if (buf[4] & 64)
+                    readinput(buf + 5, 2, true);
+                if (outputenglish)
+                  {
+                    printf
+                      (
+                        "%08x: picture coding extension hdr%s%s\n",
+                        disppos,
+                        (buf[3] & 0x80) ? ", top" : ", bottom",
+                        (buf[3] & 2) ? ", repeat" : ""
+                     );
+                  } /*if*/
             break;
-
-        case 0x1b7: // end of sequence
-            if( outputenglish )
-                printf("%08x: end of sequence\n",disppos);
-            forceread(&hdr,4,stdin);
+            default:
+                if (outputenglish)
+                    printf("%08x: extension hdr %x\n", disppos, buf[0] >> 4);
             break;
-
-        case 0x1b8: // group of pictures
-            forceread(buf,4,stdin);
-            if( outputenglish ) {
-                printf("%08x: GOP: %s%d:%02d:%02d.%02d, %s%s\n"
-                       ,disppos
-                       ,buf[0]&128?"drop, ":""
-                       ,(buf[0]>>2)&31
-                       ,((buf[0]<<4)|(buf[1]>>4))&63
-                       ,((buf[1]<<3)|(buf[2]>>5))&63
-                       ,((buf[2]<<1)|(buf[3]>>7))&63
-                       ,buf[3]&64?"closed":"open"
-                       ,buf[3]&32?", broken":""
+              } /*switch*/
+        break;
+
+        case 0x100 + MPID_SEQUENCE_END: // end of sequence
+            if (outputenglish)
+                printf("%08x: end of sequence\n", disppos);
+        break;
+
+        case 0x100 + MPID_GOP: // group of pictures
+            readinput(buf, 4, true);
+            if (outputenglish)
+              {
+                printf
+                  (
+                    "%08x: GOP: %s%d:%02d:%02d.%02d, %s%s\n",
+                    disppos,
+                    buf[0] & 128 ? "drop, " : "",
+                    buf[0] >> 2 & 31,
+                    (buf[0] << 4 | buf[1] >> 4) & 63,
+                    (buf[1] << 3 | buf[2] >> 5) & 63,
+                    (buf[2] << 1 | buf[3] >> 7) & 63,
+                    buf[3] & 64 ? "closed" : "open",
+                    buf[3] & 32 ? ", broken" : ""
                     );
-            }
-            forceread(&hdr,4,stdin);
-            break;
+              } /*if*/
+        break;
 
-        case 0x1b9: // end of program stream
-            if( outputenglish )
-                printf("%08x: end of program stream\n",disppos);
-            forceread(&hdr,4,stdin);
-            break;
+        case 0x100 + MPID_PROGRAM_END: // end of program stream
+            if (outputenglish)
+                printf("%08x: end of program stream\n", disppos);
+        break;
 
-        case 0x1ba: // mpeg_pack_header
-        {
+        case 0x100 + MPID_PACK: // mpeg_pack_header
+          {
             uint32_t scr,scrhi,scrext;
             int64_t fulltime;
-            forceread(buf,8,stdin);
-            if((buf[0] & 0xC0) == 0x40) {
-            forceread(buf+8,2,stdin);
-                scrhi=(buf[0]&0x20)>>5;
-                scr=((buf[0]&0x18)<<27)|
-                    ((buf[0]&3)<<28)|
-                    (buf[1]<<20)|
-                    ((buf[2]&0xf8)<<12)|
-                    ((buf[2]&3)<<13)|
-                    (buf[3]<<5)|
-                    ((buf[4]&0xf8)>>3);
-                scrext=((buf[4]&3)<<7)|
-                    (buf[5]>>1);
-                if( scrext >= 300 && outputenglish ) {
-                    printf("WARN: scrext in pack hdr > 300: %u\n",scrext);
-                }
-                fulltime=((int64_t)scrhi)<<32|((int64_t)scr);
-                fulltime*=300;
-                fulltime+=scrext;
+            bool mpeg2 = true;
+            readinput(buf, 8, true);
+            if ((buf[0] & 0xC0) == 0x40)
+              {
+                readinput(buf + 8, 2, true);
+                scrhi = (buf[0] & 0x20) >> 5;
+                scr =
+                        (buf[0] & 0x18) << 27
+                    |
+                        (buf[0] & 3) << 28
+                    |
+                        buf[1] << 20
+                    |
+                        (buf[2] & 0xf8) << 12
+                    |
+                        (buf[2] & 3) << 13
+                    |
+                        buf[3] << 5
+                    |
+                        (buf[4] & 0xf8) >> 3;
+                scrext =
+                        (buf[4] & 3) << 7
+                    |
+                        buf[5] >> 1;
+                if (scrext >= 300 && outputenglish)
+                  {
+                    printf("WARN: scrext in pack hdr > 300: %u\n", scrext);
+                  } /*if*/
+                fulltime = (int64_t)scrhi << 32 | (int64_t)scr;
+                fulltime *= 300;
+                fulltime += scrext;
                 mpeg2 = true;
-        } else if((buf[0] & 0xF0) == 0x20) {
+              }
+            else if ((buf[0] & 0xF0) == 0x20)
+              {
                 mpeg2 = false;
-        fulltime=readpts(buf);
-                fulltime*=300;
-        } else {
-                if( outputenglish )
+                fulltime = readpts(buf);
+                fulltime *= 300;
+              }
+            else
+              {
+                if (outputenglish)
                     printf("WARN: unknown pack header version\n");
-                fulltime=0;
-            }
-
-            if( outputenglish )
-                printf("%08x: mpeg%c pack hdr, %" PRId64 ".%03" PRId64 " sec\n",disppos,mpeg2?'2':'1',fulltime/SCRTIME,(fulltime%SCRTIME)/(SCRTIME/1000));
-            
-            forceread(&hdr,4,stdin);
-            break;
-        }
-
-        case 0x1bb: // mpeg_system_header
-        case 0x1bd:
-        case 0x1be:
-        case 0x1bf:
-        case 0x1c0:
-        case 0x1c1:
-        case 0x1c2:
-        case 0x1c3:
-        case 0x1c4:
-        case 0x1c5:
-        case 0x1c6:
-        case 0x1c7:
-        case 0x1c8:
-        case 0x1c9:
-        case 0x1ca:
-        case 0x1cb:
-        case 0x1cc:
-        case 0x1cd:
-        case 0x1ce:
-        case 0x1cf:
-        case 0x1d0:
-        case 0x1d1:
-        case 0x1d2:
-        case 0x1d3:
-        case 0x1d4:
-        case 0x1d5:
-        case 0x1d6:
-        case 0x1d7:
-        case 0x1d8:
-        case 0x1d9:
-        case 0x1da:
-        case 0x1db:
-        case 0x1dc:
-        case 0x1dd:
-        case 0x1de:
-        case 0x1df:
-        case 0x1e0:
-        case 0x1e1:
-        case 0x1e2:
-        case 0x1e3:
-        case 0x1e4:
-        case 0x1e5:
-        case 0x1e6:
-        case 0x1e7:
-        case 0x1e8:
-        case 0x1e9:
-        case 0x1ea:
-        case 0x1eb:
-        case 0x1ec:
-        case 0x1ed:
-        case 0x1ee:
-        case 0x1ef:
-        {
-            unsigned char c;
-            int ext=0,extra=0,readlen,dowrite=1;
-
-            c=ntohl(hdr);
-            if( outputenglish )
-                printf("%08x: ",disppos);
-            if( c == 0xBB ) {
-                if( outputenglish )
+                fulltime = 0;
+              } /*if*/
+            if (outputenglish)
+                printf
+                  (
+                    "%08x: mpeg%c pack hdr, %" PRId64 ".%03" PRId64 " sec\n",
+                    disppos,
+                    mpeg2 ? '2' : '1',
+                    fulltime / SCRTIME,
+                    (fulltime % SCRTIME) / (SCRTIME / 1000)
+                  );
+          }
+        break;
+        default:
+            handled = false;
+        break;
+      } /*switch*/
+        if
+          (
+                !handled
+            && 
+                !recursed
+            &&
+                (
+                    hdrid == 0x100 + MPID_SYSTEM
+                ||
+                    hdrid == 0x100 + MPID_PRIVATE1
+                ||
+                    hdrid == 0x100 + MPID_PAD
+                ||
+                    hdrid == 0x100 + MPID_PRIVATE2
+                || 
+                    hdrid >= 0x100 + MPID_AUDIO_FIRST && hdrid <= 0x100 + MPID_AUDIO_LAST
+                ||
+                    hdrid >= 0x100 + MPID_VIDEO_FIRST && hdrid <= 0x100 + MPID_VIDEO_LAST
+                )
+          )
+          {
+            bool has_extension = false;
+            unsigned int headerlen, packetlen, contentoffs;
+            int readlen;
+            bool dowrite = !recursed;
+            const int packetid = hdrid & 255;
+            if (outputenglish)
+                printf("%08x: ", disppos);
+            if (packetid == MPID_SYSTEM)
+              {
+                if (outputenglish)
                     printf("system header");
-            } else if( c == 0xBD ) {
+              }
+            else if (packetid == MPID_PRIVATE1)
+              {
                 if (outputenglish)
                     printf("pes private1");
-                ext=1;
-            } else if( c == 0xBE ) {
-                if( outputenglish )
+                has_extension = true;
+              }
+            else if (packetid == MPID_PAD)
+              {
+                if (outputenglish)
                     printf("pes padding");
-            } else if( c == 0xBF ) {
-                if( outputenglish )
+              }
+            else if (packetid == MPID_PRIVATE2)
+              {
+                if (outputenglish)
                     printf("pes private2");
-            } else if( c >= 0xC0 && c <= 0xDF ) {
-                if( outputenglish )
-                    printf("pes audio %d",c-0xC0);
-                if( audiodrop ) {
-                    dowrite=0;
+              }
+            else if (packetid >= MPID_AUDIO_FIRST && packetid <= MPID_AUDIO_LAST)
+              {
+                if (outputenglish)
+                    printf("pes audio %d", packetid - MPID_AUDIO_FIRST);
+                if (audiodrop)
+                  {
+                    dowrite = false;
                     audiodrop--;
-                }
-                ext=1;
-            } else if( c >= 0xE0 && c <= 0xEF ) {
-                if( outputenglish )
-                    printf("pes video %d",c-0xE0);
-                ext=1;
-            }
-            forceread(buf,2,stdin); // pes packet length
-            extra=(buf[0]<<8)|buf[1];
-            readlen=forceread(buf,(extra>sizeof(buf))?sizeof(buf):extra,stdin);
-            extra-=readlen;
-            if( outputenglish ) {
-                if (ntohl(hdr) == 0x1bd) // private stream 1
+                  } /*if*/
+                has_extension = true;
+              }
+            else if (packetid >= MPID_VIDEO_FIRST && packetid <= MPID_VIDEO_LAST)
+              {
+                if (outputenglish)
+                    printf("pes video %d", packetid - MPID_VIDEO_FIRST);
+                has_extension = true;
+              } /*if*/
+            readinput(buf, 2, true); // pes packet length
+            packetlen = buf[0] << 8 | buf[1];
+            readlen = packetlen > sizeof buf ? sizeof buf : packetlen;
+            readinput(buf, readlen, true);
+            packetlen -= readlen;
+            headerlen = buf[2]; /* length of packet header */
+            contentoffs = 3 + headerlen; /* beginning of packet content */
+            if (outputenglish)
+              {
+                if (packetid == MPID_PRIVATE1) // private stream 1
                   {
-                    const int sid = buf[3 + buf[2]]; /* substream ID is first byte after header */
+                    const int sid = buf[contentoffs]; /* substream ID is first byte after header */
                     switch (sid & 0xf8)
                       {
                     case 0x20:
@@ -616,7 +624,7 @@ int main(int argc,char **argv)
                     break;
                       } /*switch*/
                   }
-                else if (ntohl(hdr) == 0x1bf) // private stream 2
+                else if (packetid == MPID_PRIVATE2) // private stream 2
                   {
                     const int sid = buf[0];
                     switch (sid)
@@ -632,144 +640,336 @@ int main(int argc,char **argv)
                     break;
                       } /*switch*/
                   } /*if*/
-                printf("; length=%d",extra+readlen);
-                if( ext ) {
-                    int eptr=3;
-            int hdr=0, has_pts, has_dts, has_std=0, std=0, std_scale=0;
-            
-            if((buf[0] & 0xC0) == 0x80) {
-                mpeg2 = true;
-            hdr = buf[2]+3;
-            eptr = 3;
-            has_pts = buf[1] & 128;
-            has_dts = buf[1] & 64;
-                    }
-                    else {
-                mpeg2 = false;
-            while((buf[hdr] == 0xff) && (hdr<sizeof(buf)))
-                hdr++;
-                        if((buf[hdr] & 0xC0) == 0x40) {
-                has_std = 1;
-                std_scale = ((buf[hdr]&32)?1024:128);
-                std = ((buf[hdr]&31)*256+buf[hdr+1])*std_scale;
-                hdr+=2;
-                        } else has_std = 0;
-                        eptr = hdr;
-            has_pts = (buf[hdr] & 0xE0) == 0x20;
-            has_dts = (buf[hdr] & 0xF0) == 0x30;
-                    }
-
-                    printf("; hdr=%d",hdr);
-                    if( has_pts ) {
+                printf("; length=%d", packetlen + readlen);
+                if (has_extension)
+                  {
+                    int eptr = 3;
+                    bool has_std = false, has_pts, has_dts;
+                    int hdroffs, std=0, std_scale=0;
+                    const bool mpeg2 = (buf[0] & 0xC0) == 0x80;
+                    if (mpeg2)
+                      {
+                        hdroffs = contentoffs;
+                        eptr = 3;
+                        has_pts = (buf[1] & 128) != 0;
+                        has_dts = (buf[1] & 64) != 0;
+                      }
+                    else
+                      {
+                        hdroffs = 0;
+                        while (buf[hdroffs] == 0xff && hdroffs < sizeof(buf))
+                            hdroffs++;
+                        if ((buf[hdroffs] & 0xC0) == 0x40)
+                          {
+                            has_std = true;
+                            std_scale = (buf[hdroffs] & 32) ? 1024 : 128;
+                            std = ((buf[hdroffs] & 31) * 256 + buf[hdroffs + 1]) * std_scale;
+                            hdroffs += 2;
+                          } /*if*/
+                        eptr = hdroffs;
+                        has_pts = (buf[hdroffs] & 0xE0) == 0x20;
+                        has_dts = (buf[hdroffs] & 0xF0) == 0x30;
+                      } /*if*/
+                    printf("; hdr=%d", hdroffs);
+                    if (has_pts)
+                      {
                         int64_t pts;
-                        
-                        pts=readpts(buf+eptr);
-                        eptr+=5;
-                        printf("; pts %" PRId64 ".%03" PRId64 " sec",pts/PTSTIME,(pts%PTSTIME)/(PTSTIME/1000));
-                    }
-                    if( has_dts ) {
+                        pts = readpts(buf + eptr);
+                        eptr += 5;
+                        printf
+                          (
+                            "; pts %" PRId64 ".%03" PRId64 " sec",
+                            pts / PTSTIME,
+                            (pts % PTSTIME) / (PTSTIME / 1000)
+                          );
+                      } /*if*/
+                    if (has_dts)
+                      {
                         int64_t dts;
-                    
-                        dts=readpts(buf+eptr);
-                        eptr+=5;
-                        printf("; dts %" PRId64 ".%03" PRId64 " sec",dts/PTSTIME,(dts%PTSTIME)/(PTSTIME/1000));
-                    }
-            if(mpeg2) {
-                        if( buf[1] & 32 ) {
+                        dts = readpts(buf + eptr);
+                        eptr += 5;
+                        printf
+                          (
+                            "; dts %" PRId64 ".%03" PRId64 " sec",
+                            dts / PTSTIME,
+                            (dts % PTSTIME) / (PTSTIME / 1000)
+                          );
+                      } /*if*/
+                    if (mpeg2)
+                      {
+                        if (buf[1] & 32)
+                          {
                             printf("; escr");
-                            eptr+=6;
-                        }
-                        if( buf[1] & 16 ) {
+                            eptr += 6;
+                          } /*if*/
+                        if (buf[1] & 16)
+                          {
                             printf("; es");
-                            eptr+=2;
-                        }
-                        if( buf[1] & 4 ) {
+                            eptr += 2;
+                          } /*if*/
+                        if (buf[1] & 4)
+                          {
                             printf("; ci");
                             eptr++;
-                        }
-                        if( buf[1] & 2 ) {
+                          } /*if*/
+                        if (buf[1] & 2)
+                          {
                             printf("; crc");
-                            eptr+=2;
-                        }
-                        if( buf[1] & 1 ) {
-                            int pef=buf[eptr];
+                            eptr += 2;
+                          } /*if*/
+                        if (buf[1] & 1)
+                          {
+                            int pef = buf[eptr];
                             eptr++;
                             printf("; (pext)");
-                            if( pef & 128 ) {
+                            if (pef & 128)
+                              {
                                 printf("; user");
-                                eptr+=16;
-                            }
-                            if( pef & 64 ) {
+                                eptr += 16;
+                              } /*if*/
+                            if (pef & 64)
+                              {
                                 printf("; pack");
                                 eptr++;
-                            }
-                            if( pef & 32 ) {
+                              } /*if*/
+                            if (pef & 32)
+                              {
                                 printf("; ppscf");
-                                eptr+=2;
-                            }
-                            if( pef & 16 ) {
-                                std_scale=((buf[eptr]&32)?1024:128);
-                                printf("; pstd=%d (scale=%d)",((buf[eptr]&31)*256+buf[eptr+1])*std_scale, std_scale);
-                                eptr+=2;
-                            }
-                            if( pef & 1 ) {
+                                eptr += 2;
+                              } /*if*/
+                            if (pef & 16)
+                              {
+                                std_scale = (buf[eptr] & 32) ? 1024 : 128;
+                                printf
+                                  (
+                                    "; pstd=%d (scale=%d)",
+                                    ((buf[eptr] & 31) * 256 + buf[eptr + 1]) * std_scale,
+                                    std_scale
+                                  );
+                                eptr += 2;
+                              } /*if*/
+                            if (pef & 1)
+                              {
                                 printf("; (pext2)");
-                                eptr+=2;
-                            }
-                        }
-            } else {
-                        if(has_std)
-                            printf("; pstd=%d (scale=%d)",std, std_scale);
-            }
-                }
+                                eptr += 2;
+                              } /*if*/
+                          } /*if*/
+                      }
+                    else
+                      {
+                        if (has_std)
+                            printf("; pstd=%d (scale=%d)", std, std_scale);
+                      } /*if*/
+                  } /*if*/
                 printf("\n");
-            }
-            if( outputmplex && ext ) {
-                if( buf[1]&128 && firstpts[c] == -1 )
-                    firstpts[c]=readpts(buf+3);
-                if( firstpts[0xC0] != -1 &&
-                    firstpts[0xE0] != -1 ) {
-                    printf("%d\n",firstpts[0xE0]-firstpts[0xC0]);
+              } /*if*/
+            if (outputmplex && has_extension)
+              {
+                if ((buf[1] & 128) != 0 && firstpts[packetid] == -1)
+                    firstpts[packetid] = readpts(buf + 3);
+                if (firstpts[MPID_AUDIO_FIRST] != -1 && firstpts[MPID_VIDEO_FIRST] != -1)
+                  {
+                    printf("%d\n", firstpts[MPID_VIDEO_FIRST] - firstpts[MPID_AUDIO_FIRST]);
                     fflush(stdout);
                     close(1);
                     outputmplex = false;
-                    if( !numofd )
+                    if (!numofd)
                         exit(0);
-                }
-            }
+                  } /*if*/
+              } /*if*/
 #ifdef SHOWDATA
-            if( ext && outputenglish ) {
-                int i=3+buf[2], j;
+            if (has_extension && outputenglish)
+              {
+                int j;
                 printf("  ");
-                for( j=0; j<16; j++ )
-                    printf(" %02x",buf[j+i]);
+                for (j=0; j<16; j++)
+                    printf(" %02x", buf[j + contentoffs]);
                 printf("\n");
-            }
+              } /*if*/
 #endif
-            if( ext ) {
-                if( dowrite )
-                    writetostream(ntohl(hdr)&255,buf+3+buf[2],readlen-3-buf[2]);
-            }
-
-            while( extra ) {
-                readlen=forceread(buf,(extra>sizeof(buf))?sizeof(buf):extra,stdin);
-                if( dowrite )
-                    writetostream(ntohl(hdr)&255,buf,readlen);
-                extra-=readlen;
-            }
-            forceread(&hdr,4,stdin);
-            break;
-        }
+            if (!recursed)
+              {
+                if (has_extension && dowrite)
+                  {
+                    writetostream(packetid, buf + contentoffs, readlen - contentoffs);
+                  } /*if*/
+#if defined(HAVE_NESTED_ROUTINES)
+                if (outputenglish && packetid >= MPID_VIDEO_FIRST && packetid <= MPID_VIDEO_LAST)
+                  {
+                  /* look inside PES packet to report on details of video packets */
+                    unsigned int remaining = readlen;
+                    jmp_buf resume;
+                  /* GCC extension! nested routine */
+                    void bufread(void *ptr, int len, bool required)
+                      {
+                        const unsigned int tocopy = remaining > len ? len : remaining;
+                        if (tocopy != 0)
+                          {
+                            memcpy(ptr, buf + contentoffs, tocopy);
+                            ptr = (unsigned char *)ptr + tocopy;
+                            len -= tocopy;
+                            contentoffs += tocopy;
+                            remaining -= tocopy;
+                            inputpos += tocopy;
+                          } /*if*/
+                        if (len != 0)
+                          {
+                          /* read more of packet */
+                            const unsigned int toread = packetlen < len ? packetlen : len;
+                            readinput(ptr, toread, required);
+                            if (dowrite)
+                              {
+                                writetostream(packetid, ptr, toread);
+                              } /*if*/
+                            packetlen -= toread;
+                            len -= toread;
+                            if (len != 0)
+                              {
+                                if (false /*required*/)
+                                  {
+                                    fprintf(stderr, "Unexpected nested read EOF\n");
+                                  } /*if*/
+                                longjmp(resume, 1);
+                              } /*if*/
+                          } /*if*/
+                      } /*bufread*/
+                    inputpos -= remaining; /* rewind to start of packet content */
+                    if (!setjmp(resume))
+                      {
+                        process_packets(bufread, true);
+                      } /*if*/
+                  }
+                else
+#endif
+                  {
+                    while (packetlen != 0)
+                      {
+                        readlen = packetlen > sizeof buf ? sizeof(buf) : packetlen;
+                        readinput(buf, readlen, true);
+                        if (dowrite)
+                          {
+                            writetostream(packetid, buf, readlen);
+                          } /*if*/
+                        packetlen -= readlen;
+                      } /*while*/
+                  } /*if*/
+              } /*if*/
+            handled = true;
+          } /*if*/
+        if (!handled)
+          {
+            do
+              {
+                if (!recursed && outputenglish && !nounknown)
+                    printf("%08x: unknown hdr: %08x\n", disppos, hdrid);
+                hdr[0] = hdr[1];
+                hdr[1] = hdr[2];
+                hdr[2] = hdr[3];
+                readinput(hdr + 3, 1, false);
+                hdrid =
+                        hdr[0] << 24
+                    |
+                        hdr[1] << 16
+                    |
+                        hdr[2] << 8
+                    |
+                        hdr[3];
+              }
+            while ((hdrid & 0xffffff00) != 0x100);
+            fetchhdr = false; /* already got it */
+          } /*if*/
+      } /*while*/
+  } /*process_packets*/
 
-        default:
-            do {
-                if( outputenglish && !nounknown )
-                    printf("%08x: unknown hdr: %08x\n",disppos,ntohl(hdr));
-                hdr>>=8;
-                forceread1(&c,stdin);
-                hdr|=c<<24;
-            } while( (ntohl(hdr)&0xffffff00)!=0x100 );
+int main(int argc,char **argv)
+  {
+    bool skiptohdr = false;
+    fputs(PACKAGE_HEADER("mpeg2desc"), stderr);
+      {
+        int outputstream = 0, oc, i;
+        for (oc = 0; oc < 256; oc++)
+            outputfds[oc].fd = FD_CLOSED;
+        while (-1 != (oc = getopt(argc,argv,"ha:v:o:msd:u")))
+          {
+            switch (oc)
+              {
+            case 'd':
+                audiodrop = strtounsigned(optarg, "audio drop count");
+            break;
+            case 'a':
+            case 'v':
+                if (outputstream)
+                  {
+                    fprintf(stderr,"can only output one stream to stdout at a time\n; use -o to output more than\none stream\n");
+                    exit(1);
+                  } /*if*/
+                outputstream = (oc == 'a' ? MPID_AUDIO_FIRST : MPID_VIDEO_FIRST) + strtounsigned(optarg, "stream id");
+            break;
+            case 'm':
+                outputmplex = true;
             break;
-        }
-    }
-}
+            case 's':
+                skiptohdr = true;
+            break;
+            case 'o':
+                if (!outputstream)
+                  {
+                    fprintf(stderr,"no stream selected for '%s'\n",optarg);
+                    exit(1);
+                  } /*if*/
+                outputfds[outputstream].fd = FD_TOOPEN;
+                outputfds[outputstream].fname = optarg;
+                outputstream = 0;
+            break;
+            case 'u':
+                nounknown = true;
+            break;
+          // case 'h':
+            default:
+                fprintf(stderr,
+                        "usage: mpeg2desc [options] < movie.mpg\n"
+                        "\t-a #: output audio stream # to stdout\n"
+                        "\t-v #: output video stream # to stdout\n"
+                        "\t-o FILE: output previous stream to FILE instead of stdout\n"
+                        "\t-s: skip to first valid header -- ensures mplex can handle output\n"
+                        "\t-m: output mplex offset to stdout\n"
+                        "\t-u: ignore unknown hdrs\n"
+                        "\t-h: help\n"
+                    );
+                exit(1);
+            break;
+              } /*switch*/
+          } /*while*/
+        if (outputstream)
+          {
+            outputenglish = false;
+            outputfds[outputstream].fd = STDOUT_FILENO;
+          } /*if*/
+        if (outputmplex)
+          {
+            if (!outputenglish)
+              {
+                fprintf(stderr,"Cannot output a stream and the mplex offset at the same time\n");
+                exit(1);
+              } /*if*/
+            outputenglish = false;
+          } /*if*/
+        numofd = 0;
+        for (oc = 0; oc < MAX_FILES; oc++)
+            if (outputfds[oc].fd != -1)
+              {
+                ofdlist[numofd++] = oc;
+                outputfds[oc].firstbuf = 0;
+                outputfds[oc].lastbufptr = &outputfds[oc].firstbuf;
+                outputfds[oc].len = 0;
+                outputfds[oc].isvalid = !skiptohdr;
+              } /*if; for*/
+        FD_ZERO(&rfd);
+        FD_ZERO(&wfd);    
+        for (i = 0; i < 256; i++)
+          {
+            firstpts[i] = -1;
+          } /*for*/
+      }
+    process_packets(forceread, false);
+  } /*main*/
diff --git a/src/readxml.c b/src/readxml.c
index 90bcdce..5552822 100644
--- a/src/readxml.c
+++ b/src/readxml.c
@@ -257,6 +257,19 @@ has_nonws_body:
             xmlFree((xmlChar *)v);
           }
         break;
+      /* give better messages for some other node types: */
+        case XML_READER_TYPE_ENTITY_REFERENCE:
+            fprintf(stderr, "ERR:  Invalid XML entity reference\n");
+            exit(1);
+        break;
+        case XML_READER_TYPE_PROCESSING_INSTRUCTION:
+            fprintf(stderr, "ERR:  Invalid XML processing instruction\n");
+            exit(1);
+        break;
+        case XML_READER_TYPE_DOCUMENT_TYPE:
+            fprintf(stderr, "ERR:  Invalid XML document type\n");
+            exit(1);
+        break;
         default:
             fprintf(stderr, "ERR:  Unknown XML node type %d\n", xmlTextReaderNodeType(f));
             exit(1);
diff --git a/src/spuunmux.c b/src/spuunmux.c
index 5e565d1..5f46481 100644
--- a/src/spuunmux.c
+++ b/src/spuunmux.c
@@ -35,10 +35,12 @@
 #include "compat.h"
 
 #include <fcntl.h>
+#include <errno.h>
 
 #include <netinet/in.h>
 
 #include <png.h>
+#include <zlib.h>
 
 #include "rgb.h"
 #include "common.h"
@@ -565,144 +567,153 @@ static int write_png
   /* outputs the contents of s as a PNG file, converting pixels to colours
     according to map. */
   {
-    unsigned int a, x, y;
-    bool nonzero;
-    unsigned char *out_buf, *temp;
-    FILE *fp;
-    png_structp png_ptr;
-    png_infop info_ptr;
+    int status = -1; /* to begin with */
+    unsigned char *out_buf = NULL;
+    FILE *fp = NULL;
+    png_structp png_ptr = NULL;
+    png_infop info_ptr = NULL;
     const unsigned short subwidth = svcd_adjust ? 704 : 720;
     const unsigned short subheight = video_format == VF_NTSC ? 480 : 576;
-    temp = out_buf = malloc(s->xd * s->yd * 4);
-    nonzero = false;
-    for (y = 0; y < s->yd; y++)
+    do /*once*/
       {
-        for (x = 0; x < s->xd; x++)
+        out_buf = malloc(s->xd * s->yd * 4);
+        if (out_buf == NULL)
           {
-            const unsigned char cix =
-                cmap_find(x + s->x0, y + s->y0, map, nummap, s->img[y * s->xd + x]);
-            *temp++ = current_palette[cix & 15].r;
-            *temp++ = current_palette[cix & 15].g;
-            *temp++ = current_palette[cix & 15].b;
-            *temp++ = (cix >> 4) * 17;
-            if (cix & 0xf0)
-                nonzero = true;
-          } /*for*/
-      } /*for*/
-    if (!nonzero)
-      {
-      /* all transparent, don't bother writing any image */
-        free(out_buf);
-        return 1;
-      } /*if*/
-    fp = fopen(file_name, "wb");
-    if (!fp)
-      {
-        fprintf(stderr, "ERR:  unable to open/create file: %s\n", file_name);
-        return -1;
-      } /*if*/
-    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-    if (!png_ptr)
-        return -1;
-    info_ptr = png_create_info_struct(png_ptr);
-    if (!info_ptr)
-      {
-        png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
-        return -1;
-      } /*if*/
-    if (setjmp(png_ptr->jmpbuf))
-      {
-        png_destroy_write_struct(&png_ptr, &info_ptr);
-        fclose(fp);
-        return -1;
-      } /*if*/
-    png_init_io(png_ptr, fp);
-  /* turn on or off filtering, and/or choose specific filters */
-    png_set_filter(png_ptr, 0, PNG_FILTER_NONE);
-  /* set the zlib compression level */
-    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
-  /* set other zlib parameters */
-    png_set_compression_mem_level(png_ptr, 8);
-    png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY);
-    png_set_compression_window_bits(png_ptr, 15);
-    png_set_compression_method(png_ptr, 8);
-    if (full_size)
-      {
-        png_set_IHDR
-          (
-            /*png_ptr =*/ png_ptr,
-            /*info_ptr =*/ info_ptr,
-            /*width =*/ subwidth,
-            /*height =*/ subheight,
-            /*bit_depth =*/ 8,
-            /*color_type =*/ PNG_COLOR_TYPE_RGB_ALPHA,
-            /*interlace_method =*/ PNG_INTERLACE_NONE,
-            /*compression_method =*/ PNG_COMPRESSION_TYPE_DEFAULT,
-            /*filter_method =*/ PNG_FILTER_TYPE_DEFAULT
-          );
-      }
-    else
-      {
-        png_set_IHDR
-          (
-            /*png_ptr =*/ png_ptr,
-            /*info_ptr =*/ info_ptr,
-            /*width =*/ s->xd,
-            /*height =*/ s->yd,
-            /*bit_depth =*/ 8,
-            /*color_type =*/ PNG_COLOR_TYPE_RGB_ALPHA,
-            /*interlace_method =*/ PNG_INTERLACE_NONE,
-            /*compression_method =*/ PNG_COMPRESSION_TYPE_DEFAULT,
-            /*filter_method =*/ PNG_FILTER_TYPE_DEFAULT
-          );
-      } /*if*/
-    png_write_info(png_ptr, info_ptr);
-    png_set_packing(png_ptr);
-    if (out_buf != NULL)
-      {
-        unsigned int x0 = s->x0, y0 = s->y0, xd = s->xd, yd = s->yd;
-        png_byte *row_pointers[576]; /* big enough for both PAL and NTSC */
-        if (full_size)
+            fprintf(stderr, "ERR:  unable allocate %d-byte PNG buffer\n", s->xd * s->yd * 4);
+            break;
+          } /*if*/
           {
-            unsigned char *image;
-            temp = out_buf;
-            image = malloc(subwidth * subheight * 4);
-            memset(image, 0, subwidth * subheight * 4);    // fill image full transparent
-            // insert image on the correct position
-            for (y = s->y0; y < s->y0 + s->yd; y++)
+            unsigned char *temp = out_buf;
+            bool nonzero = false;
+            unsigned int x, y;
+            for (y = 0; y < s->yd; y++)
               {
-                unsigned char *to = &image[y * subwidth * 4 + s->x0 * 4];
-                if (y >= subheight)
-                  {
-                    fprintf(stderr, "WARN: subtitle %s truncated\n", file_name);
-                    break;
-                  } /*if*/
                 for (x = 0; x < s->xd; x++)
                   {
-                    *to++ = *temp++;
-                    *to++ = *temp++;
-                    *to++ = *temp++;
-                    *to++ = *temp++;
+                    const unsigned char cix =
+                        cmap_find(x + s->x0, y + s->y0, map, nummap, s->img[y * s->xd + x]);
+                    *temp++ = current_palette[cix & 15].r;
+                    *temp++ = current_palette[cix & 15].g;
+                    *temp++ = current_palette[cix & 15].b;
+                    *temp++ = (cix >> 4) * 17;
+                    if (cix & 0xf0)
+                        nonzero = true;
                   } /*for*/
               } /*for*/
-            y0 = 0;
-            x0 = 0;
-            yd = subheight;
-            xd = subwidth;
-            free(out_buf);
-            out_buf = image;
+            if (!nonzero)
+              {
+              /* all transparent, don't bother writing any image */
+                status = 1;
+                break;
+              } /*if*/
+          }
+        fp = fopen(file_name, "wb");
+        if (fp == NULL)
+          {
+            fprintf(stderr, "ERR:  error %s trying to open/create file: %s\n", strerror(errno), file_name);
+            break;
           } /*if*/
-        for (a = 0; a < yd; a++)
+        png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+        if (png_ptr == NULL)
+            break;
+        info_ptr = png_create_info_struct(png_ptr);
+        if (info_ptr == NULL)
+            break;
+        if (setjmp(png_jmpbuf(png_ptr)))
+            break;
+        png_init_io(png_ptr, fp);
+        png_set_filter(png_ptr, 0, PNG_FILTER_NONE);
+        png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
+        png_set_compression_mem_level(png_ptr, 8);
+        png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY);
+        png_set_compression_window_bits(png_ptr, 15);
+        png_set_compression_method(png_ptr, 8);
+        if (full_size)
           {
-            row_pointers[a] = out_buf + a * (xd * 4);
-          } /*for*/
-        png_write_image(png_ptr, row_pointers);
+            png_set_IHDR
+              (
+                /*png_ptr =*/ png_ptr,
+                /*info_ptr =*/ info_ptr,
+                /*width =*/ subwidth,
+                /*height =*/ subheight,
+                /*bit_depth =*/ 8,
+                /*color_type =*/ PNG_COLOR_TYPE_RGB_ALPHA,
+                /*interlace_method =*/ PNG_INTERLACE_NONE,
+                /*compression_method =*/ PNG_COMPRESSION_TYPE_DEFAULT,
+                /*filter_method =*/ PNG_FILTER_TYPE_DEFAULT
+              );
+          }
+        else
+          {
+            png_set_IHDR
+              (
+                /*png_ptr =*/ png_ptr,
+                /*info_ptr =*/ info_ptr,
+                /*width =*/ s->xd,
+                /*height =*/ s->yd,
+                /*bit_depth =*/ 8,
+                /*color_type =*/ PNG_COLOR_TYPE_RGB_ALPHA,
+                /*interlace_method =*/ PNG_INTERLACE_NONE,
+                /*compression_method =*/ PNG_COMPRESSION_TYPE_DEFAULT,
+                /*filter_method =*/ PNG_FILTER_TYPE_DEFAULT
+              );
+          } /*if*/
+        png_write_info(png_ptr, info_ptr);
+        png_set_packing(png_ptr);
+          {
+            unsigned int xd = s->xd, yd = s->yd;
+            png_byte *row_pointers[576]; /* big enough for both PAL and NTSC */
+            unsigned int a, x, y;
+            if (full_size)
+              {
+                unsigned char *image;
+                const unsigned char *temp = out_buf;
+                image = malloc(subwidth * subheight * 4);
+                memset(image, 0, subwidth * subheight * 4);    // fill image full transparent
+                // insert image on the correct position
+                for (y = s->y0; y < s->y0 + s->yd; y++)
+                  {
+                    unsigned char *to = &image[y * subwidth * 4 + s->x0 * 4];
+                    if (y >= subheight)
+                      {
+                        fprintf(stderr, "WARN: subtitle %s truncated\n", file_name);
+                        break;
+                      } /*if*/
+                    for (x = 0; x < s->xd; x++)
+                      {
+                        *to++ = *temp++;
+                        *to++ = *temp++;
+                        *to++ = *temp++;
+                        *to++ = *temp++;
+                      } /*for*/
+                  } /*for*/
+                yd = subheight;
+                xd = subwidth;
+                free(out_buf);
+                out_buf = image;
+              } /*if*/
+            for (a = 0; a < yd; a++)
+              {
+                row_pointers[a] = out_buf + a * (xd * 4);
+              } /*for*/
+            png_write_image(png_ptr, row_pointers);
+          }
         png_write_end(png_ptr, info_ptr);
-        free(out_buf);
+      /* all successfully done */
+        status = 0;
+      }
+    while (false);
+    if (png_ptr != NULL)
+      {
+        png_destroy_write_struct(&png_ptr, &info_ptr);
       } /*if*/
-    png_destroy_write_struct(&png_ptr, &info_ptr);
-    fclose(fp);
-    return 0;
+    if (fp != NULL)
+      {
+        fclose(fp);
+      } /*if*/
+    free(out_buf);
+    return
+        status;
   } /*write_png*/
 
 static void write_pts(const char *preamble, int pts)
diff --git a/src/subgen-image.c b/src/subgen-image.c
old mode 100755
new mode 100644
index f331444..0cf368c
--- a/src/subgen-image.c
+++ b/src/subgen-image.c
@@ -434,7 +434,8 @@ static bool pickbuttongroups(stinfo *s, int ng, int useimg)
                 fprintf
                   (
                     stderr,
-                    "ERR:  Button coordinates out of range: (%d,%d)-(%d,%d)\n",
+                    "ERR:  Button coordinates out of range (%d,%d): (%d,%d)-(%d,%d)\n",
+                    s->xd, s->yd,
                     b->r.x0, b->r.y0, b->r.x1, b->r.y1
                   );
             exit(1);
diff --git a/src/subgen.c b/src/subgen.c
index 37be9c0..6c6bbe1 100644
--- a/src/subgen.c
+++ b/src/subgen.c
@@ -539,10 +539,9 @@ static void muxnext(bool eoinput)
                 if (debug > -1)
                   {
                     fprintf(stderr,\
-                            "ERR:  Sub with too short or negative duration on line %d, skipping\n",\
+                            "WARN:  Sub with too short or negative duration on line %d, skipping\n",\
                             spuindex - 1);
                   } /*if*/
-                exit(1);
                 nr_subtitles_skipped++;
                 continue;
               } /*if*/
@@ -836,9 +835,9 @@ static void textsub_statistics()
 int main(int argc,char **argv)
 {
     int fdi;
-    unsigned int c, ch, a, frame;
-    unsigned short int b, vss;
-    unsigned char psbuf[psbufs], ncnt;
+    unsigned int c, ch, a;
+    unsigned short int b;
+    unsigned char psbuf[psbufs];
     int optch;
 #ifdef HAVE_GETOPT_LONG
     const static struct option longopts[]={
@@ -894,7 +893,6 @@ int main(int argc,char **argv)
       } /*if*/
     tofs = -1;
     debug = 0;
-    ncnt = 0;
     substr = 0; /* default */
     while (-1 != (optch = GETOPTFUNC(argc, argv, "hm:s:v:P")))
       {
@@ -1008,8 +1006,6 @@ int main(int argc,char **argv)
     newsti = getnextsub();
     max_sub_size = 0;
     header_size = 12; /* first PES header extension will have PTS data and a PES extension */
-    vss = 0;
-    frame = 0;
     lps = 0;
     lastgts = 0;
     nextgts = 0;
diff --git a/src/subreader.c b/src/subreader.c
index bee2dce..8426072 100644
--- a/src/subreader.c
+++ b/src/subreader.c
@@ -1708,7 +1708,7 @@ subtitle_elt *sub_read_line_jacosub(subtitle_elt * current)
                     if (!sub_fgets(directive, LINE_LEN))
                         return NULL;
                     trail_space(directive);
-                    strncat(line2, directive, LINE_LEN);
+                    strconcat(line2, LINE_LEN, directive);
                     break;
                   } /*if*/
           /* fallthrough */

-- 
dvdauthor packaging



More information about the pkg-multimedia-commits mailing list