diff -pruN 1:1.0.2-3/aclocal.m4 1:1.1.0-1/aclocal.m4
--- 1:1.0.2-3/aclocal.m4	2017-12-03 15:27:38.000000000 +0000
+++ 1:1.1.0-1/aclocal.m4	2019-02-12 07:45:41.000000000 +0000
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  I
 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'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented b
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
 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.15], [],
+m4_if([$1], [1.16.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,74 @@ 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.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed.  If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+  [AC_LANG_PUSH([C])
+   am_cv_ar_interface=ar
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([am_ar_try])
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+        AC_TRY_EVAL([am_ar_try])
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+     ])
+   AC_LANG_POP([C])])
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  m4_default([$1],
+             [AC_MSG_ERROR([could not determine $AR interface])])
+  ;;
+esac
+AC_SUBST([AR])dnl
+])
+
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,13 +392,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -346,49 +405,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -397,18 +448,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -495,8 +545,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target (and possibly the TAP driver).  The
 # system "awk" is bad on some platforms.
@@ -563,7 +613,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -605,7 +655,7 @@ 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-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +676,7 @@ if test x"${install_sh+set}" != xset; th
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -647,7 +697,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -655,49 +705,42 @@ AC_SUBST([am__leading_dot])])
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-	@echo this is the am__doit target
+	@echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -736,7 +779,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -765,7 +808,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -812,7 +855,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -831,7 +874,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -912,7 +955,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -972,7 +1015,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1000,7 +1043,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1019,7 +1062,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff -pruN 1:1.0.2-3/build-aux/ar-lib 1:1.1.0-1/build-aux/ar-lib
--- 1:1.0.2-3/build-aux/ar-lib	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/build-aux/ar-lib	2019-02-12 07:45:44.000000000 +0000
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    q*) quick=yes   ;;
+    r*) replace=yes ;;
+    s*) index=yes   ;;
+    S*)             ;; # the index is always updated implicitly
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+  yes,* | ,yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$quick$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff -pruN 1:1.0.2-3/build-aux/compile 1:1.1.0-1/build-aux/compile
--- 1:1.0.2-3/build-aux/compile	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/compile	2019-02-12 07:45:44.000000000 +0000
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://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
@@ -255,7 +255,8 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
     func_cl_wrapper "$@"      # Doesn't return...
     ;;
 esac
@@ -339,9 +340,9 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff -pruN 1:1.0.2-3/build-aux/config.guess 1:1.1.0-1/build-aux/config.guess
--- 1:1.0.2-3/build-aux/config.guess	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/config.guess	2019-02-12 07:45:44.000000000 +0000
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2016-10-02'
+timestamp='2018-02-24'
 
 # 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
@@ -15,7 +15,7 @@ timestamp='2016-10-02'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://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
@@ -27,7 +27,7 @@ timestamp='2016-10-02'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2018 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."
@@ -107,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdi
 dummy=$tmp/dummy ;
 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
 case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
+ ,,)    echo "int x;" > "$dummy.c" ;
 	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
 	     CC_FOR_BUILD="$c"; break ;
 	  fi ;
 	done ;
@@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
 	# If the system lacks a compiler, then just pick glibc.
 	# We could probably try harder.
 	LIBC=gnu
 
-	eval $set_cc_for_build
-	cat <<-EOF > $dummy.c
+	eval "$set_cc_for_build"
+	cat <<-EOF > "$dummy.c"
 	#include <features.h>
 	#if defined(__UCLIBC__)
 	LIBC=uclibc
@@ -149,13 +149,20 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+	# If ldd exists, use it to detect musl libc.
+	if command -v ldd >/dev/null && \
+		ldd --version 2>&1 | grep -q ^musl
+	then
+	    LIBC=musl
+	fi
 	;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +176,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-	    /sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || \
+	    "/sbin/$sysctl" 2>/dev/null || \
+	    "/usr/sbin/$sysctl" 2>/dev/null || \
 	    echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
 	    earmv*)
-		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-		machine=${arch}${endian}-unknown
+		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine="${arch}${endian}"-unknown
 		;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently (or will in the future) and ABI.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		os=netbsdelf
 		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
+		eval "$set_cc_for_build"
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
 		then
@@ -208,10 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		;;
 	esac
 	# Determine ABI tags.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
 		;;
 	esac
 	# The OS release
@@ -219,46 +226,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# thus, need a distinct triplet. However, they do not need
 	# kernel version information, so it can be replaced with a
 	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
+	case "$UNAME_VERSION" in
 	    Debian*)
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}${abi}"
+	echo "$machine-${os}${release}${abi}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
 	exit ;;
     *:LibertyBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+	exit ;;
+    *:MidnightBSD:*:*)
+	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:Sortix:*:*)
-	echo ${UNAME_MACHINE}-unknown-sortix
+	echo "$UNAME_MACHINE"-unknown-sortix
 	exit ;;
+    *:Redox:*:*)
+	echo "$UNAME_MACHINE"-unknown-redox
+	exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -310,28 +326,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	# A Tn.n version is a released field test version.
 	# 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`
+	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
 	# 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
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo "$UNAME_MACHINE"-unknown-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo "$UNAME_MACHINE"-unknown-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -343,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
+	echo arm-acorn-riscix"$UNAME_RELEASE"
 	exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
@@ -370,19 +377,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
+	echo i386-pc-auroraux"$UNAME_RELEASE"
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
+	eval "$set_cc_for_build"
 	SUN_ARCH=i386
 	# If there is a compiler, see if it is configured for 64-bit objects.
 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -395,13 +402,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		SUN_ARCH=x86_64
 	    fi
 	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
@@ -410,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 		;;
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
 	exit ;;
     sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
+	echo m68k-sun-sunos"$UNAME_RELEASE"
 	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
+		echo m68k-sun-sunos"$UNAME_RELEASE"
 		;;
 	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
+		echo sparc-sun-sunos"$UNAME_RELEASE"
 		;;
 	esac
 	exit ;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
+	echo sparc-auspex-sunos"$UNAME_RELEASE"
 	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
     # 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}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	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}
+	echo m68k-milan-mint"$UNAME_RELEASE"
 	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
+	echo m68k-hades-mint"$UNAME_RELEASE"
 	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
+	echo m68k-unknown-mint"$UNAME_RELEASE"
 	exit ;;
     m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
+	echo m68k-apple-machten"$UNAME_RELEASE"
 	exit ;;
     powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
+	echo powerpc-apple-machten"$UNAME_RELEASE"
 	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
 	exit ;;
     RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
+	echo mips-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
+	echo vax-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
+	echo clipper-intergraph-clix"$UNAME_RELEASE"
 	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	eval "$set_cc_for_build"
+	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
@@ -485,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
 #endif
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
 	#endif
 	#endif
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
 	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
+	echo mips-mips-riscos"$UNAME_RELEASE"
 	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
@@ -527,17 +534,17 @@ EOF
     AViiON:dgux:*:*)
 	# DG/UX returns AViiON for all architectures
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
 	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+	       [ "$TARGET_BINARY_INTERFACE"x = x ]
 	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
+		echo m88k-dg-dgux"$UNAME_RELEASE"
 	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
 	    fi
 	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
+	    echo i586-dg-dgux"$UNAME_RELEASE"
 	fi
 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
@@ -554,7 +561,7 @@ EOF
 	echo m68k-tektronix-bsd
 	exit ;;
     *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
 	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -566,14 +573,14 @@ EOF
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
+		eval "$set_cc_for_build"
+		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
 
 		main()
@@ -584,7 +591,7 @@ EOF
 			exit(0);
 			}
 EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
 		then
 			echo "$SYSTEM_NAME"
 		else
@@ -598,7 +605,7 @@ EOF
 	exit ;;
     *: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
+	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -607,18 +614,18 @@ EOF
 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
 	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
 	echo romp-ibm-bsd4.4
 	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
 	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
@@ -633,28 +640,28 @@ EOF
 	echo m68k-hp-bsd4.4
 	exit ;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	case "$UNAME_MACHINE" in
+	    9000/31?)            HP_ARCH=m68000 ;;
+	    9000/[34]??)         HP_ARCH=m68k ;;
 	    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
+		    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
+			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
 		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
+		if [ "$HP_ARCH" = "" ]; then
+		    eval "$set_cc_for_build"
+		    sed 's/^		//' << EOF > "$dummy.c"
 
 		#define _HPUX_SOURCE
 		#include <stdlib.h>
@@ -687,13 +694,13 @@ EOF
 		    exit (0);
 		}
 EOF
-		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
 		fi ;;
 	esac
-	if [ ${HP_ARCH} = hppa2.0w ]
+	if [ "$HP_ARCH" = hppa2.0w ]
 	then
-	    eval $set_cc_for_build
+	    eval "$set_cc_for_build"
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +719,15 @@ EOF
 		HP_ARCH=hppa64
 	    fi
 	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
 	exit ;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux"$HPUX_REV"
 	exit ;;
     3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	eval "$set_cc_for_build"
+	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
 	int
 	main ()
@@ -745,11 +752,11 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
 		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
 	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
 	echo hppa1.1-hp-bsd
 	exit ;;
     9000/8??:4.3bsd:*:*)
@@ -758,7 +765,7 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
 	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
 	echo hppa1.1-hp-osf
 	exit ;;
     hp8??:OSF1:*:*)
@@ -766,9 +773,9 @@ EOF
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo "$UNAME_MACHINE"-unknown-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo "$UNAME_MACHINE"-unknown-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -793,127 +800,109 @@ EOF
 	echo c4-convex-bsd
 	exit ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	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/ /_/'`
+	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/ /_/'`
+	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}
+	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
+	case "$UNAME_PROCESSOR" in
 	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		UNAME_PROCESSOR=x86_64 ;;
+	    i386)
+		UNAME_PROCESSOR=i586 ;;
 	esac
+	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
+	echo "$UNAME_MACHINE"-pc-cygwin
 	exit ;;
     *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
+	echo "$UNAME_MACHINE"-pc-mingw64
 	exit ;;
     *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
+	echo "$UNAME_MACHINE"-pc-mingw32
 	exit ;;
     *:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
+	echo "$UNAME_MACHINE"-pc-msys
 	exit ;;
     i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
+	echo "$UNAME_MACHINE"-pc-pw32
 	exit ;;
     *:Interix*:*)
-	case ${UNAME_MACHINE} in
+	case "$UNAME_MACHINE" in
 	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
+		echo i586-pc-interix"$UNAME_RELEASE"
 		exit ;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+		echo x86_64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
     i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
+	echo "$UNAME_MACHINE"-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
     i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
+	echo "$UNAME_MACHINE"-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -927,63 +916,63 @@ EOF
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arm*:Linux:*:*)
-	eval $set_cc_for_build
+	eval "$set_cc_for_build"
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     e2k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     k1om:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	eval "$set_cc_for_build"
+	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
 	#undef ${UNAME_MACHINE}
 	#undef ${UNAME_MACHINE}el
@@ -997,70 +986,74 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
 	;;
     mips64el:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     openrisc*:Linux:*:*)
-	echo or1k-unknown-linux-${LIBC}
+	echo or1k-unknown-linux-"$LIBC"
 	exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-${LIBC}
+	echo sparc-unknown-linux-"$LIBC"
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
+	echo hppa64-unknown-linux-"$LIBC"
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+	  *)    echo hppa-unknown-linux-"$LIBC" ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
+	echo powerpc64-unknown-linux-"$LIBC"
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
+	echo powerpc-unknown-linux-"$LIBC"
 	exit ;;
     ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-${LIBC}
+	echo powerpc64le-unknown-linux-"$LIBC"
 	exit ;;
     ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-${LIBC}
+	echo powerpcle-unknown-linux-"$LIBC"
 	exit ;;
     riscv32:Linux:*:* | riscv64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	if objdump -f /bin/sh | grep -q elf32-x86-64; then
+	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
+	else
+	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+	fi
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1074,34 +1067,34 @@ EOF
 	# 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.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
 	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
+	echo "$UNAME_MACHINE"-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo "$UNAME_MACHINE"-unknown-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo "$UNAME_MACHINE"-unknown-atheos
 	exit ;;
     i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
+	echo "$UNAME_MACHINE"-pc-syllable
 	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+	echo i386-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	echo "$UNAME_MACHINE"-pc-msdosdjgpp
 	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
 	fi
 	exit ;;
     i*86:*:5:[678]*)
@@ -1111,12 +1104,12 @@ EOF
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1126,9 +1119,9 @@ EOF
 			&& UNAME_MACHINE=i686
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv32
+		echo "$UNAME_MACHINE"-pc-sysv32
 	fi
 	exit ;;
     pc:*:*:*)
@@ -1148,9 +1141,9 @@ EOF
 	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1170,9 +1163,9 @@ EOF
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	  && { 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; } ;;
@@ -1181,28 +1174,28 @@ EOF
 	test -r /etc/.relid \
 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
+	echo mips-dde-sysv"$UNAME_RELEASE"
 	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
@@ -1213,7 +1206,7 @@ EOF
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
+		echo "$UNAME_MACHINE"-sni-sysv4
 	else
 		echo ns32k-sni-sysv
 	fi
@@ -1233,23 +1226,23 @@ EOF
 	exit ;;
     i*86:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
+	echo "$UNAME_MACHINE"-stratus-vos
 	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
 	exit ;;
     mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
+	echo m68k-apple-aux"$UNAME_RELEASE"
 	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	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 ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
@@ -1268,49 +1261,56 @@ EOF
 	echo x86_64-unknown-haiku
 	exit ;;
     SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
+	echo sx4-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
+	echo sx5-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
+	echo sx6-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
+	echo sx7-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
+	echo sx8-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
+	echo sx8r-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-ACE:SUPER-UX:*:*)
-	echo sxace-nec-superux${UNAME_RELEASE}
+	echo sxace-nec-superux"$UNAME_RELEASE"
 	exit ;;
     Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval $set_cc_for_build
+	eval "$set_cc_for_build"
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		    grep IS_64BIT_ARCH >/dev/null
+		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		       grep IS_64BIT_ARCH >/dev/null
 		then
 		    case $UNAME_PROCESSOR in
 			i386) UNAME_PROCESSOR=x86_64 ;;
 			powerpc) UNAME_PROCESSOR=powerpc64 ;;
 		    esac
 		fi
+		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		       grep IS_PPC >/dev/null
+		then
+		    UNAME_PROCESSOR=powerpc
+		fi
 	    fi
 	elif test "$UNAME_PROCESSOR" = i386 ; then
 	    # Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1321,7 +1321,7 @@ EOF
 	    # that Apple uses in portable devices.
 	    UNAME_PROCESSOR=x86_64
 	fi
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
@@ -1329,19 +1329,25 @@ EOF
 		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
 	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
+    NEO-*:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
+	echo nse-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSR-*:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+	echo nsv-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
+    NSX-*:NONSTOP_KERNEL:*:*)
+	echo nsx-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
@@ -1350,7 +1356,7 @@ EOF
 	echo bs2000-siemens-sysv
 	exit ;;
     DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
 	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
@@ -1361,7 +1367,7 @@ EOF
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo "$UNAME_MACHINE"-unknown-plan9
 	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
@@ -1382,14 +1388,14 @@ 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/[-(].*//'`
+	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     *:*VMS:*:*)
 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
+	case "$UNAME_MACHINE" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
 	    V*) echo vax-dec-vms ; exit ;;
@@ -1398,32 +1404,44 @@ EOF
 	echo i386-pc-xenix
 	exit ;;
     i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
 	exit ;;
     i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
+	echo "$UNAME_MACHINE"-pc-rdos
 	exit ;;
     i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
+	echo "$UNAME_MACHINE"-pc-aros
 	exit ;;
     x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
+	echo "$UNAME_MACHINE"-unknown-esx
 	exit ;;
     amd64:Isilon\ OneFS:*:*)
 	echo x86_64-unknown-onefs
 	exit ;;
 esac
 
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+	# If we got here on MIPS GNU/Linux, output extra information.
+	cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+	;;
+esac
+
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1446,16 +1464,16 @@ hostinfo               = `(hostinfo) 2>/
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'write-file-functions 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff -pruN 1:1.0.2-3/build-aux/config.sub 1:1.1.0-1/build-aux/config.sub
--- 1:1.0.2-3/build-aux/config.sub	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/config.sub	2019-02-12 07:45:44.000000000 +0000
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2016-11-04'
+timestamp='2018-02-22'
 
 # 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
@@ -15,7 +15,7 @@ timestamp='2016-11-04'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://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
@@ -33,7 +33,7 @@ timestamp='2016-11-04'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIA
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patch
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2018 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."
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -112,7 +112,7 @@ esac
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
@@ -120,16 +120,16 @@ case $maybe_os in
   kopensolaris*-gnu* | cloudabi*-eabi* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    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/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
     ;;
   *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
+    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
+    if [ "$basic_machine" != "$1" ]
+    then os=`echo "$1" | sed 's/.*-/-/'`
     else os=; fi
     ;;
 esac
@@ -178,44 +178,44 @@ case $os in
 		;;
 	-sco6)
 		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco5)
 		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco4)
 		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco3.2.[4-9]*)
 		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco3.2v[4-9]*)
 		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco5v6*)
 		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco*)
 		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-isc)
 		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-clix*)
 		basic_machine=clipper-intergraph
 		;;
 	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
 		;;
 	-lynx*178)
 		os=-lynxos178
@@ -227,10 +227,7 @@ case $os in
 		os=-lynxos
 		;;
 	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
 		;;
 	-psos*)
 		os=-psos
@@ -263,7 +260,7 @@ case $basic_machine in
 	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
-	| i370 | i860 | i960 | ia64 \
+	| i370 | i860 | i960 | ia16 | ia64 \
 	| ip2k | iq2000 \
 	| k1om \
 	| le32 | le64 \
@@ -299,7 +296,7 @@ case $basic_machine in
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
 	| open8 | or1k | or1knd | or32 \
-	| pdp10 | pdp11 | pj | pjl \
+	| pdp10 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pru \
 	| pyramid \
@@ -315,7 +312,7 @@ case $basic_machine in
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| visium \
-	| we32k \
+	| wasm32 \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
@@ -336,7 +333,7 @@ case $basic_machine in
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
 		;;
 	ms1)
 		basic_machine=mt-unknown
@@ -365,7 +362,7 @@ case $basic_machine in
 	  ;;
 	# Object if more than one company name word.
 	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
 		exit 1
 		;;
 	# Recognize the basic CPU types with company name.
@@ -388,7 +385,7 @@ case $basic_machine in
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
+	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
 	| ip2k-* | iq2000-* \
 	| k1om-* \
 	| le32-* | le64-* \
@@ -446,6 +443,7 @@ case $basic_machine in
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
 	| visium-* \
+	| wasm32-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -459,7 +457,7 @@ case $basic_machine in
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
 	386bsd)
-		basic_machine=i386-unknown
+		basic_machine=i386-pc
 		os=-bsd
 		;;
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -493,7 +491,7 @@ case $basic_machine in
 		basic_machine=x86_64-pc
 		;;
 	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	amdahl)
 		basic_machine=580-amdahl
@@ -538,7 +536,7 @@ case $basic_machine in
 		os=-linux
 		;;
 	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=-linux
 		;;
 	bluegene*)
@@ -546,13 +544,13 @@ case $basic_machine in
 		os=-cnk
 		;;
 	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	c90)
 		basic_machine=c90-cray
@@ -641,7 +639,7 @@ case $basic_machine in
 		basic_machine=rs6000-bull
 		os=-bosx
 		;;
-	dpx2* | dpx2*-bull)
+	dpx2*)
 		basic_machine=m68k-bull
 		os=-sysv3
 		;;
@@ -650,7 +648,7 @@ case $basic_machine in
 		os=$os"spe"
 		;;
 	e500v[12]-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=$os"spe"
 		;;
 	ebmon29k)
@@ -742,9 +740,6 @@ case $basic_machine in
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
-	hppa-next)
-		os=-nextstep3
-		;;
 	hppaosf)
 		basic_machine=hppa1.1-hp
 		os=-osf
@@ -757,26 +752,26 @@ case $basic_machine in
 		basic_machine=i370-ibm
 		;;
 	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
 		;;
 	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
 		os=-sysv4
 		;;
 	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
 		os=-sysv
 		;;
 	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
 		os=-solaris2
 		;;
 	i386mach)
 		basic_machine=i386-mach
 		os=-mach
 		;;
-	i386-vsta | vsta)
+	vsta)
 		basic_machine=i386-unknown
 		os=-vsta
 		;;
@@ -795,19 +790,16 @@ case $basic_machine in
 		os=-sysv
 		;;
 	leon-*|leon[3-9]-*)
-		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
 		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
 		;;
 	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=-linux
 		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
 	magnum | m3230)
 		basic_machine=mips-mips
 		os=-sysv
@@ -839,10 +831,10 @@ case $basic_machine in
 		os=-mint
 		;;
 	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
 		;;
 	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
 		;;
 	monitor)
 		basic_machine=m68k-rom68k
@@ -861,7 +853,7 @@ case $basic_machine in
 		os=-msdos
 		;;
 	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
 		basic_machine=i686-pc
@@ -903,7 +895,7 @@ case $basic_machine in
 		basic_machine=v70-nec
 		os=-sysv
 		;;
-	next | m*-next )
+	next | m*-next)
 		basic_machine=m68k-next
 		case $os in
 		    -nextstep* )
@@ -948,6 +940,12 @@ case $basic_machine in
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
+	nsv-tandem)
+		basic_machine=nsv-tandem
+		;;
+	nsx-tandem)
+		basic_machine=nsx-tandem
+		;;
 	op50n-* | op60c-*)
 		basic_machine=hppa1.1-oki
 		os=-proelf
@@ -980,7 +978,7 @@ case $basic_machine in
 		os=-linux
 		;;
 	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=-linux
 		;;
 	pbd)
@@ -996,7 +994,7 @@ case $basic_machine in
 		basic_machine=i386-pc
 		;;
 	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
@@ -1011,16 +1009,16 @@ case $basic_machine in
 		basic_machine=i786-pc
 		;;
 	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	pn)
 		basic_machine=pn-gould
@@ -1030,23 +1028,23 @@ case $basic_machine in
 	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
 	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle)
 		basic_machine=powerpcle-unknown
 		;;
 	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	ppc64)	basic_machine=powerpc64-unknown
 		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	ppc64le | powerpc64little)
 		basic_machine=powerpc64le-unknown
 		;;
 	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	ps2)
 		basic_machine=i386-ibm
@@ -1100,17 +1098,10 @@ case $basic_machine in
 	sequent)
 		basic_machine=i386-sequent
 		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
 	sh5el)
 		basic_machine=sh5le-unknown
 		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
+	simso-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
 		;;
@@ -1129,7 +1120,7 @@ case $basic_machine in
 		os=-sysv4
 		;;
 	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
 	sun2)
 		basic_machine=m68000-sun
@@ -1251,6 +1242,9 @@ case $basic_machine in
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	x64)
+		basic_machine=x86_64-pc
+		;;
 	xbox)
 		basic_machine=i686-pc
 		os=-mingw32
@@ -1259,20 +1253,12 @@ case $basic_machine in
 		basic_machine=xps100-honeywell
 		;;
 	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
 		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
 		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1301,10 +1287,6 @@ case $basic_machine in
 	vax)
 		basic_machine=vax-dec
 		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
-		;;
 	pdp11)
 		basic_machine=pdp11-dec
 		;;
@@ -1314,9 +1296,6 @@ case $basic_machine in
 	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
-		;;
 	cydra)
 		basic_machine=cydra-cydrome
 		;;
@@ -1336,7 +1315,7 @@ case $basic_machine in
 		# Make sure to match an already-canonicalized machine name.
 		;;
 	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1344,10 +1323,10 @@ esac
 # Here we canonicalize certain aliases for manufacturers.
 case $basic_machine in
 	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
 		;;
 	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
 		;;
 	*)
 		;;
@@ -1358,8 +1337,8 @@ 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
@@ -1370,18 +1349,19 @@ case $os in
 	-solaris)
 		os=-solaris2
 		;;
-	-svr4*)
-		os=-sysv4
-		;;
 	-unixware*)
 		os=-sysv4.2uw
 		;;
 	-gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
-	# First accept the basic system types.
+	# es1800 is here to avoid being matched by es* (a different OS)
+	-es1800*)
+		os=-ose
+		;;
+	# Now accept the basic system types.
 	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
+	# Each alternative MUST end in a * to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
@@ -1391,25 +1371,26 @@ case $os in
 	      | -aos* | -aros* | -cloudabi* | -sortix* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
 	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -morphos* | -superux* | -rtmk* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-	      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
+	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
+	      | -midnightbsd*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1426,12 +1407,12 @@ case $os in
 	-nto*)
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	-sim | -xray | -os68k* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
+		os=`echo "$os" | sed -e 's|mac|macos|'`
 		;;
 	-linux-dietlibc)
 		os=-linux-dietlibc
@@ -1440,10 +1421,10 @@ case $os in
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
 	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
 		;;
 	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
 		;;
 	-opened*)
 		os=-openedition
@@ -1454,12 +1435,6 @@ case $os in
 	-wince*)
 		os=-wince
 		;;
-	-osfrose*)
-		os=-osfrose
-		;;
-	-osf*)
-		os=-osf
-		;;
 	-utek*)
 		os=-bsd
 		;;
@@ -1484,7 +1459,7 @@ case $os in
 	-nova*)
 		os=-rtmk-nova
 		;;
-	-ns2 )
+	-ns2)
 		os=-nextstep2
 		;;
 	-nsk*)
@@ -1506,7 +1481,7 @@ case $os in
 	-oss*)
 		os=-sysv3
 		;;
-	-svr4)
+	-svr4*)
 		os=-sysv4
 		;;
 	-svr3)
@@ -1521,24 +1496,28 @@ case $os in
 	-ose*)
 		os=-ose
 		;;
-	-es1800*)
-		os=-ose
-		;;
-	-xenix)
-		os=-xenix
-		;;
 	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 		os=-mint
 		;;
-	-aros*)
-		os=-aros
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
 	-dicos*)
 		os=-dicos
 		;;
+	-pikeos*)
+		# Until real need of OS specific support for
+		# particular features comes up, bare metal
+		# configurations are quite functional.
+		case $basic_machine in
+		    arm*)
+			os=-eabi
+			;;
+		    *)
+			os=-elf
+			;;
+		esac
+		;;
 	-nacl*)
 		;;
 	-ios)
@@ -1548,7 +1527,7 @@ case $os in
 	*)
 		# Get rid of the `-' at the beginning of $os.
 		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1638,12 +1617,12 @@ case $basic_machine in
 	sparc-* | *-sun)
 		os=-sunos4.1.1
 		;;
+	pru-*)
+		os=-elf
+		;;
 	*-be)
 		os=-beos
 		;;
-	*-haiku)
-		os=-haiku
-		;;
 	*-ibm)
 		os=-aix
 		;;
@@ -1683,7 +1662,7 @@ case $basic_machine in
 	m88k-omron*)
 		os=-luna
 		;;
-	*-next )
+	*-next)
 		os=-nextstep
 		;;
 	*-sequent)
@@ -1698,9 +1677,6 @@ case $basic_machine in
 	i370-*)
 		os=-mvs
 		;;
-	*-next)
-		os=-nextstep3
-		;;
 	*-gould)
 		os=-sysv
 		;;
@@ -1810,15 +1786,15 @@ case $basic_machine in
 				vendor=stratus
 				;;
 		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo $basic_machine$os
+echo "$basic_machine$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'write-file-functions 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff -pruN 1:1.0.2-3/build-aux/depcomp 1:1.1.0-1/build-aux/depcomp
--- 1:1.0.2-3/build-aux/depcomp	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/depcomp	2019-02-12 07:45:44.000000000 +0000
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 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
@@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://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
@@ -783,9 +783,9 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff -pruN 1:1.0.2-3/build-aux/install-sh 1:1.1.0-1/build-aux/install-sh
--- 1:1.0.2-3/build-aux/install-sh	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/install-sh	2019-02-12 07:45:44.000000000 +0000
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2014-09-12.12; # UTC
+scriptversion=2018-03-11.20; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,15 +271,18 @@ do
     fi
     dst=$dst_arg
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
       if test "$is_target_a_directory" = never; then
         echo "$0: $dst_arg: Is a directory" >&2
         exit 1
       fi
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+	*/) dst=$dst$dstbase;;
+	*)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
     else
       dstdir=`dirname "$dst"`
@@ -288,6 +291,11 @@ do
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
@@ -324,14 +332,16 @@ do
             # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
             ;;
           *)
-            # $RANDOM is not portable (e.g. dash);  use it when possible to
-            # lower collision chance
+            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
+            # here however when possible just to lower collision chance.
             tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
             trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
 
-            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
-            # create the $tmpdir first (and fail if unsuccessful) to make sure
-            # that nobody tries to guess the $tmpdir name.
+            # Because "mkdir -p" follows existing symlinks and we likely work
+            # directly in world-writeable /tmp, make sure that the '$tmpdir'
+            # directory is successfully created first before we actually test
+            # 'mkdir -p' feature.
             if (umask $mkdir_umask &&
                 $mkdirprog $mkdir_mode "$tmpdir" &&
                 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
@@ -434,8 +444,8 @@ do
   else
 
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@@ -500,9 +510,9 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff -pruN 1:1.0.2-3/build-aux/ltmain.sh 1:1.1.0-1/build-aux/ltmain.sh
--- 1:1.0.2-3/build-aux/ltmain.sh	2017-12-03 15:27:35.000000000 +0000
+++ 1:1.1.0-1/build-aux/ltmain.sh	2019-02-12 07:45:33.000000000 +0000
@@ -31,7 +31,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-2"
+VERSION="2.4.6 Debian-2.4.6-4"
 package_revision=2.4.6
 
 
@@ -64,7 +64,7 @@ package_revision=2.4.6
 # libraries, which are installed to $pkgauxdir.
 
 # Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
@@ -580,16 +580,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1+=\\ \$func_quote_arg_result"
   }'
 else
   func_append_quoted ()
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1=\$$1\\ \$func_quote_arg_result"
   }
 fi
 
@@ -1091,85 +1091,181 @@ func_relative_path ()
 }
 
 
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg.  Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
 {
     $debug_cmd
 
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+    func_quote_portable_result=$2
+
+    # one-time-loop (easy break)
+    while true
+    do
+      if $1; then
+        func_quote_portable_result=`$ECHO "$2" | $SED \
+          -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+        break
       fi
 
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
+      # Quote for eval.
+      case $func_quote_portable_result in
+        *[\\\`\"\$]*)
+          case $func_quote_portable_result in
+            *[\[\*\?]*)
+              func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
+              break
+              ;;
+          esac
+
+          func_quote_portable_old_IFS=$IFS
+          for _G_char in '\' '`' '"' '$'
+          do
+            # STATE($1) PREV($2) SEPARATOR($3)
+            set start "" ""
+            func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+            IFS=$_G_char
+            for _G_part in $func_quote_portable_result
+            do
+              case $1 in
+              quote)
+                func_append func_quote_portable_result "$3$2"
+                set quote "$_G_part" "\\$_G_char"
+                ;;
+              start)
+                set first "" ""
+                func_quote_portable_result=
+                ;;
+              first)
+                set quote "$_G_part" ""
+                ;;
+              esac
+            done
+          done
+          IFS=$func_quote_portable_old_IFS
           ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-	  ;;
+        *) ;;
       esac
-
-      if test -n "$func_quote_for_eval_result"; then
-	func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
+      break
     done
+
+    func_quote_portable_unquoted_result=$func_quote_portable_result
+    case $func_quote_portable_result in
+      # double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and variable expansion
+      # for a subsequent eval.
+      # many bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_portable_result=\"$func_quote_portable_result\"
+        ;;
+    esac
 }
 
 
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal).  This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed.  Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+  func_quotefast_eval ()
+  {
+    printf -v func_quotefast_eval_result %q "$1"
+  }
+else
+  func_quotefast_eval ()
+  {
+    func_quote_portable false "$1"
+    func_quotefast_eval_result=$func_quote_portable_result
+  }
+fi
 
-    case $1 in
-      *[\\\`\"]*)
-	_G_arg=`$ECHO "$1" | $SED \
-	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later.  MODEs argument may contain zero ore more
+# specifiers listed below separated by ',' character.  This function returns two
+# values:
+#   i) func_quote_arg_result
+#      double-quoted (when needed), suitable for a subsequent eval
+#  ii) func_quote_arg_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.  Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+#       - escape shell special characters
+# 'expand'
+#       - the same as 'eval';  but do not quote variable references
+# 'pretty'
+#       - request aesthetic output, i.e. '"a b"' instead of 'a\ b'.  This might
+#         later used in func_quote to get output like: 'echo "a b"' instead of
+#         'echo a\ b'.  This is slower than default on some shells.
+# 'unquoted'
+#       - produce also $func_quote_arg_unquoted_result which does not contain
+#         wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+#   string      | *_result              | *_unquoted_result
+#   ------------+-----------------------+-------------------
+#   "           | \"                    | \"
+#   a b         | "a b"                 | a b
+#   "a b"       | "\"a b\""             | \"a b\"
+#   *           | "*"                   | *
+#   z="${x-$y}" | "z=\"\${x-\$y}\""     | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+#   string        |   *_result          |  *_unquoted_result
+#   --------------+---------------------+--------------------
+#   z="${x-$y}"   | "z=\"${x-$y}\""     | z=\"${x-$y}\"
+func_quote_arg ()
+{
+    _G_quote_expand=false
+    case ,$1, in
+      *,expand,*)
+        _G_quote_expand=:
+        ;;
     esac
 
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        _G_arg=\"$_G_arg\"
+    case ,$1, in
+      *,pretty,*|*,expand,*|*,unquoted,*)
+        func_quote_portable $_G_quote_expand "$2"
+        func_quote_arg_result=$func_quote_portable_result
+        func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+        ;;
+      *)
+        # Faster quote-for-eval for some shells.
+        func_quotefast_eval "$2"
+        func_quote_arg_result=$func_quotefast_eval_result
         ;;
     esac
+}
+
 
-    func_quote_for_expand_result=$_G_arg
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command.  See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+    $debug_cmd
+    _G_func_quote_mode=$1 ; shift
+    func_quote_result=
+    while test 0 -lt $#; do
+      func_quote_arg "$_G_func_quote_mode" "$1"
+      if test -n "$func_quote_result"; then
+        func_append func_quote_result " $func_quote_arg_result"
+      else
+        func_append func_quote_result "$func_quote_arg_result"
+      fi
+      shift
+    done
 }
 
 
@@ -1215,8 +1311,8 @@ func_show_eval ()
     _G_cmd=$1
     _G_fail_exp=${2-':'}
 
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
+    func_quote_arg pretty,expand "$_G_cmd"
+    eval "func_notquiet $func_quote_arg_result"
 
     $opt_dry_run || {
       eval "$_G_cmd"
@@ -1241,8 +1337,8 @@ func_show_eval_locale ()
     _G_fail_exp=${2-':'}
 
     $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
+      func_quote_arg expand,pretty "$_G_cmd"
+      eval "func_echo $func_quote_arg_result"
     }
 
     $opt_dry_run || {
@@ -1370,7 +1466,7 @@ func_lt_ver ()
 #! /bin/sh
 
 # Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
+scriptversion=2015-10-12.13; # UTC
 
 # A portable, pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
@@ -1530,6 +1626,8 @@ func_run_hooks ()
 {
     $debug_cmd
 
+    _G_rc_run_hooks=false
+
     case " $hookable_fns " in
       *" $1 "*) ;;
       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
@@ -1538,16 +1636,16 @@ func_run_hooks ()
     eval _G_hook_fns=\$$1_hooks; shift
 
     for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
+      if eval $_G_hook '"$@"'; then
+        # store returned options list back into positional
+        # parameters for next 'cmd' execution.
+        eval _G_hook_result=\$${_G_hook}_result
+        eval set dummy "$_G_hook_result"; shift
+        _G_rc_run_hooks=:
+      fi
     done
 
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
+    $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
 }
 
 
@@ -1557,10 +1655,16 @@ func_run_hooks ()
 ## --------------- ##
 
 # In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
+# full positional parameter list in your hook function, you may remove/edit
+# any options that you action, and then pass back the remaining unprocessed
 # options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
+# 'eval'.  In this case you also must return $EXIT_SUCCESS to let the
+# hook's caller know that it should pay attention to
+# '<hooked_function_name>_result'.  Returning $EXIT_FAILURE signalizes that
+# arguments are left untouched by the hook and therefore caller will ignore the
+# result variable.
+#
+# Like this:
 #
 #    my_options_prep ()
 #    {
@@ -1570,9 +1674,11 @@ func_run_hooks ()
 #        usage_message=$usage_message'
 #      -s, --silent       don'\''t print informational messages
 #    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
+#        # No change in '$@' (ignored completely by this hook).  There is
+#        # no need to do the equivalent (but slower) action:
+#        # func_quote eval ${1+"$@"}
+#        # my_options_prep_result=$func_quote_result
+#        false
 #    }
 #    func_add_hook func_options_prep my_options_prep
 #
@@ -1581,25 +1687,37 @@ func_run_hooks ()
 #    {
 #        $debug_cmd
 #
+#        args_changed=false
+#
 #        # Note that for efficiency, we parse as many options as we can
 #        # recognise in a loop before passing the remainder back to the
 #        # caller on the first unrecognised argument we encounter.
 #        while test $# -gt 0; do
 #          opt=$1; shift
 #          case $opt in
-#            --silent|-s) opt_silent=: ;;
+#            --silent|-s) opt_silent=:
+#                         args_changed=:
+#                         ;;
 #            # Separate non-argument short options:
 #            -s*)         func_split_short_opt "$_G_opt"
 #                         set dummy "$func_split_short_opt_name" \
 #                             "-$func_split_short_opt_arg" ${1+"$@"}
 #                         shift
+#                         args_changed=:
 #                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#            *)           # Make sure the first unrecognised option "$_G_opt"
+#                         # is added back to "$@", we could need that later
+#                         # if $args_changed is true.
+#                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
 #          esac
 #        done
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
+#        if $args_changed; then
+#          func_quote eval ${1+"$@"}
+#          my_silent_option_result=$func_quote_result
+#        fi
+#
+#        $args_changed
 #    }
 #    func_add_hook func_parse_options my_silent_option
 #
@@ -1611,16 +1729,32 @@ func_run_hooks ()
 #        $opt_silent && $opt_verbose && func_fatal_help "\
 #    '--silent' and '--verbose' options are mutually exclusive."
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
+#        false
 #    }
 #    func_add_hook func_validate_options my_option_validation
 #
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
 # options you parse.  It's preferable to append if you can, so that
 # multiple option parsing hooks can be added safely.
 
 
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+    $debug_cmd
+
+    _G_func_options_finish_exit=false
+    if func_run_hooks func_options ${1+"$@"}; then
+      func_options_finish_result=$func_run_hooks_result
+      _G_func_options_finish_exit=:
+    fi
+
+    $_G_func_options_finish_exit
+}
+
+
 # func_options [ARG]...
 # ---------------------
 # All the functions called inside func_options are hookable. See the
@@ -1630,17 +1764,28 @@ func_options ()
 {
     $debug_cmd
 
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
+    _G_rc_options=false
 
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
+    for my_func in options_prep parse_options validate_options options_finish
+    do
+      if eval func_$my_func '${1+"$@"}'; then
+        eval _G_res_var='$'"func_${my_func}_result"
+        eval set dummy "$_G_res_var" ; shift
+        _G_rc_options=:
+      fi
+    done
+
+    # Save modified positional parameters for caller.  As a top-level
+    # options-parser function we always need to set the 'func_options_result'
+    # variable (regardless the $_G_rc_options value).
+    if $_G_rc_options; then
+      func_options_result=$_G_res_var
+    else
+      func_quote eval ${1+"$@"}
+      func_options_result=$func_quote_result
+    fi
 
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
+    $_G_rc_options
 }
 
 
@@ -1649,9 +1794,9 @@ func_options ()
 # All initialisations required before starting the option parse loop.
 # Note that when calling hook functions, we pass through the list of
 # positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
+# needs to propagate that back to rest of this script, then the complete
 # modified list must be put in 'func_run_hooks_result' before
-# returning.
+# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
 func_hookable func_options_prep
 func_options_prep ()
 {
@@ -1661,10 +1806,14 @@ func_options_prep ()
     opt_verbose=false
     opt_warning_types=
 
-    func_run_hooks func_options_prep ${1+"$@"}
+    _G_rc_options_prep=false
+    if func_run_hooks func_options_prep ${1+"$@"}; then
+      _G_rc_options_prep=:
+      # save modified positional parameters for caller
+      func_options_prep_result=$func_run_hooks_result
+    fi
 
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
+    $_G_rc_options_prep
 }
 
 
@@ -1678,18 +1827,20 @@ func_parse_options ()
 
     func_parse_options_result=
 
+    _G_rc_parse_options=false
     # this just eases exit handling
     while test $# -gt 0; do
       # Defer to hook functions for initial option parsing, so they
       # get priority in the event of reusing an option name.
-      func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
+      if func_run_hooks func_parse_options ${1+"$@"}; then
+        eval set dummy "$func_run_hooks_result"; shift
+        _G_rc_parse_options=:
+      fi
 
       # Break out of the loop if we already parsed every option.
       test $# -gt 0 || break
 
+      _G_match_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -1704,7 +1855,10 @@ func_parse_options ()
 		      ;;
 
         --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
+                      if test $# = 0 && func_missing_arg $_G_opt; then
+                        _G_rc_parse_options=:
+                        break
+                      fi
                       case " $warning_categories $1" in
                         *" $1 "*)
                           # trailing space prevents matching last $1 above
@@ -1757,15 +1911,25 @@ func_parse_options ()
                       shift
                       ;;
 
-        --)           break ;;
+        --)           _G_rc_parse_options=: ; break ;;
         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift
+                      _G_match_parse_options=false
+                      break
+                      ;;
       esac
+
+      $_G_match_parse_options && _G_rc_parse_options=:
     done
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
+
+    if $_G_rc_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      func_parse_options_result=$func_quote_result
+    fi
+
+    $_G_rc_parse_options
 }
 
 
@@ -1778,16 +1942,21 @@ func_validate_options ()
 {
     $debug_cmd
 
+    _G_rc_validate_options=false
+
     # Display all warnings if -W was not given.
     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    func_run_hooks func_validate_options ${1+"$@"}
+    if func_run_hooks func_validate_options ${1+"$@"}; then
+      # save modified positional parameters for caller
+      func_validate_options_result=$func_run_hooks_result
+      _G_rc_validate_options=:
+    fi
 
     # Bail if the options were screwed!
     $exit_cmd $EXIT_FAILURE
 
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
+    $_G_rc_validate_options
 }
 
 
@@ -2068,7 +2237,7 @@ include the following information:
        compiler:       $LTCC
        compiler flags: $LTCFLAGS
        linker:         $LD (gnu? $with_gnu_ld)
-       version:        $progname $scriptversion Debian-2.4.6-2
+       version:        $progname $scriptversion Debian-2.4.6-4
        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
 
@@ -2270,6 +2439,8 @@ libtool_options_prep ()
     nonopt=
     preserve_args=
 
+    _G_rc_lt_options_prep=:
+
     # Shorthand for --mode=foo, only valid as the first argument
     case $1 in
     clean|clea|cle|cl)
@@ -2293,11 +2464,18 @@ libtool_options_prep ()
     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
       shift; set dummy --mode uninstall ${1+"$@"}; shift
       ;;
+    *)
+      _G_rc_lt_options_prep=false
+      ;;
     esac
 
-    # Pass back the list of options.
-    func_quote_for_eval ${1+"$@"}
-    libtool_options_prep_result=$func_quote_for_eval_result
+    if $_G_rc_lt_options_prep; then
+      # Pass back the list of options.
+      func_quote eval ${1+"$@"}
+      libtool_options_prep_result=$func_quote_result
+    fi
+
+    $_G_rc_lt_options_prep
 }
 func_add_hook func_options_prep libtool_options_prep
 
@@ -2309,9 +2487,12 @@ libtool_parse_options ()
 {
     $debug_cmd
 
+    _G_rc_lt_parse_options=false
+
     # Perform our own loop to consume as many options as possible in
     # each iteration.
     while test $# -gt 0; do
+      _G_match_lt_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
@@ -2386,15 +2567,22 @@ libtool_parse_options ()
                         func_append preserve_args " $_G_opt"
                         ;;
 
-	# An option not handled by this hook function:
-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+        # An option not handled by this hook function:
+        *)              set dummy "$_G_opt" ${1+"$@"} ; shift
+                        _G_match_lt_parse_options=false
+                        break
+                        ;;
       esac
+      $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
     done
 
+    if $_G_rc_lt_parse_options; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      libtool_parse_options_result=$func_quote_result
+    fi
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    libtool_parse_options_result=$func_quote_for_eval_result
+    $_G_rc_lt_parse_options
 }
 func_add_hook func_parse_options libtool_parse_options
 
@@ -2451,8 +2639,8 @@ libtool_validate_options ()
     }
 
     # Pass back the unparsed argument list
-    func_quote_for_eval ${1+"$@"}
-    libtool_validate_options_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_result
 }
 func_add_hook func_validate_options libtool_validate_options
 
@@ -3418,8 +3606,8 @@ func_mode_compile ()
       esac
     done
 
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
+    func_quote_arg pretty "$libobj"
+    test "X$libobj" != "X$func_quote_arg_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
       && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
@@ -3492,8 +3680,8 @@ compiler."
 
     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
     srcfile=$func_to_tool_file_result
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
+    func_quote_arg pretty "$srcfile"
+    qsrcfile=$func_quote_arg_result
 
     # Only build a PIC object if we are building libtool libraries.
     if test yes = "$build_libtool_libs"; then
@@ -4096,8 +4284,8 @@ func_mode_install ()
        case $nonopt in *shtool*) :;; *) false;; esac
     then
       # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
+      func_quote_arg pretty "$nonopt"
+      install_prog="$func_quote_arg_result "
       arg=$1
       shift
     else
@@ -4107,8 +4295,8 @@ func_mode_install ()
 
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    func_append install_prog "$func_quote_for_eval_result"
+    func_quote_arg pretty "$arg"
+    func_append install_prog "$func_quote_arg_result"
     install_shared_prog=$install_prog
     case " $install_prog " in
       *[\\\ /]cp\ *) install_cp=: ;;
@@ -4165,12 +4353,12 @@ func_mode_install ()
       esac
 
       # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      func_append install_prog " $func_quote_for_eval_result"
+      func_quote_arg pretty "$arg"
+      func_append install_prog " $func_quote_arg_result"
       if test -n "$arg2"; then
-	func_quote_for_eval "$arg2"
+	func_quote_arg pretty "$arg2"
       fi
-      func_append install_shared_prog " $func_quote_for_eval_result"
+      func_append install_shared_prog " $func_quote_arg_result"
     done
 
     test -z "$install_prog" && \
@@ -4181,8 +4369,8 @@ func_mode_install ()
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
-	func_quote_for_eval "$install_override_mode"
-	func_append install_shared_prog " -m $func_quote_for_eval_result"
+	func_quote_arg pretty "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_arg_result"
       fi
     fi
 
@@ -4478,8 +4666,8 @@ func_mode_install ()
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
 	        $opt_quiet || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
+	          func_quote_arg expand,pretty "$relink_command"
+		  eval "func_echo $func_quote_arg_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
@@ -5258,7 +5446,8 @@ else
   if test \"\$libtool_execute_magic\" != \"$magic\"; then
     file=\"\$0\""
 
-    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    func_quote_arg pretty "$ECHO"
+    qECHO=$func_quote_arg_result
     $ECHO "\
 
 # A function that is used when there is no print builtin or printf.
@@ -5268,7 +5457,7 @@ func_fallback_echo ()
 \$1
 _LTECHO_EOF'
 }
-    ECHO=\"$qECHO\"
+    ECHO=$qECHO
   fi
 
 # Very basic option parsing. These options are (a) specific to
@@ -6611,9 +6800,9 @@ func_mode_link ()
     while test "$#" -gt 0; do
       arg=$1
       shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
+      func_quote_arg pretty,unquoted "$arg"
+      qarg=$func_quote_arg_unquoted_result
+      func_append libtool_args " $func_quote_arg_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
@@ -7211,9 +7400,9 @@ func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $func_quote_for_eval_result"
-	  func_append compiler_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $func_quote_arg_result"
+	  func_append compiler_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7227,10 +7416,10 @@ func_mode_link ()
 	save_ifs=$IFS; IFS=,
 	for flag in $args; do
 	  IFS=$save_ifs
-          func_quote_for_eval "$flag"
-	  func_append arg " $wl$func_quote_for_eval_result"
-	  func_append compiler_flags " $wl$func_quote_for_eval_result"
-	  func_append linker_flags " $func_quote_for_eval_result"
+          func_quote_arg pretty "$flag"
+	  func_append arg " $wl$func_quote_arg_result"
+	  func_append compiler_flags " $wl$func_quote_arg_result"
+	  func_append linker_flags " $func_quote_arg_result"
 	done
 	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
@@ -7254,8 +7443,8 @@ func_mode_link ()
 
       # -msg_* for osf cc
       -msg_*)
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -7279,8 +7468,8 @@ func_mode_link ()
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
       -specs=*|-fsanitize=*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
@@ -7301,15 +7490,15 @@ func_mode_link ()
 	  continue
         else
 	  # Otherwise treat like 'Some other compiler flag' below
-	  func_quote_for_eval "$arg"
-	  arg=$func_quote_for_eval_result
+	  func_quote_arg pretty "$arg"
+	  arg=$func_quote_arg_result
         fi
 	;;
 
       # Some other compiler flag.
       -* | +*)
-        func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+        func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
 
       *.$objext)
@@ -7429,8 +7618,8 @@ func_mode_link ()
       *)
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg=$func_quote_for_eval_result
+	func_quote_arg pretty "$arg"
+	arg=$func_quote_arg_result
 	;;
       esac # arg
 
@@ -9942,8 +10131,8 @@ EOF
 	    for cmd in $concat_cmds; do
 	      IFS=$save_ifs
 	      $opt_quiet || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
+		  func_quote_arg expand,pretty "$cmd"
+		  eval "func_echo $func_quote_arg_result"
 	      }
 	      $opt_dry_run || eval "$cmd" || {
 		lt_exit=$?
@@ -10036,8 +10225,8 @@ EOF
 	  eval cmd=\"$cmd\"
 	  IFS=$save_ifs
 	  $opt_quiet || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
+	    func_quote_arg expand,pretty "$cmd"
+	    eval "func_echo $func_quote_arg_result"
 	  }
 	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
@@ -10511,12 +10700,12 @@ EOF
 	  elif eval var_value=\$$var; test -z "$var_value"; then
 	    relink_command="$var=; export $var; $relink_command"
 	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	    func_quote_arg pretty "$var_value"
+	    relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
 	  fi
 	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+	func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
+	relink_command=$func_quote_arg_unquoted_result
       fi
 
       # Only actually do things if not in dry run mode.
@@ -10756,13 +10945,14 @@ EOF
 	elif eval var_value=\$$var; test -z "$var_value"; then
 	  relink_command="$var=; export $var; $relink_command"
 	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  func_quote_arg pretty,unquoted "$var_value"
+	  relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
 	fi
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      func_quote_arg pretty,unquoted "$relink_command"
+      relink_command=$func_quote_arg_unquoted_result
       if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
diff -pruN 1:1.0.2-3/build-aux/missing 1:1.1.0-1/build-aux/missing
--- 1:1.0.2-3/build-aux/missing	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/build-aux/missing	2019-02-12 07:45:44.000000000 +0000
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://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
@@ -101,9 +101,9 @@ else
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING:
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff -pruN 1:1.0.2-3/ChangeLog 1:1.1.0-1/ChangeLog
--- 1:1.0.2-3/ChangeLog	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/ChangeLog	2019-02-12 07:45:08.000000000 +0000
@@ -1,3 +1,15 @@
+2019-02-12: Version 1.1.0
+- Add initial support for OpenJDK 11.
+- Add initial support for UHD disc BD-J menus.
+- Add support for compiling .jar file with Java 9+ compiler.
+- Move AWT classes to separate .jar file.
+- Update libudfread submodule repository URL.
+- Improve main title selection.
+- Improve error resilience and stability.
+- Improve BD-J compability.
+- Fix playback of some broken BD-J discs.
+- Fix playback of discs without normal titles (only TopMenu / FirstPlay title).
+
 2017-12-01: Version 1.0.2
 - Add initial support for UHD BluRay discs (without BD-J menus).
 - Detect JRE (from the Java Applet plugin) on MacOS.
diff -pruN 1:1.0.2-3/configure 1:1.1.0-1/configure
--- 1:1.0.2-3/configure	2017-12-03 15:27:38.000000000 +0000
+++ 1:1.1.0-1/configure	2019-02-12 07:45:42.000000000 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libbluray 1.0.2.
+# Generated by GNU Autoconf 2.69 for libbluray 1.1.0.
 #
 # Report bugs to <http://www.videolan.org/developers/libbluray.html>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libbluray'
 PACKAGE_TARNAME='libbluray'
-PACKAGE_VERSION='1.0.2'
-PACKAGE_STRING='libbluray 1.0.2'
+PACKAGE_VERSION='1.1.0'
+PACKAGE_STRING='libbluray 1.1.0'
 PACKAGE_BUGREPORT='http://www.videolan.org/developers/libbluray.html'
 PACKAGE_URL=''
 
@@ -688,9 +688,14 @@ DX_DOCDIR
 DX_CONFIG
 DX_PROJECT
 BDJ_BOOTCLASSPATH
+BDJ_J2SE_FALSE
+BDJ_J2SE_TRUE
 BDJ_TYPE
+USING_JAVAC_9_FALSE
+USING_JAVAC_9_TRUE
 USING_BDJAVA_BUILD_JAR_FALSE
 USING_BDJAVA_BUILD_JAR_TRUE
+JAVAC
 HAVE_ANT
 USING_EXAMPLES_FALSE
 USING_EXAMPLES_TRUE
@@ -713,8 +718,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 RANLIB
-ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -727,6 +730,8 @@ EGREP
 GREP
 SED
 LIBTOOL
+ac_ct_AR
+AR
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -734,7 +739,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -822,7 +826,8 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -837,6 +842,7 @@ with_freetype
 with_fontconfig
 with_bdj_type
 with_bdj_bootclasspath
+with_java9
 enable_dependency_tracking
 enable_shared
 enable_static
@@ -1429,7 +1435,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 libbluray 1.0.2 to adapt to many kinds of systems.
+\`configure' configures libbluray 1.1.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1500,7 +1506,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libbluray 1.0.2:";;
+     short | recursive ) echo "Configuration of libbluray 1.1.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1552,6 +1558,8 @@ Optional Packages:
                           Specify BD-J build-time bootclass path (example
                           /opt/PhoneME/lib/btclasses.zip;/opt/PhoneME/lib/xmlparer.jar).
                           Default is empty.
+  --with-java9            build with Java 9+ (drop support for Java <1.6)
+                          [default=without]
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-aix-soname=aix|svr4|both
@@ -1657,7 +1665,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libbluray configure 1.0.2
+libbluray configure 1.1.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2083,7 +2091,7 @@ 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 libbluray $as_me 1.0.2, which was
+It was created by libbluray $as_me 1.1.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2532,7 +2540,7 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-am__api_version='1.15'
+am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3018,7 +3026,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libbluray'
- VERSION='1.0.2'
+ VERSION='1.1.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3048,8 +3056,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}ma
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target (and possibly the TAP driver).  The
@@ -3216,7 +3224,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3298,6 +3306,10 @@ $as_echo "#define _WIN32_IE 0x0501" >>co
     SYS=netbsd
     CFLAGS="${CFLAGS} -D_NETBSD_SOURCE"
     ;;
+  freebsd*)
+    SYS=freebsd
+    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=700"
+    ;;
   *)
     SYS="${host_os}"
     ;;
@@ -3398,6 +3410,13 @@ else
 fi
 
 
+
+# Check whether --with-java9 was given.
+if test "${with_java9+set}" = set; then :
+  withval=$with_java9;
+fi
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4249,45 +4268,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-	@echo this is the am__doit target
+	@echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -4438,6 +4457,178 @@ fi
 
 
 
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar lib "link -lib"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+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 ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar lib "link -lib"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+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 ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  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
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  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
+
+   am_cv_ar_interface=ar
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+        am_cv_ar_interface=ar
+      else
+        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+  (eval $am_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+        if test "$ac_status" -eq 0; then
+          am_cv_ar_interface=lib
+        else
+          am_cv_ar_interface=unknown
+        fi
+      fi
+      rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   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
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+  ;;
+lib)
+  # Microsoft lib, so override with the ar-lib wrapper script.
+  # FIXME: It is wrong to rewrite AR.
+  # But if we don't then we get into trouble of one sort or another.
+  # A longer-term fix would be to have automake use am__AR in this case,
+  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+  # similar.
+  AR="$am_aux_dir/ar-lib $AR"
+  ;;
+unknown)
+  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+  ;;
+esac
+
 case `pwd` in
   *\ * | *\	*)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -5937,7 +6128,6 @@ test -z "$sharedlib_from_linklib_cmd" &&
 
 
 
-
 if test -n "$ac_tool_prefix"; then
   for ac_prog in ar
   do
@@ -13806,7 +13996,10 @@ else
 
 fi
 
-# Extract the first word of "ant", so it can be a program name with args.
+if test "x$use_bdjava_jar" = "xyes"; then :
+
+
+        # Extract the first word of "ant", so it can be a program name with args.
 set dummy ant; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -13844,8 +14037,116 @@ $as_echo "no" >&6; }
 fi
 
 
-if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then
-    as_fn_error $? "BD-J requires ANT, but ant was not found. Please install it." "$LINENO" 5
+    if test "x$HAVE_ANT" = "xno"; then :
+
+        as_fn_error $? "BD-J requires ANT, but ant was not found. Install ant or disable jar file building (--disable-bdjava-jar)" "$LINENO" 5
+
+fi
+
+    if test "x$with_java9" = "x" -a "$BDJ_TYPE" != "j2me"; then :
+
+
+                if test "x${JAVA_HOME}" != "x"; then :
+  # Extract the first word of "javac", so it can be a program name with args.
+set dummy javac; 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_JAVAC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $JAVAC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "${JAVA_HOME}/bin"
+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_JAVAC="$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
+
+  test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="none"
+  ;;
+esac
+fi
+JAVAC=$ac_cv_path_JAVAC
+if test -n "$JAVAC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5
+$as_echo "$JAVAC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+  # Extract the first word of "javac", so it can be a program name with args.
+set dummy javac; 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_JAVAC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $JAVAC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_JAVAC="$JAVAC" # 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_JAVAC="$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
+
+  test -z "$ac_cv_path_JAVAC" && ac_cv_path_JAVAC="none"
+  ;;
+esac
+fi
+JAVAC=$ac_cv_path_JAVAC
+if test -n "$JAVAC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5
+$as_echo "$JAVAC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+        if test x"$JAVAC" = x"none"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: javac not found. Disable jar file building (--disable-bdjava-jar), set JAVA_HOME or javac type with --without-java9 option." >&5
+$as_echo "$as_me: WARNING: javac not found. Disable jar file building (--disable-bdjava-jar), set JAVA_HOME or javac type with --without-java9 option." >&2;}
+fi
+
+                javac_version=`"$JAVAC" -version 2>&1 | head -n 1`
+        with_java9=`echo "$javac_version" | grep -E -q '^javac\ (9|1[0-9])' && echo yes`
+
+fi
+
+    if test "x$with_java9" = "xyes" -a "$BDJ_TYPE" != "j2me"; then :
+  java_code_version=1.6
+else
+  java_code_version=1.4
+fi
+
 fi
 
 
@@ -13866,6 +14167,14 @@ else
   USING_BDJAVA_BUILD_JAR_FALSE=
 fi
 
+ if  test x"$with_java9" = x"yes" ; then
+  USING_JAVAC_9_TRUE=
+  USING_JAVAC_9_FALSE='#'
+else
+  USING_JAVAC_9_TRUE='#'
+  USING_JAVAC_9_FALSE=
+fi
+
 
 if test "$BDJ_TYPE" = "j2me"; then
 
@@ -13875,6 +14184,14 @@ else
   BDJ_TYPE=j2se
 fi
 
+ if  test x"$BDJ_TYPE" != x"j2me" ; then
+  BDJ_J2SE_TRUE=
+  BDJ_J2SE_FALSE='#'
+else
+  BDJ_J2SE_TRUE='#'
+  BDJ_J2SE_FALSE=
+fi
+
 
 
 if test ! -f "${srcdir}/contrib/libudfread/src/udfread.h"; then
@@ -15827,12 +16144,12 @@ esac
 
 BLURAY_VERSION_MAJOR=1
 
-BLURAY_VERSION_MINOR=0
+BLURAY_VERSION_MINOR=1
 
-BLURAY_VERSION_MICRO=2
+BLURAY_VERSION_MICRO=0
 
 
-LT_VERSION_INFO="2:2:0"
+LT_VERSION_INFO="3:0:1"
 
 
 
@@ -15987,6 +16304,14 @@ if test -z "${USING_BDJAVA_BUILD_JAR_TRU
   as_fn_error $? "conditional \"USING_BDJAVA_BUILD_JAR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${USING_JAVAC_9_TRUE}" && test -z "${USING_JAVAC_9_FALSE}"; then
+  as_fn_error $? "conditional \"USING_JAVAC_9\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BDJ_J2SE_TRUE}" && test -z "${BDJ_J2SE_FALSE}"; then
+  as_fn_error $? "conditional \"BDJ_J2SE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then
   as_fn_error $? "conditional \"DX_COND_doc\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16472,7 +16797,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libbluray $as_me 1.0.2, which was
+This file was extended by libbluray $as_me 1.1.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16538,7 +16863,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libbluray config.status 1.0.2
+libbluray config.status 1.1.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16657,7 +16982,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -17555,29 +17880,35 @@ $as_echo "$as_me: executing $ac_file com
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$mf" : 'X\(//\)[^/]' \| \
-	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$am_mf" : 'X\(//\)[^/]' \| \
+	 X"$am_mf" : 'X\(//\)$' \| \
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -17595,53 +17926,48 @@ $as_echo X"$mf" |
 	    q
 	  }
 	  s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$file" : 'X\(//\)[^/]' \| \
-	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$am_mf" : 'X\(//\)$' \| \
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
 	  }
-	  /^X\(\/\/\)$/{
+	  /^X\/\(\/\/\)$/{
 	    s//\1/
 	    q
 	  }
-	  /^X\(\/\).*/{
+	  /^X\/\(\/\).*/{
 	    s//\1/
 	    q
 	  }
 	  s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "libtool":C)
@@ -18232,6 +18558,12 @@ echo "  Summary:"
 echo "  --------"
 echo "  BD-J type:                     $BDJ_TYPE"
 echo "  build JAR:                     $use_bdjava_jar"
+if test "x$use_bdjava_jar" = "xyes"; then
+if test "x$javac_version" != "x"; then
+echo "      javac version:             $javac_version"
+fi
+echo "      Java binary version:       $java_code_version"
+fi
 if test x"$BDJ_BOOTCLASSPATH" != x""; then
 echo "  BD-J bootclasspath:            $BDJ_BOOTCLASSPATH"
 fi
diff -pruN 1:1.0.2-3/configure.ac 1:1.1.0-1/configure.ac
--- 1:1.0.2-3/configure.ac	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/configure.ac	2019-02-12 07:45:08.000000000 +0000
@@ -1,7 +1,7 @@
 dnl library version number
 m4_define([bluray_major], 1)
-m4_define([bluray_minor], 0)
-m4_define([bluray_micro], 2)
+m4_define([bluray_minor], 1)
+m4_define([bluray_micro], 0)
 m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro])
 
 dnl shared library version (.so version)
@@ -12,16 +12,16 @@ dnl - If interfaces have been changed or
 dnl
 dnl Library file name will be libbluray.so.(current-age).age.revision
 dnl
-m4_define([lt_current],  2)
-m4_define([lt_revision], 2)
-m4_define([lt_age],      0)
+m4_define([lt_current],  3)
+m4_define([lt_revision], 0)
+m4_define([lt_age],      1)
 
 dnl initilization
 AC_INIT([libbluray], bluray_version, [http://www.videolan.org/developers/libbluray.html])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
+AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip subdir-objects -Wall])
 AC_CONFIG_HEADERS(config.h)
 
 dnl Enable silent rules only when available (automake 1.11 or later).
@@ -51,6 +51,10 @@ case "${host_os}" in
     SYS=netbsd
     CFLAGS="${CFLAGS} -D_NETBSD_SOURCE"
     ;;
+  freebsd*)
+    SYS=freebsd
+    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=700"
+    ;;
   *)
     SYS="${host_os}"
     ;;
@@ -108,9 +112,13 @@ AC_ARG_WITH([bdj-bootclasspath],
   [BDJ_BOOTCLASSPATH=$withval],
   [BDJ_BOOTCLASSPATH=])
 
+AC_ARG_WITH([java9],
+  [AS_HELP_STRING([--with-java9], [build with Java 9+ (drop support for Java <1.6) @<:@default=without@:>@])])
+
 dnl required programs
 AC_PROG_CC
 AM_PROG_CC_C_O
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_PROG_LIBTOOL
 
 dnl required types
@@ -223,14 +231,35 @@ AS_IF([test "x${JDK_HOME}" != "x"], [
     BDJAVA_CFLAGS='-I${abs_top_srcdir}/jni -I${abs_top_srcdir}/jni/'"${java_os}"
 ])
 
-AC_CHECK_PROG(HAVE_ANT, [ant], yes, no)
-if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then
-    AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.])
-fi
+AS_IF([test "x$use_bdjava_jar" = "xyes"], [
+
+    dnl check for ant
+    AC_CHECK_PROG(HAVE_ANT, [ant], yes, no)
+    AS_IF([test "x$HAVE_ANT" = "xno"], [
+        AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Install ant or disable jar file building (--disable-bdjava-jar)])
+    ])
+
+    AS_IF([test "x$with_java9" = "x" -a "$BDJ_TYPE" != "j2me"], [
+
+        dnl check for javac
+        AS_IF([test "x${JAVA_HOME}" != "x"],
+              [AC_PATH_PROG(JAVAC, javac, none, ["${JAVA_HOME}/bin"])],
+              [AC_PATH_PROG(JAVAC, javac, none)])
+        AS_IF([test x"$JAVAC" = x"none"],
+            [AC_MSG_WARN([javac not found. Disable jar file building (--disable-bdjava-jar), set JAVA_HOME or javac type with --with[out]-java9 option.])])
+
+        dnl check for Java 9+
+        javac_version=`"$JAVAC" -version 2>&1 | head -n 1`
+        [with_java9=`echo "$javac_version" | grep -E -q '^javac\ (9|1[0-9])' && echo yes`]
+    ])
+
+    AS_IF([test "x$with_java9" = "xyes" -a "$BDJ_TYPE" != "j2me"], [java_code_version=1.6], [java_code_version=1.4])
+])
 
 AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
 AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
 AM_CONDITIONAL([USING_BDJAVA_BUILD_JAR], [ test $use_bdjava_jar = "yes" ])
+AM_CONDITIONAL([USING_JAVAC_9], [ test x"$with_java9" = x"yes" ])
 
 dnl BD-J type
 if test "$BDJ_TYPE" = "j2me"; then
@@ -239,6 +268,7 @@ else
   BDJ_TYPE=j2se
 fi
 AC_SUBST(BDJ_TYPE)
+AM_CONDITIONAL([BDJ_J2SE], [ test x"$BDJ_TYPE" != x"j2me" ])
 dnl bootclasspath
 AC_SUBST(BDJ_BOOTCLASSPATH)
 
@@ -281,6 +311,12 @@ echo "  Summary:"
 echo "  --------"
 echo "  BD-J type:                     $BDJ_TYPE"
 echo "  build JAR:                     $use_bdjava_jar"
+if test "x$use_bdjava_jar" = "xyes"; then
+if test "x$javac_version" != "x"; then
+echo "      javac version:             $javac_version"
+fi
+echo "      Java binary version:       $java_code_version"
+fi
 if test x"$BDJ_BOOTCLASSPATH" != x""; then
 echo "  BD-J bootclasspath:            $BDJ_BOOTCLASSPATH"
 fi
diff -pruN 1:1.0.2-3/debian/changelog 1:1.1.0-1/debian/changelog
--- 1:1.0.2-3/debian/changelog	2018-04-03 07:20:42.000000000 +0000
+++ 1:1.1.0-1/debian/changelog	2019-02-12 14:36:35.000000000 +0000
@@ -1,3 +1,19 @@
+libbluray (1:1.1.0-1) unstable; urgency=medium
+
+  [ Felipe Sateler ]
+  * Change maintainer address to debian-multimedia@lists.debian.org
+
+  [ Sebastian Ramacher ]
+  * New upstream release.
+    - Add support for Java 9 and higher. (Closes: #893227)
+  * debian/control: Bump Standards-Version.
+  * debian/patches: Refresh patches.
+  * debian/:
+    - Build with the default JDK again.
+    - Disable doxygen latex output until either doxygen or texlive are fixed.
+
+ -- Sebastian Ramacher <sramacher@debian.org>  Tue, 12 Feb 2019 15:36:35 +0100
+
 libbluray (1:1.0.2-3) unstable; urgency=medium
 
   * debian/: Force building with Java 8 and also required Java 8 JRE during
diff -pruN 1:1.0.2-3/debian/control 1:1.1.0-1/debian/control
--- 1:1.0.2-3/debian/control	2018-04-03 07:20:42.000000000 +0000
+++ 1:1.1.0-1/debian/control	2019-02-12 14:31:02.000000000 +0000
@@ -1,14 +1,14 @@
 Source: libbluray
 Section: libs
 Priority: optional
-Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
+Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
 Uploaders:
  Rico Tzschichholz <ricotz@ubuntu.com>,
  Reinhard Tartler <siretart@tauware.de>,
  Sebastian Ramacher <sramacher@debian.org>
 Build-Depends: debhelper (>= 11),
                pkg-config,
-               openjdk-8-jdk,
+               default-jdk,
                libfreetype6-dev,
                libfontconfig-dev,
                libxml2-dev
@@ -16,12 +16,8 @@ Build-Depends-Indep: ant,
                      doxygen,
                      graphviz,
                      javahelper,
-                     texlive-latex-base,
-                     texlive-latex-recommended,
-                     texlive-latex-extra,
-                     texlive-fonts-recommended,
                      libasm-java
-Standards-Version: 4.1.3
+Standards-Version: 4.3.0
 Homepage: http://www.videolan.org/developers/libbluray.html
 Vcs-Git: https://salsa.debian.org/multimedia-team/libbluray.git
 Vcs-Browser: https://salsa.debian.org/multimedia-team/libbluray
@@ -68,7 +64,7 @@ Multi-Arch: foreign
 Architecture: all
 Depends: libbluray2 (>= ${source:Version}),
          libbluray2 (<< ${source:Version}.1~),
-         openjdk-8-jre-headless,
+         default-jre-headless | java2-runtime-headless,
          ${java:Depends},
          ${misc:Depends}
 Description: Blu-ray Disc Java support library (BD-J library)
diff -pruN 1:1.0.2-3/debian/libbluray-doc.doc-base 1:1.1.0-1/debian/libbluray-doc.doc-base
--- 1:1.0.2-3/debian/libbluray-doc.doc-base	2018-03-19 21:05:44.000000000 +0000
+++ 1:1.1.0-1/debian/libbluray-doc.doc-base	2019-02-12 14:31:25.000000000 +0000
@@ -5,9 +5,3 @@ Section: Programming/C
 Format: HTML
 Index: /usr/share/doc/libbluray-dev/html/index.html
 Files: /usr/share/doc/libbluray-dev/html/*.html
-
-Format: PDF
-Files: /usr/share/doc/libbluray-dev/libbluray.pdf.gz
-
-Format: PostScript
-Files: /usr/share/doc/libbluray-dev/libbluray.ps.gz
diff -pruN 1:1.0.2-3/debian/libbluray-doc.docs 1:1.1.0-1/debian/libbluray-doc.docs
--- 1:1.0.2-3/debian/libbluray-doc.docs	2015-12-01 22:03:53.000000000 +0000
+++ 1:1.1.0-1/debian/libbluray-doc.docs	2019-02-12 14:31:15.000000000 +0000
@@ -1,3 +1 @@
 doc/doxygen/html
-doc/doxygen/libbluray.pdf
-doc/doxygen/libbluray.ps
diff -pruN 1:1.0.2-3/debian/patches/0002-Work-around-751532.patch 1:1.1.0-1/debian/patches/0002-Work-around-751532.patch
--- 1:1.0.2-3/debian/patches/0002-Work-around-751532.patch	2018-03-19 21:06:56.000000000 +0000
+++ 1:1.1.0-1/debian/patches/0002-Work-around-751532.patch	2019-02-12 14:30:43.000000000 +0000
@@ -9,10 +9,10 @@ accordingly.
  1 file changed, 1 insertion(+)
 
 diff --git a/configure.ac b/configure.ac
-index 5fd3c8d..3bb5d14 100644
+index 8f731a9..22bd34c 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -209,6 +209,7 @@ case $host_os in
+@@ -217,6 +217,7 @@ case $host_os in
       freebsd*) java_os=freebsd ;;
       solaris*) java_os=solaris ;;
       darwin*)  java_os=darwin ;;
diff -pruN 1:1.0.2-3/debian/patches/0003-Use-system-asm-instead-of-embedded-copy.patch 1:1.1.0-1/debian/patches/0003-Use-system-asm-instead-of-embedded-copy.patch
--- 1:1.0.2-3/debian/patches/0003-Use-system-asm-instead-of-embedded-copy.patch	2018-03-19 21:06:56.000000000 +0000
+++ 1:1.1.0-1/debian/patches/0003-Use-system-asm-instead-of-embedded-copy.patch	2019-02-12 14:30:43.000000000 +0000
@@ -3,26 +3,26 @@ Date: Wed, 14 Jun 2017 20:22:27 +0200
 Subject: Use system asm instead of embedded copy
 
 ---
- src/libbluray/bdj/build.xml | 17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
+ src/libbluray/bdj/build.xml | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
 
 diff --git a/src/libbluray/bdj/build.xml b/src/libbluray/bdj/build.xml
-index 938cd44..2db7825 100644
+index 1753779..19163d1 100644
 --- a/src/libbluray/bdj/build.xml
 +++ b/src/libbluray/bdj/build.xml
-@@ -19,22 +19,25 @@
+@@ -21,17 +21,15 @@
  
      <target name="compile" depends="init"
              description="compile the source " >
 -        <javac srcdir="${src_asm}" destdir="${build}" debug="yes"
 -               bootclasspath="${bootclasspath}"
--               source="1.5" target="1.5">
+-               source="${java_version_asm}" target="${java_version_asm}">
 -               <compilerarg value="-XDignore.symbol.file"/>
 -               <compilerarg value="-Xlint:-deprecation"/>
 -        </javac>
          <javac srcdir="${src}${src_awt}" destdir="${build}" debug="yes"
                 bootclasspath="${bootclasspath}"
-                source="1.4" target="1.4">
+                source="${java_version_bdj}" target="${java_version_bdj}">
                 <compilerarg value="-XDignore.symbol.file"/>
                 <compilerarg value="-Xlint:-deprecation"/>
 +               <classpath>
@@ -32,14 +32,14 @@ index 938cd44..2db7825 100644
          </javac>
      </target>
      <target name="dist" depends="compile"
-             description="generate the distribution" >
--        <jar jarfile="${dist}/libbluray-${version}.jar" basedir="${build}" />
-+            <jar jarfile="${dist}/libbluray-${version}.jar" basedir="${build}">
-+                <manifest>
-+                    <attribute name="Class-Path" value="/usr/share/java/asm.jar" />
-+                    <attribute name="Class-Path" value="/usr/share/java/asm-commons.jar" />
-+                </manifest>
-+            </jar>
-     </target>
- 
-     <target name="clean"
+@@ -39,6 +37,10 @@
+         <jar jarfile="${dist}/libbluray-${version}.jar" basedir="${build}">
+             <exclude name="java/awt/**" />
+             <exclude name="sun/**" />
++            <manifest>
++                <attribute name="Class-Path" value="/usr/share/java/asm.jar" />
++                <attribute name="Class-Path" value="/usr/share/java/asm-commons.jar" />
++            </manifest>
+         </jar>
+         <jar jarfile="${dist}/libbluray-awt-${version}.jar" basedir="${build}">
+           <include name="java/awt/**" />
diff -pruN 1:1.0.2-3/debian/patches/0004-Disable-PDF-documentation.patch 1:1.1.0-1/debian/patches/0004-Disable-PDF-documentation.patch
--- 1:1.0.2-3/debian/patches/0004-Disable-PDF-documentation.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/debian/patches/0004-Disable-PDF-documentation.patch	2019-02-12 14:30:43.000000000 +0000
@@ -0,0 +1,38 @@
+From: Sebastian Ramacher <sramacher@debian.org>
+Date: Tue, 12 Feb 2019 15:28:59 +0100
+Subject: Disable PDF documentation
+
+Current doxygen and texlive fail with:
+
+| ! Missing } inserted.
+| <inserted text>
+|                 }
+| l.495 \end{DoxyParams}
+|
+| ?
+| ! Emergency stop.
+| <inserted text>
+|                 }
+| l.495 \end{DoxyParams}
+|
+| !  ==> Fatal error occurred, no output PDF file produced!
+
+Until this is fixed in doxygen or texlive, disable generation of the PDF
+documentation.
+---
+ doc/doxygen-config | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/doxygen-config b/doc/doxygen-config
+index 98083a7..1d19da1 100644
+--- a/doc/doxygen-config
++++ b/doc/doxygen-config
+@@ -1613,7 +1613,7 @@ EXTRA_SEARCH_MAPPINGS  =
+ # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+ # The default value is: YES.
+ 
+-GENERATE_LATEX         = YES
++GENERATE_LATEX         = NO
+ 
+ # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+ # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
diff -pruN 1:1.0.2-3/debian/patches/series 1:1.1.0-1/debian/patches/series
--- 1:1.0.2-3/debian/patches/series	2018-04-03 07:20:42.000000000 +0000
+++ 1:1.1.0-1/debian/patches/series	2019-02-12 14:30:43.000000000 +0000
@@ -1,3 +1,4 @@
 0001-Do-not-download-image-from-the-web.patch
 0002-Work-around-751532.patch
 0003-Use-system-asm-instead-of-embedded-copy.patch
+0004-Disable-PDF-documentation.patch
diff -pruN 1:1.0.2-3/debian/rules 1:1.1.0-1/debian/rules
--- 1:1.0.2-3/debian/rules	2018-04-03 07:20:42.000000000 +0000
+++ 1:1.1.0-1/debian/rules	2019-02-12 12:36:21.000000000 +0000
@@ -1,7 +1,5 @@
 #!/usr/bin/make -f
 
-include /usr/share/dpkg/architecture.mk
-
 confflags  = --with-libxml2
 confflags += --with-freetype
 confflags += --with-bdj-type=j2se
@@ -10,7 +8,7 @@ confflags_java   = --enable-bdjava-jar
 confflags_nojava = --disable-bdjava-jar
 
 # Use default java implementation
-export JDK_HOME=/usr/lib/jvm/java-8-openjdk-$(DEB_HOST_ARCH)
+export JDK_HOME=/usr/lib/jvm/default-java
 ifeq (,$(wildcard $(JDK_HOME)))
     $(info "warning: No suitable jni.h was found. Package will most probably FTBFS!")
 endif
diff -pruN 1:1.0.2-3/m4/libtool.m4 1:1.1.0-1/m4/libtool.m4
--- 1:1.0.2-3/m4/libtool.m4	2017-12-03 15:27:35.000000000 +0000
+++ 1:1.1.0-1/m4/libtool.m4	2019-02-12 07:45:33.000000000 +0000
@@ -6438,7 +6438,7 @@ if test yes != "$_lt_caught_CXX_error";
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
 
     else
       GXX=no
@@ -6813,7 +6813,7 @@ if test yes != "$_lt_caught_CXX_error";
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
             if test yes = "$GXX"; then
@@ -6878,7 +6878,7 @@ if test yes != "$_lt_caught_CXX_error";
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
 	    if test yes = "$GXX"; then
@@ -7217,7 +7217,7 @@ if test yes != "$_lt_caught_CXX_error";
 	      # Commands to make compiler produce verbose output that lists
 	      # what "hidden" libraries, object files and flags are used when
 	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
 
 	    else
 	      # FIXME: insert proper C++ library support
@@ -7301,7 +7301,7 @@ if test yes != "$_lt_caught_CXX_error";
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
 	      else
 	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
@@ -7312,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error";
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
 	      fi
 
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
diff -pruN 1:1.0.2-3/Makefile.am 1:1.1.0-1/Makefile.am
--- 1:1.0.2-3/Makefile.am	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/Makefile.am	2019-02-12 07:45:08.000000000 +0000
@@ -15,6 +15,7 @@ EXTRA_DIST = \
 	README.txt \
 	src/libbluray/bdj/build.xml \
 	src/libbluray/bdj/java \
+	src/libbluray/bdj/java-build-support \
 	src/libbluray/bdj/java-j2me \
 	src/libbluray/bdj/java-j2se \
 	contrib/asm
@@ -225,16 +226,32 @@ pkginclude_HEADERS = \
 
 
 if USING_BDJAVA_BUILD_JAR
+
+if USING_JAVAC_9
+java_versions = -Djava_version_asm=1.6 -Djava_version_bdj=1.6
+else
+java_versions = -Djava_version_asm=1.5 -Djava_version_bdj=1.4
+endif
+
+if BDJ_J2SE
+awt_src = java-$(BDJ_TYPE):java-build-support
+else
+awt_src = java-$(BDJ_TYPE)
+endif
+
 jardir=$(datadir)/java/
-jar_DATA=$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar
+jar_DATA = \
+	$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar \
+	$(top_builddir)/.libs/libbluray-awt-$(BDJ_TYPE)-$(VERSION).jar
 
-$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local
+$(jar_DATA): all-local
 
 all-local:
 	ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \
 	    -Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \
 	    -Ddist='$(abs_builddir)/.libs' \
-	    -Dsrc_awt=:java-$(BDJ_TYPE) \
+	    -Dsrc_awt=:$(awt_src) \
+	    $(java_versions) \
 	    -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \
 	    -Dversion='$(BDJ_TYPE)-$(VERSION)'
 
diff -pruN 1:1.0.2-3/Makefile.in 1:1.1.0-1/Makefile.in
--- 1:1.0.2-3/Makefile.in	2017-12-03 15:27:40.000000000 +0000
+++ 1:1.1.0-1/Makefile.in	2019-02-12 07:45:44.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -181,6 +181,10 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = src/libbluray.pc src/libbluray/bluray-version.h
 CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
+	"$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" \
+	"$(DESTDIR)$(pkgincludedir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -208,9 +212,6 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
-	"$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" \
-	"$(DESTDIR)$(pkgincludedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libbluray_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
@@ -385,7 +386,6 @@ am__v_lt_1 =
 libbluray_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libbluray_la_LDFLAGS) $(LDFLAGS) -o $@
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am__bd_info_SOURCES_DIST = src/examples/bd_info.c
 @USING_EXAMPLES_TRUE@am_bd_info_OBJECTS =  \
 @USING_EXAMPLES_TRUE@	src/examples/bd_info.$(OBJEXT)
@@ -472,7 +472,86 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = contrib/libudfread/src/$(DEPDIR)/libbluray_la-default_blockinput.Plo \
+	contrib/libudfread/src/$(DEPDIR)/libbluray_la-ecma167.Plo \
+	contrib/libudfread/src/$(DEPDIR)/libbluray_la-udfread.Plo \
+	src/devtools/$(DEPDIR)/bdj_test.Po \
+	src/devtools/$(DEPDIR)/bdjo_dump.Po \
+	src/devtools/$(DEPDIR)/clpi_dump-clpi_dump.Po \
+	src/devtools/$(DEPDIR)/clpi_dump-util.Po \
+	src/devtools/$(DEPDIR)/hdmv_test.Po \
+	src/devtools/$(DEPDIR)/mobj_dump-mobj_dump.Po \
+	src/devtools/$(DEPDIR)/mpls_dump-mpls_dump.Po \
+	src/devtools/$(DEPDIR)/mpls_dump-util.Po \
+	src/examples/$(DEPDIR)/bd_info.Po \
+	src/examples/$(DEPDIR)/bdsplice.Po \
+	src/examples/$(DEPDIR)/index_dump.Po \
+	src/examples/$(DEPDIR)/libbluray_test.Po \
+	src/examples/$(DEPDIR)/list_titles.Po \
+	src/examples/$(DEPDIR)/sound_dump.Po \
+	src/file/$(DEPDIR)/libbluray_la-dir_posix.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dir_win32.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dirs_darwin.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dirs_win32.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dirs_xdg.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dl_posix.Plo \
+	src/file/$(DEPDIR)/libbluray_la-dl_win32.Plo \
+	src/file/$(DEPDIR)/libbluray_la-file.Plo \
+	src/file/$(DEPDIR)/libbluray_la-file_posix.Plo \
+	src/file/$(DEPDIR)/libbluray_la-file_win32.Plo \
+	src/file/$(DEPDIR)/libbluray_la-filesystem.Plo \
+	src/file/$(DEPDIR)/libbluray_la-mount.Plo \
+	src/file/$(DEPDIR)/libbluray_la-mount_darwin.Plo \
+	src/libbluray/$(DEPDIR)/libbluray_la-bluray.Plo \
+	src/libbluray/$(DEPDIR)/libbluray_la-register.Plo \
+	src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdj.Plo \
+	src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdjo_parse.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-bdjo.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDFontMetrics.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDGraphics.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Libbluray.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Logger.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-register_native.Plo \
+	src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-util.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdid_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdmv_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-clpi_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-extdata_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-index_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-meta_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-mpls_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-navigation.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-sound_parse.Plo \
+	src/libbluray/bdnav/$(DEPDIR)/libbluray_la-uo_mask.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_controller.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_processor.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-ig_decode.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_demux.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_filter.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-pes_buffer.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-pg_decode.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-rle.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_decode.Plo \
+	src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_render.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-aacs.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-bdplus.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-dec.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-disc.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-properties.Plo \
+	src/libbluray/disc/$(DEPDIR)/libbluray_la-udf_fs.Plo \
+	src/libbluray/hdmv/$(DEPDIR)/libbluray_la-hdmv_vm.Plo \
+	src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_parse.Plo \
+	src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_print.Plo \
+	src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po \
+	src/util/$(DEPDIR)/libbluray_la-array.Plo \
+	src/util/$(DEPDIR)/libbluray_la-bits.Plo \
+	src/util/$(DEPDIR)/libbluray_la-event_queue.Plo \
+	src/util/$(DEPDIR)/libbluray_la-logging.Plo \
+	src/util/$(DEPDIR)/libbluray_la-mutex.Plo \
+	src/util/$(DEPDIR)/libbluray_la-refcnt.Plo \
+	src/util/$(DEPDIR)/libbluray_la-strutl.Plo \
+	src/util/$(DEPDIR)/libbluray_la-time.Plo
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -536,7 +615,7 @@ CTAGS = ctags
 CSCOPE = cscope
 AM_RECURSIVE_TARGETS = cscope
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(top_srcdir)/build-aux/compile \
+	$(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \
 	$(top_srcdir)/build-aux/config.guess \
 	$(top_srcdir)/build-aux/config.sub \
 	$(top_srcdir)/build-aux/depcomp \
@@ -546,9 +625,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in
 	$(top_srcdir)/doxygen-include.am \
 	$(top_srcdir)/src/libbluray.pc.in \
 	$(top_srcdir)/src/libbluray/bluray-version.h.in COPYING \
-	ChangeLog build-aux/compile build-aux/config.guess \
-	build-aux/config.sub build-aux/depcomp build-aux/install-sh \
-	build-aux/ltmain.sh build-aux/missing
+	ChangeLog build-aux/ar-lib build-aux/compile \
+	build-aux/config.guess build-aux/config.sub build-aux/depcomp \
+	build-aux/install-sh build-aux/ltmain.sh build-aux/missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -633,6 +712,7 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVAC = @JAVAC@
 JDK_HOME = @JDK_HOME@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -753,6 +833,7 @@ EXTRA_DIST = \
 	README.txt \
 	src/libbluray/bdj/build.xml \
 	src/libbluray/bdj/java \
+	src/libbluray/bdj/java-build-support \
 	src/libbluray/bdj/java-j2me \
 	src/libbluray/bdj/java-j2se \
 	contrib/asm
@@ -893,8 +974,15 @@ pkginclude_HEADERS = \
 	src/libbluray/decoders/overlay.h \
 	src/util/log_control.h
 
+@USING_BDJAVA_BUILD_JAR_TRUE@@USING_JAVAC_9_FALSE@java_versions = -Djava_version_asm=1.5 -Djava_version_bdj=1.4
+@USING_BDJAVA_BUILD_JAR_TRUE@@USING_JAVAC_9_TRUE@java_versions = -Djava_version_asm=1.6 -Djava_version_bdj=1.6
+@BDJ_J2SE_FALSE@@USING_BDJAVA_BUILD_JAR_TRUE@awt_src = java-$(BDJ_TYPE)
+@BDJ_J2SE_TRUE@@USING_BDJAVA_BUILD_JAR_TRUE@awt_src = java-$(BDJ_TYPE):java-build-support
 @USING_BDJAVA_BUILD_JAR_TRUE@jardir = $(datadir)/java/
-@USING_BDJAVA_BUILD_JAR_TRUE@jar_DATA = $(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar
+@USING_BDJAVA_BUILD_JAR_TRUE@jar_DATA = \
+@USING_BDJAVA_BUILD_JAR_TRUE@	$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar \
+@USING_BDJAVA_BUILD_JAR_TRUE@	$(top_builddir)/.libs/libbluray-awt-$(BDJ_TYPE)-$(VERSION).jar
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = src/libbluray.pc
 @USING_EXAMPLES_TRUE@bd_info_SOURCES = src/examples/bd_info.c
@@ -963,8 +1051,8 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
 	    echo ' $(SHELL) ./config.status'; \
 	    $(SHELL) ./config.status;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
 	esac;
 $(top_srcdir)/doxygen-include.am $(am__empty):
 
@@ -995,6 +1083,64 @@ src/libbluray.pc: $(top_builddir)/config
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 src/libbluray/bluray-version.h: $(top_builddir)/config.status $(top_srcdir)/src/libbluray/bluray-version.h.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
@@ -1262,64 +1408,6 @@ src/file/libbluray_la-dirs_xdg.lo: src/f
 
 libbluray.la: $(libbluray_la_OBJECTS) $(libbluray_la_DEPENDENCIES) $(EXTRA_libbluray_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libbluray_la_LINK) -rpath $(libdir) $(libbluray_la_OBJECTS) $(libbluray_la_LIBADD) $(LIBS)
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
-	fi; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p \
-	 || test -f $$p1 \
-	  ; then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' \
-	    -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' \
-	`; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-
-clean-noinstPROGRAMS:
-	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
 src/examples/$(am__dirstamp):
 	@$(MKDIR_P) src/examples
 	@: > src/examples/$(am__dirstamp)
@@ -1443,85 +1531,91 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-default_blockinput.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-ecma167.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-udfread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/bdj_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/bdjo_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/clpi_dump-clpi_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/clpi_dump-util.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/hdmv_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mobj_dump-mobj_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mpls_dump-mpls_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mpls_dump-util.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/bd_info.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/bdsplice.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/index_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/libbluray_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/list_titles.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/sound_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dir_posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dir_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_xdg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dl_posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dl_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file_posix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file_win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-filesystem.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-mount.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-mount_darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/libbluray_la-bluray.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/libbluray_la-register.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdj.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdjo_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-bdjo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDFontMetrics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDGraphics.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Libbluray.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Logger.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-register_native.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdid_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdmv_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-clpi_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-extdata_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-index_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-meta_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-mpls_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-navigation.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-sound_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-uo_mask.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_controller.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_processor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-ig_decode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_demux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_filter.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-pes_buffer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-pg_decode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-rle.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_decode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_render.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-aacs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-bdplus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-dec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-disc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-properties.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-udf_fs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-hdmv_vm.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_print.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-array.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-bits.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-event_queue.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-logging.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-mutex.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-refcnt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-strutl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-default_blockinput.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-ecma167.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/libbluray_la-udfread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/bdj_test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/bdjo_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/clpi_dump-clpi_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/clpi_dump-util.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/hdmv_test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mobj_dump-mobj_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mpls_dump-mpls_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/devtools/$(DEPDIR)/mpls_dump-util.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/bd_info.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/bdsplice.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/index_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/libbluray_test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/list_titles.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/sound_dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dir_posix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dir_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_darwin.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dirs_xdg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dl_posix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-dl_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file_posix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-file_win32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-filesystem.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-mount.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/libbluray_la-mount_darwin.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/libbluray_la-bluray.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/libbluray_la-register.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdj.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdjo_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-bdjo.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDFontMetrics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDGraphics.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Libbluray.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Logger.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-register_native.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-util.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdid_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdmv_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-clpi_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-extdata_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-index_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-meta_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-mpls_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-navigation.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-sound_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/libbluray_la-uo_mask.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_controller.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_processor.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-ig_decode.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_demux.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_filter.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-pes_buffer.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-pg_decode.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-rle.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_decode.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_render.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-aacs.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-bdplus.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-dec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-disc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-properties.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/libbluray_la-udf_fs.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-hdmv_vm.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_print.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-array.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-bits.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-event_queue.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-logging.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-mutex.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-refcnt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-strutl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/libbluray_la-time.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -2220,7 +2314,10 @@ distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	$(am__remove_distdir)
 	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -2260,7 +2357,7 @@ distdir: $(DISTFILES)
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@@ -2285,7 +2382,7 @@ dist-shar: distdir
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -2303,7 +2400,7 @@ dist dist-all:
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -2313,7 +2410,7 @@ distcheck: dist
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
@@ -2385,12 +2482,12 @@ distcleancheck: distclean
 check-am: all-am
 check: check-am
 @USING_BDJAVA_BUILD_JAR_FALSE@all-local:
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) $(HEADERS) \
 		config.h all-local
 install-binPROGRAMS: install-libLTLIBRARIES
 
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -2456,7 +2553,85 @@ clean-am: clean-binPROGRAMS clean-generi
 
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf contrib/libudfread/src/$(DEPDIR) src/devtools/$(DEPDIR) src/examples/$(DEPDIR) src/file/$(DEPDIR) src/libbluray/$(DEPDIR) src/libbluray/bdj/$(DEPDIR) src/libbluray/bdj/native/$(DEPDIR) src/libbluray/bdnav/$(DEPDIR) src/libbluray/decoders/$(DEPDIR) src/libbluray/disc/$(DEPDIR) src/libbluray/hdmv/$(DEPDIR) src/util/$(DEPDIR)
+		-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-default_blockinput.Plo
+	-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-ecma167.Plo
+	-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-udfread.Plo
+	-rm -f src/devtools/$(DEPDIR)/bdj_test.Po
+	-rm -f src/devtools/$(DEPDIR)/bdjo_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/clpi_dump-clpi_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/clpi_dump-util.Po
+	-rm -f src/devtools/$(DEPDIR)/hdmv_test.Po
+	-rm -f src/devtools/$(DEPDIR)/mobj_dump-mobj_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/mpls_dump-mpls_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/mpls_dump-util.Po
+	-rm -f src/examples/$(DEPDIR)/bd_info.Po
+	-rm -f src/examples/$(DEPDIR)/bdsplice.Po
+	-rm -f src/examples/$(DEPDIR)/index_dump.Po
+	-rm -f src/examples/$(DEPDIR)/libbluray_test.Po
+	-rm -f src/examples/$(DEPDIR)/list_titles.Po
+	-rm -f src/examples/$(DEPDIR)/sound_dump.Po
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dir_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dir_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_darwin.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_xdg.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dl_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dl_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-filesystem.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-mount.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-mount_darwin.Plo
+	-rm -f src/libbluray/$(DEPDIR)/libbluray_la-bluray.Plo
+	-rm -f src/libbluray/$(DEPDIR)/libbluray_la-register.Plo
+	-rm -f src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdj.Plo
+	-rm -f src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdjo_parse.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-bdjo.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDFontMetrics.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDGraphics.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Libbluray.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Logger.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-register_native.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-util.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdid_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdmv_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-clpi_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-extdata_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-index_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-meta_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-mpls_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-navigation.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-sound_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-uo_mask.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_controller.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_processor.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-ig_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_demux.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_filter.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-pes_buffer.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-pg_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-rle.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_render.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-aacs.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-bdplus.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-dec.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-disc.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-properties.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-udf_fs.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-hdmv_vm.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_parse.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_print.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po
+	-rm -f src/util/$(DEPDIR)/libbluray_la-array.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-bits.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-event_queue.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-logging.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-mutex.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-refcnt.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-strutl.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-time.Plo
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-libtool distclean-tags
@@ -2505,7 +2680,85 @@ installcheck-am:
 maintainer-clean: maintainer-clean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -rf contrib/libudfread/src/$(DEPDIR) src/devtools/$(DEPDIR) src/examples/$(DEPDIR) src/file/$(DEPDIR) src/libbluray/$(DEPDIR) src/libbluray/bdj/$(DEPDIR) src/libbluray/bdj/native/$(DEPDIR) src/libbluray/bdnav/$(DEPDIR) src/libbluray/decoders/$(DEPDIR) src/libbluray/disc/$(DEPDIR) src/libbluray/hdmv/$(DEPDIR) src/util/$(DEPDIR)
+		-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-default_blockinput.Plo
+	-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-ecma167.Plo
+	-rm -f contrib/libudfread/src/$(DEPDIR)/libbluray_la-udfread.Plo
+	-rm -f src/devtools/$(DEPDIR)/bdj_test.Po
+	-rm -f src/devtools/$(DEPDIR)/bdjo_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/clpi_dump-clpi_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/clpi_dump-util.Po
+	-rm -f src/devtools/$(DEPDIR)/hdmv_test.Po
+	-rm -f src/devtools/$(DEPDIR)/mobj_dump-mobj_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/mpls_dump-mpls_dump.Po
+	-rm -f src/devtools/$(DEPDIR)/mpls_dump-util.Po
+	-rm -f src/examples/$(DEPDIR)/bd_info.Po
+	-rm -f src/examples/$(DEPDIR)/bdsplice.Po
+	-rm -f src/examples/$(DEPDIR)/index_dump.Po
+	-rm -f src/examples/$(DEPDIR)/libbluray_test.Po
+	-rm -f src/examples/$(DEPDIR)/list_titles.Po
+	-rm -f src/examples/$(DEPDIR)/sound_dump.Po
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dir_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dir_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_darwin.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dirs_xdg.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dl_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-dl_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file_posix.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-file_win32.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-filesystem.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-mount.Plo
+	-rm -f src/file/$(DEPDIR)/libbluray_la-mount_darwin.Plo
+	-rm -f src/libbluray/$(DEPDIR)/libbluray_la-bluray.Plo
+	-rm -f src/libbluray/$(DEPDIR)/libbluray_la-register.Plo
+	-rm -f src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdj.Plo
+	-rm -f src/libbluray/bdj/$(DEPDIR)/libbluray_la-bdjo_parse.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-bdjo.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDFontMetrics.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-java_awt_BDGraphics.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Libbluray.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-org_videolan_Logger.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-register_native.Plo
+	-rm -f src/libbluray/bdj/native/$(DEPDIR)/libbluray_la-util.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdid_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-bdmv_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-clpi_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-extdata_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-index_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-meta_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-mpls_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-navigation.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-sound_parse.Plo
+	-rm -f src/libbluray/bdnav/$(DEPDIR)/libbluray_la-uo_mask.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_controller.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-graphics_processor.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-ig_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_demux.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-m2ts_filter.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-pes_buffer.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-pg_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-rle.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_decode.Plo
+	-rm -f src/libbluray/decoders/$(DEPDIR)/libbluray_la-textst_render.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-aacs.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-bdplus.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-dec.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-disc.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-properties.Plo
+	-rm -f src/libbluray/disc/$(DEPDIR)/libbluray_la-udf_fs.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-hdmv_vm.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_parse.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/libbluray_la-mobj_print.Plo
+	-rm -f src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po
+	-rm -f src/util/$(DEPDIR)/libbluray_la-array.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-bits.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-event_queue.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-logging.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-mutex.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-refcnt.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-strutl.Plo
+	-rm -f src/util/$(DEPDIR)/libbluray_la-time.Plo
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -2528,9 +2781,9 @@ uninstall-am: uninstall-binPROGRAMS unin
 
 .MAKE: all install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
-	check-am clean clean-binPROGRAMS clean-cscope clean-generic \
-	clean-libLTLIBRARIES clean-libtool clean-local \
+.PHONY: CTAGS GTAGS TAGS all all-am all-local am--depfiles am--refresh \
+	check check-am clean clean-binPROGRAMS clean-cscope \
+	clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
 	clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \
 	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
 	dist-xz dist-zip distcheck distclean distclean-compile \
@@ -2599,13 +2852,14 @@ uninstall-am: uninstall-binPROGRAMS unin
 @DX_COND_doc_TRUE@	rm -rf @DX_DOCDIR@
 @DX_COND_doc_TRUE@	$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
 
-@USING_BDJAVA_BUILD_JAR_TRUE@$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local
+@USING_BDJAVA_BUILD_JAR_TRUE@$(jar_DATA): all-local
 
 @USING_BDJAVA_BUILD_JAR_TRUE@all-local:
 @USING_BDJAVA_BUILD_JAR_TRUE@	ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \
 @USING_BDJAVA_BUILD_JAR_TRUE@	    -Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \
 @USING_BDJAVA_BUILD_JAR_TRUE@	    -Ddist='$(abs_builddir)/.libs' \
-@USING_BDJAVA_BUILD_JAR_TRUE@	    -Dsrc_awt=:java-$(BDJ_TYPE) \
+@USING_BDJAVA_BUILD_JAR_TRUE@	    -Dsrc_awt=:$(awt_src) \
+@USING_BDJAVA_BUILD_JAR_TRUE@	    $(java_versions) \
 @USING_BDJAVA_BUILD_JAR_TRUE@	    -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \
 @USING_BDJAVA_BUILD_JAR_TRUE@	    -Dversion='$(BDJ_TYPE)-$(VERSION)'
 
diff -pruN 1:1.0.2-3/src/devtools/clpi_dump.c 1:1.1.0-1/src/devtools/clpi_dump.c
--- 1:1.0.2-3/src/devtools/clpi_dump.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/devtools/clpi_dump.c	2019-02-12 07:45:08.000000000 +0000
@@ -48,6 +48,7 @@ const VALUE_MAP application_type_map[] =
     {5, "Sub TS for a sub-path of Interactive Graphics menu"},
     {6, "Sub TS for a sub-path of Text subtitle"},
     {7, "Sub TS for a sub-path of one or more elementary streams path"},
+    {8, "Sub TS for a main-path of Enhanced LR View"},
     {0, NULL},
 };
 
diff -pruN 1:1.0.2-3/src/file/dl_posix.c 1:1.1.0-1/src/file/dl_posix.c
--- 1:1.0.2-3/src/file/dl_posix.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/file/dl_posix.c	2019-02-12 07:45:08.000000000 +0000
@@ -27,6 +27,11 @@
 #include "util/logging.h"
 #include "util/strutl.h"
 
+#ifdef __APPLE__
+// Required to make dladdr available
+#    define _DARWIN_C_SOURCE
+#endif
+
 #if defined(HAVE_DLFCN_H)
 #   include <dlfcn.h>
 #elif defined(HAVE_SYS_DL_H)
@@ -112,6 +117,7 @@ int dl_dlclose(void *handle)
     return dlclose(handle);
 }
 
+#define PATH_SEPARATOR '/'
 const char *dl_get_path(void)
 {
     static char *lib_path    = NULL;
@@ -120,7 +126,25 @@ const char *dl_get_path(void)
     if (!initialized) {
         initialized = 1;
 
+#ifdef __APPLE__
+        Dl_info dl_info;
+        int ret = dladdr((void *)dl_get_path, &dl_info);
+
+        if (ret != 0) {
+            lib_path = strdup(dl_info.dli_fname);
+
+            /* cut library name from path */
+            char *p = strrchr(lib_path, PATH_SEPARATOR);
+            if (p) {
+                *(p+1) = 0;
+            }
+            BD_DEBUG(DBG_FILE, "library file is %s\n", lib_path);
+        } else {
+            BD_DEBUG(DBG_FILE, "Can't determine libbluray.so install path\n");
+        }
+#else
         BD_DEBUG(DBG_FILE, "Can't determine libbluray.so install path\n");
+#endif
     }
 
     return lib_path;
diff -pruN 1:1.0.2-3/src/file/file.h 1:1.1.0-1/src/file/file.h
--- 1:1.0.2-3/src/file/file.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/file/file.h	2019-02-12 07:45:08.000000000 +0000
@@ -65,7 +65,7 @@ static inline BD_USED size_t file_read(B
 
 BD_PRIVATE int64_t file_size(BD_FILE_H *fp);
 
-BD_PRIVATE extern BD_FILE_H* (*file_open)(const char* filename, const char *mode);
+BD_PRIVATE extern BD_FILE_H *(*file_open)(const char* filename, const char *mode);
 
 BD_PRIVATE BD_FILE_OPEN file_open_default(void);
 
@@ -77,7 +77,7 @@ BD_PRIVATE BD_FILE_OPEN file_open_defaul
 #define dir_close(X) X->close(X)
 #define dir_read(X,Y) X->read(X,Y)
 
-BD_PRIVATE extern BD_DIR_H* (*dir_open)(const char* dirname);
+BD_PRIVATE extern BD_DIR_H *(*dir_open)(const char* dirname);
 
 BD_PRIVATE BD_DIR_OPEN dir_open_default(void);
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/bdj.c 1:1.1.0-1/src/libbluray/bdj/bdj.c
--- 1:1.0.2-3/src/libbluray/bdj/bdj.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/bdj.c	2019-02-12 07:45:08.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
- * Copyright (C) 2012  Petri Hintukainen <phintuka@users.sourceforge.net>
+ * Copyright (C) 2012-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -122,6 +122,13 @@ static void *_load_jvm_win32(const char
     HKEY hkey;
 
     r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buf_loc, 0, KEY_READ, &hkey);
+# ifndef NO_JAVA9_SUPPORT
+    if (r != ERROR_SUCCESS) {
+        /* Try Java 9 */
+        wcscpy(buf_loc, L"SOFTWARE\\JavaSoft\\JRE\\");
+        r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buf_loc, 0, KEY_READ, &hkey);
+    }
+# endif
     if (r != ERROR_SUCCESS) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error opening registry key SOFTWARE\\JavaSoft\\Java Runtime Environment\\\n");
         return NULL;
@@ -302,6 +309,14 @@ static void *_jvm_dlopen(const char *jav
         }
         BD_DEBUG(DBG_BDJ, "Opening %s ...\n", path);
         void *h = dl_dlopen(path, NULL);
+# ifdef NO_JAVA9_SUPPORT
+        /* ignore Java 9+ */
+        if (h && dl_dlsym(h, "JVM_DefineModule")) {
+            BD_DEBUG(DBG_CRIT | DBG_BDJ, "Ignoring JVM %s: looks like Java 9 or later\n", path);
+            dl_dlclose(h);
+            h = NULL;
+        }
+# endif
         X_FREE(path);
         return h;
     } else {
@@ -384,10 +399,15 @@ static void *_load_jvm(const char **p_ja
                                             "/usr/lib/jvm/",
                                             "/etc/java-config-2/current-system-vm",
                                             "/usr/lib/jvm/java-7-openjdk",
+                                            "/usr/lib/jvm/java-7-openjdk-" JAVA_ARCH,
                                             "/usr/lib/jvm/java-8-openjdk",
+                                            "/usr/lib/jvm/java-8-openjdk-" JAVA_ARCH,
                                             "/usr/lib/jvm/java-6-openjdk",
     };
-    static const char * const jvm_dir[]  = {"jre/lib/" JAVA_ARCH "/server"};
+    static const char * const jvm_dir[]  = {"jre/lib/" JAVA_ARCH "/server",
+                                            "lib/server",
+                                            "lib/client",
+    };
 #  endif
     static const char         jvm_lib[]  = "libjvm";
 # endif
@@ -470,10 +490,11 @@ void bdj_storage_cleanup(BDJ_STORAGE *p)
 {
     X_FREE(p->cache_root);
     X_FREE(p->persistent_root);
-    X_FREE(p->classpath);
+    X_FREE(p->classpath[0]);
+    X_FREE(p->classpath[1]);
 }
 
-static const char *_find_libbluray_jar(BDJ_STORAGE *storage)
+static char *_find_libbluray_jar0()
 {
     // pre-defined search paths for libbluray.jar
     static const char * const jar_paths[] = {
@@ -486,32 +507,29 @@ static const char *_find_libbluray_jar(B
 
     unsigned i;
 
-    if (storage->classpath) {
-        return storage->classpath;
-    }
-
     // check if overriding the classpath
     const char *classpath = getenv("LIBBLURAY_CP");
     if (classpath) {
         size_t cp_len = strlen(classpath);
+        char *jar;
 
         // directory or file ?
         if (cp_len > 0 && (classpath[cp_len - 1] == '/' || classpath[cp_len - 1] == '\\')) {
-            storage->classpath = str_printf("%s%s", classpath, BDJ_JARFILE);
+            jar = str_printf("%s%s", classpath, BDJ_JARFILE);
         } else {
-            storage->classpath = str_dup(classpath);
+            jar = str_dup(classpath);
         }
 
-        if (!storage->classpath) {
+        if (!jar) {
             BD_DEBUG(DBG_CRIT, "out of memory\n");
             return NULL;
         }
 
-        if (_can_read_file(storage->classpath)) {
-            return storage->classpath;
+        if (_can_read_file(jar)) {
+            return jar;
         }
 
-        X_FREE(storage->classpath);
+        X_FREE(jar);
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "invalid LIBBLURAY_CP %s\n", classpath);
         return NULL;
     }
@@ -529,7 +547,6 @@ static const char *_find_libbluray_jar(B
 
         BD_DEBUG(DBG_BDJ, "Checking %s ...\n", cp);
         if (_can_read_file(cp)) {
-            storage->classpath = cp;
             BD_DEBUG(DBG_BDJ, "using %s\n", cp);
             return cp;
         }
@@ -540,9 +557,8 @@ static const char *_find_libbluray_jar(B
     for (i = 0; i < sizeof(jar_paths) / sizeof(jar_paths[0]); i++) {
         BD_DEBUG(DBG_BDJ, "Checking %s ...\n", jar_paths[i]);
         if (_can_read_file(jar_paths[i])) {
-            storage->classpath = str_dup(jar_paths[i]);
-            BD_DEBUG(DBG_BDJ, "using %s\n", storage->classpath);
-            return storage->classpath;
+            BD_DEBUG(DBG_BDJ, "using %s\n", jar_paths[i]);
+            return str_dup(jar_paths[i]);
         }
     }
 
@@ -550,6 +566,47 @@ static const char *_find_libbluray_jar(B
     return NULL;
 }
 
+static char *_find_libbluray_jar1(const char *jar0)
+{
+    char *jar1;
+    int   cut;
+
+    cut = (int)strlen(jar0) - (int)strlen(VERSION) - 9;
+    if (cut <= 0)
+        return NULL;
+
+    jar1 = str_printf("%.*sawt-%s", cut, jar0, jar0 + cut);
+    if (!jar1)
+        return NULL;
+
+    if (!_can_read_file(jar1)) {
+        BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cant access AWT jar file %s\n", jar1);
+        X_FREE(jar1);
+    }
+
+    return jar1;
+}
+
+static int _find_libbluray_jar(BDJ_STORAGE *storage)
+{
+    if (!storage->classpath[0]) {
+        storage->classpath[0] = _find_libbluray_jar0();
+        X_FREE(storage->classpath[1]);
+        if (!storage->classpath[0])
+            return 0;
+    }
+
+    if (!storage->classpath[1]) {
+        storage->classpath[1] = _find_libbluray_jar1(storage->classpath[0]);
+        if (!storage->classpath[1]) {
+            X_FREE(storage->classpath[0]);
+            X_FREE(storage->classpath[1]);
+        }
+    }
+
+    return !!storage->classpath[0];
+}
+
 static const char *_bdj_persistent_root(BDJ_STORAGE *storage)
 {
     const char *root;
@@ -687,18 +744,18 @@ int bdj_jvm_available(BDJ_STORAGE *stora
     void* jvm_lib = _load_jvm(&java_home);
     if (!jvm_lib) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J check: Failed to load JVM library\n");
-        return 0;
+        return BDJ_CHECK_NO_JVM;
     }
     dl_dlclose(jvm_lib);
 
     if (!_find_libbluray_jar(storage)) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J check: Failed to load libbluray.jar\n");
-        return 1;
+        return BDJ_CHECK_NO_JAR;
     }
 
     BD_DEBUG(DBG_BDJ, "BD-J check: OK\n");
 
-    return 2;
+    return BDJ_CHECK_OK;
 }
 
 static int _find_jvm(void *jvm_lib, JNIEnv **env, JavaVM **jvm)
@@ -724,12 +781,71 @@ static int _find_jvm(void *jvm_lib, JNIE
     return 0;
 }
 
-static int _create_jvm(void *jvm_lib, const char *java_home, const char *jar_file,
+/* Export packages for Xlets */
+static const char * const java_base_exports[] = {
+        "javax.media" ,
+        "javax.media.protocol",
+        "javax.tv.graphics",
+        "javax.tv.service",
+        "javax.tv.service.guide",
+        "javax.tv.service.selection",
+        "javax.tv.service.transport",
+        "javax.tv.service.navigation",
+        "javax.tv.net",
+        "javax.tv.locator",
+        "javax.tv.util",
+        "javax.tv.media",
+        "javax.tv.xlet",
+        "javax.microedition.xlet",
+        "org.davic.resources",
+        "org.davic.net",
+        "org.davic.media",
+        "org.davic.mpeg",
+        "org.dvb.user",
+        "org.dvb.dsmcc",
+        "org.dvb.application",
+        "org.dvb.ui",
+        "org.dvb.test",
+        "org.dvb.lang",
+        "org.dvb.event",
+        "org.dvb.io.ixc",
+        "org.dvb.io.persistent",
+        "org.dvb.media",
+        "org.havi.ui",
+        "org.havi.ui.event",
+        "org.bluray.application",
+        "org.bluray.ui",
+        "org.bluray.ui.event",
+        "org.bluray.net",
+        "org.bluray.storage",
+        "org.bluray.vfs",
+        "org.bluray.bdplus",
+        "org.bluray.system",
+        "org.bluray.media",
+        "org.bluray.ti",
+        "org.bluray.ti.selection",
+        "org.blurayx.s3d.ui",
+        "org.blurayx.s3d.system",
+        "org.blurayx.s3d.media",
+        "org.blurayx.s3d.ti",
+        "org.blurayx.uhd.ui",
+        "org.blurayx.uhd.system",
+        "org.blurayx.uhd.ti",
+        "com.aacsla.bluray.online",
+        "com.aacsla.bluray.mc",
+        "com.aacsla.bluray.mt",
+};
+static const size_t num_java_base_exports = sizeof(java_base_exports) / sizeof(java_base_exports[0]);
+
+static int _create_jvm(void *jvm_lib, const char *java_home, const char *jar_file[2],
                        JNIEnv **env, JavaVM **jvm)
 {
     (void)java_home;  /* used only with J2ME */
 
     fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp;
+    JavaVMOption option[64];
+    int n = 0, result, java_9;
+    JavaVMInitArgs args;
 
     *(void **)(&JNI_CreateJavaVM_fp) = dl_dlsym(jvm_lib, "JNI_CreateJavaVM");
     if (JNI_CreateJavaVM_fp == NULL) {
@@ -737,18 +853,19 @@ static int _create_jvm(void *jvm_lib, co
         return 0;
     }
 
-    JavaVMOption* option = calloc(1, sizeof(JavaVMOption) * 20);
-    if (!option) {
-        BD_DEBUG(DBG_CRIT, "out of memory\n");
-        return 0;
+#ifdef HAVE_BDJ_J2ME
+    java_9 = 0;
+#else
+    java_9 = !!dl_dlsym(jvm_lib, "JVM_DefineModule");
+    if (java_9) {
+        BD_DEBUG(DBG_CRIT | DBG_BDJ, "Detected Java 9 or later JVM - support is experimental !\n");
     }
+#endif
+
+    memset(option, 0, sizeof(option));
 
-    int n = 0;
-    JavaVMInitArgs args;
     option[n++].optionString = str_dup   ("-Dawt.toolkit=java.awt.BDToolkit");
     option[n++].optionString = str_dup   ("-Djava.awt.graphicsenv=java.awt.BDGraphicsEnvironment");
-    option[n++].optionString = str_dup   ("-Djavax.accessibility.assistive_technologies= ");
-    option[n++].optionString = str_printf("-Xbootclasspath/p:%s", jar_file);
     option[n++].optionString = str_dup   ("-Xms256M");
     option[n++].optionString = str_dup   ("-Xmx256M");
     option[n++].optionString = str_dup   ("-Xss2048k");
@@ -758,7 +875,35 @@ static int _create_jvm(void *jvm_lib, co
     option[n++].optionString = str_dup   ("-XfullShutdown");
 #endif
 
+    if (!java_9) {
+      option[n++].optionString = str_dup   ("-Djavax.accessibility.assistive_technologies= ");
+      option[n++].optionString = str_printf("-Xbootclasspath/p:%s:%s", jar_file[0], jar_file[1]);
+    } else {
+      option[n++].optionString = str_printf("--patch-module=java.base=%s", jar_file[0]);
+      option[n++].optionString = str_printf("--patch-module=java.desktop=%s", jar_file[1]);
+
+      /* Fix module graph */
+
+      option[n++].optionString = str_dup("--add-reads=java.base=java.desktop");
+      /* org.videolan.IxcRegistryImpl -> java.rmi.Remote */
+      option[n++].optionString = str_dup("--add-reads=java.base=java.rmi");
+      /* org.videolan.FontIndex -> java.xml. */
+      option[n++].optionString = str_dup("--add-reads=java.base=java.xml");
+      /* AWT needs to access logger and Xlet context */
+      option[n++].optionString = str_dup("--add-opens=java.base/org.videolan=java.desktop");
+      /* AWT needs to acess DVBGraphics */
+      option[n++].optionString = str_dup("--add-exports=java.base/org.dvb.ui=java.desktop");
+      /* org.havi.ui.HBackgroundImage needs to access sun.awt.image.FileImageSource */
+      option[n++].optionString = str_dup("--add-exports=java.desktop/sun.awt.image=java.base");
+
+      /* Export BluRay packages to Xlets */
+      for (size_t idx = 0; idx < num_java_base_exports; idx++) {
+          option[n++].optionString = str_printf("--add-exports=java.base/%s=ALL-UNNAMED", java_base_exports[idx]);
+      }
+    }
+
     /* JVM debug options */
+
     if (getenv("BDJ_JVM_DEBUG")) {
         option[n++].optionString = str_dup("-ea");
         //option[n++].optionString = str_dup("-verbose");
@@ -798,12 +943,11 @@ static int _create_jvm(void *jvm_lib, co
     }
 #endif
 
-    int result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args);
+    result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args);
 
     while (--n >= 0) {
         X_FREE(option[n].optionString);
     }
-    X_FREE(option);
 
     if (result != JNI_OK || !*env) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to create new Java VM. JNI_CreateJavaVM result: %d\n", result);
@@ -818,8 +962,7 @@ BDJAVA* bdj_open(const char *path, struc
 {
     BD_DEBUG(DBG_BDJ, "bdj_open()\n");
 
-    const char *jar_file = _find_libbluray_jar(storage);
-    if (!jar_file) {
+    if (!_find_libbluray_jar(storage)) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J start failed: " BDJ_JARFILE " not found.\n");
         return NULL;
     }
@@ -851,8 +994,9 @@ BDJAVA* bdj_open(const char *path, struc
 
     JNIEnv* env = NULL;
     JavaVM *jvm = NULL;
+    const char *jar[2] = { storage->classpath[0], storage->classpath[1] };
     if (!_find_jvm(jvm_lib, &env, &jvm) &&
-        !_create_jvm(jvm_lib, java_home, jar_file, &env, &jvm)) {
+        !_create_jvm(jvm_lib, java_home, jar, &env, &jvm)) {
 
         X_FREE(bdjava);
         dl_dlclose(jvm_lib);
diff -pruN 1:1.0.2-3/src/libbluray/bdj/bdj.h 1:1.1.0-1/src/libbluray/bdj/bdj.h
--- 1:1.0.2-3/src/libbluray/bdj/bdj.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/bdj.h	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2012-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -66,7 +67,7 @@ typedef struct {
     char *persistent_root;   /* BD-J Xlet persistent storage */
     char *cache_root;        /* BD-J binding unit data area */
 
-    char *classpath;         /* BD-J implementation class path (location of libbluray.jar) */
+    char *classpath[2];      /* BD-J implementation class path (location of libbluray.jar) */
 
     uint8_t no_persistent_storage; /* disable persistent storage (remove files at close) */
 } BDJ_STORAGE;
@@ -80,7 +81,13 @@ BD_PRIVATE BDJAVA* bdj_open(const char *
 BD_PRIVATE void bdj_close(BDJAVA *bdjava);
 BD_PRIVATE int  bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param);
 
-BD_PRIVATE int  bdj_jvm_available(BDJ_STORAGE *storage); /* 0: no. 1: only jvm. 2: jvm + libbluray.jar. */
+enum {
+    BDJ_CHECK_OK     = 0,
+    BDJ_CHECK_NO_JVM = 1,
+    BDJ_CHECK_NO_JAR = 2,
+};
+
+BD_PRIVATE int  bdj_jvm_available(BDJ_STORAGE *storage);  /* rreturn: BDJ_CHECK_* */
 
 BD_PRIVATE void bdj_storage_cleanup(BDJ_STORAGE *);
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/build.xml 1:1.1.0-1/src/libbluray/bdj/build.xml
--- 1:1.0.2-3/src/libbluray/bdj/build.xml	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/build.xml	2019-02-12 07:45:08.000000000 +0000
@@ -10,6 +10,8 @@
     <property name="src_asm" value="../../../contrib/asm/src/"/>
     <property name="bootclasspath" value=""/>
     <property name="version" value=""/>
+    <property name="java_version_asm" value="1.5"/>
+    <property name="java_version_bdj" value="1.4"/>
 
     <target name="init">
         <tstamp/>
@@ -21,20 +23,30 @@
             description="compile the source " >
         <javac srcdir="${src_asm}" destdir="${build}" debug="yes"
                bootclasspath="${bootclasspath}"
-               source="1.5" target="1.5">
+               source="${java_version_asm}" target="${java_version_asm}">
                <compilerarg value="-XDignore.symbol.file"/>
                <compilerarg value="-Xlint:-deprecation"/>
         </javac>
         <javac srcdir="${src}${src_awt}" destdir="${build}" debug="yes"
                bootclasspath="${bootclasspath}"
-               source="1.4" target="1.4">
+               source="${java_version_bdj}" target="${java_version_bdj}">
                <compilerarg value="-XDignore.symbol.file"/>
                <compilerarg value="-Xlint:-deprecation"/>
         </javac>
     </target>
     <target name="dist" depends="compile"
             description="generate the distribution" >
-        <jar jarfile="${dist}/libbluray-${version}.jar" basedir="${build}" />
+        <jar jarfile="${dist}/libbluray-${version}.jar" basedir="${build}">
+            <exclude name="java/awt/**" />
+            <exclude name="sun/**" />
+        </jar>
+        <jar jarfile="${dist}/libbluray-awt-${version}.jar" basedir="${build}">
+          <include name="java/awt/**" />
+          <include name="sun/**" />
+          <!-- following classes are used only at build time -->
+          <exclude name="sun/awt/CausedFocusEvent**" />
+          <exclude name="java/awt/event/FocusEvent**" />
+        </jar>
     </target>
 
     <target name="clean"
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/com/aacsla/bluray/mc/ManagedCopy.java 1:1.1.0-1/src/libbluray/bdj/java/com/aacsla/bluray/mc/ManagedCopy.java
--- 1:1.0.2-3/src/libbluray/bdj/java/com/aacsla/bluray/mc/ManagedCopy.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/com/aacsla/bluray/mc/ManagedCopy.java	2019-02-12 07:45:08.000000000 +0000
@@ -29,7 +29,7 @@ public final class ManagedCopy {
         throw new MCException();
     }
 
-    /** @deprecated */
+    /** @Deprecated */
     public ManagedCopy() {
         logger.unimplemented("*");
     }
@@ -117,7 +117,7 @@ public final class ManagedCopy {
 
     }
 
-    /** @deprecated */
+    /** @Deprecated */
     public boolean IsMCMSupported() {
         return false;
     }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java	2019-02-12 07:45:08.000000000 +0000
@@ -42,7 +42,7 @@ import org.videolan.Logger;
 
 abstract class BDGraphicsBase extends DVBGraphics implements ConstrainableGraphics {
     private static final Color DEFAULT_COLOR = Color.BLACK;
-    private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12);
+    private static Font DEFAULT_FONT;
 
     private int width;
     private int height;
@@ -126,6 +126,12 @@ abstract class BDGraphicsBase extends DV
         postInit();
     }
 
+    private static Font getDefaultFont() {
+        if (DEFAULT_FONT == null)
+            DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12);
+        return DEFAULT_FONT;
+    }
+
     private void postInit() {
         if (foreground == null)
             foreground = DEFAULT_COLOR;
@@ -136,7 +142,7 @@ abstract class BDGraphicsBase extends DV
         if (font == null) {
             font = GUIManager.getInstance().getDefaultFont();
             if (font == null) {
-                font = DEFAULT_FONT;
+                font = getDefaultFont();
             }
         }
         fontMetrics = null;
@@ -209,7 +215,7 @@ abstract class BDGraphicsBase extends DV
 
     public Font getFont() {
         if (font == null)
-            return DEFAULT_FONT;
+            return getDefaultFont();
         return font;
     }
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsDeviceImpl.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsDeviceImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsDeviceImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsDeviceImpl.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,66 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-class BDGraphicsDeviceImpl extends GraphicsDevice {
-    private BDGraphicsConfiguration configuration;
-
-    BDGraphicsDeviceImpl(BDGraphicsEnvironment environment) {
-        configuration = new BDGraphicsConfiguration((BDGraphicsDevice)this);
-    }
-
-    public int getType() {
-        return TYPE_RASTER_SCREEN;
-    }
-
-    public String getIDstring() {
-        return "BDJ Graphics Device";
-    }
-
-    public GraphicsConfiguration getDefaultConfiguration() {
-        return configuration;
-    }
-
-    public GraphicsConfiguration[] getConfigurations() {
-        return new GraphicsConfiguration[] { configuration };
-    }
-
-    Rectangle getBounds() {
-        return new Rectangle(1920, 1080);
-    }
-
-    public int getAvailableAcceleratedMemory() {
-        return 0;
-    }
-
-    public boolean isFullScreenSupported() {
-        return false;
-    }
-
-    public Window getFullScreenWindow() {
-        return null;
-    }
-
-    public void setFullScreenWindow(Window window) {
-    }
-
-    boolean isWindowPerpixelTranslucencySupported() {
-        return true;
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsDevice.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsDevice.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsDevice.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,66 @@
+/*
+ * This file is part of libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package java.awt;
+
+class BDGraphicsDevice extends GraphicsDevice {
+    private BDGraphicsConfiguration configuration;
+
+    BDGraphicsDevice(BDGraphicsEnvironment environment) {
+        configuration = new BDGraphicsConfiguration(this);
+    }
+
+    public int getType() {
+        return TYPE_RASTER_SCREEN;
+    }
+
+    public String getIDstring() {
+        return "BDJ Graphics Device";
+    }
+
+    public GraphicsConfiguration getDefaultConfiguration() {
+        return configuration;
+    }
+
+    public GraphicsConfiguration[] getConfigurations() {
+        return new GraphicsConfiguration[] { configuration };
+    }
+
+    Rectangle getBounds() {
+        return new Rectangle(1920, 1080);
+    }
+
+    public int getAvailableAcceleratedMemory() {
+        return 0;
+    }
+
+    public boolean isFullScreenSupported() {
+        return false;
+    }
+
+    public Window getFullScreenWindow() {
+        return null;
+    }
+
+    public void setFullScreenWindow(Window window) {
+    }
+
+    boolean isWindowPerpixelTranslucencySupported() {
+        return true;
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsEnvironment.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsEnvironment.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDGraphicsEnvironment.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDGraphicsEnvironment.java	2019-02-12 07:45:08.000000000 +0000
@@ -27,7 +27,7 @@ import org.videolan.Logger;
 class BDGraphicsEnvironment extends GraphicsEnvironment {
     private BDGraphicsDevice graphicsDevice;
 
-    BDGraphicsEnvironment() {
+    public BDGraphicsEnvironment() {
         graphicsDevice = new BDGraphicsDevice(this);
     }
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDImageBase.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDImageBase.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDImageBase.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDImageBase.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,255 +0,0 @@
-/*
- * This file is part of libbluray
- * Copyright (C) 2012  libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.awt.color.ColorSpace;
-import java.awt.image.AreaAveragingScaleFilter;
-import java.awt.image.DataBuffer;
-import java.awt.image.DirectColorModel;
-import java.awt.image.ImageConsumer;
-import java.awt.image.ImageProducer;
-import java.awt.image.ImageObserver;
-import java.awt.image.ColorModel;
-import java.awt.image.BufferedImage;
-
-class BDImageBase extends Image {
-    private static Constructor bufferedImageConstructor;
-
-    private Component component;
-    protected int width, height;
-    protected int[] backBuffer;
-    protected Area dirty;
-    private GraphicsConfiguration gc;
-    private Vector observers = new Vector();
-    private ImageProducer offscreenSource = null;
-
-    static {
-        try {
-            final Class c = Class.forName("java.awt.image.BufferedImage");
-            AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public Object run() {
-                        bufferedImageConstructor = c.getDeclaredConstructors()[0];
-                        bufferedImageConstructor.setAccessible(true);
-                        return null;
-                    }
-                }
-           );
-        } catch (ClassNotFoundException e) {
-            throw new AWTError("java.awt.image.BufferedImage not found");
-        }
-    }
-
-    private static BufferedImage createBuffededImage(Image image) {
-        try {
-            return (BufferedImage)bufferedImageConstructor.newInstance(new Object[] { image });
-        } catch (IllegalArgumentException e) {
-            e.printStackTrace();
-        } catch (InstantiationException e) {
-            e.printStackTrace();
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        } catch (InvocationTargetException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    BDImageBase(Component component, int width, int height, GraphicsConfiguration gc) {
-
-        this.component = component;
-        this.width = width;
-        this.height = height;
-        this.gc = gc;
-        if (width > 0 && height > 0)
-            backBuffer = new int[width * height];
-
-        dirty = new Area(width, height);
-
-        offscreenSource = new BDOffScreenImageSource(backBuffer, width, height);
-    }
-
-    public void flush() {
-    }
-
-    public Graphics getGraphics() {
-        return new BDGraphics((BDImage)this);
-    }
-
-    public int getWidth() {
-        return width;
-    }
-
-    public int getWidth(ImageObserver observer) {
-        if (width < 0)
-            addObserver(observer);
-        return width;
-    }
-
-    public int getHeight() {
-        return height;
-    }
-
-    public int getHeight(ImageObserver observer) {
-        if (height < 0)
-            addObserver(observer);
-        return height;
-    }
-
-    public Object getProperty(String name) {
-        return null;
-    }
-
-    public Object getProperty(String name, ImageObserver observer) {
-        return null;
-    }
-
-    public String[] getPropertyNames() {
-        return null;
-    }
-
-    public Image getScaledInstance(int width, int height, int hints) {
-        BDImageConsumer scaledImage = new BDImageConsumer(null);
-        AreaAveragingScaleFilter scaleFilter =
-            new AreaAveragingScaleFilter(width, height);
-        scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage);
-        scaleFilter.setDimensions(this.width, this.height);
-        scaleFilter.setPixels(0, 0, this.width, this.height,
-                              ColorModel.getRGBdefault(), backBuffer, 0, this.width);
-        scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE);
-        return scaledImage;
-    }
-
-    public ImageProducer getSource() {
-        return offscreenSource;
-    }
-
-    public Component getComponent() {
-        return component;
-    }
-
-    protected int[] getBdBackBuffer() {
-        return backBuffer;
-    }
-
-    protected int[] getBackBuffer() {
-        System.err.println("**** BDIMAGE GETBACKBUFFER ****");
-        return backBuffer;
-    }
-
-    protected Area getDirtyArea() {
-        return dirty;
-    }
-
-    public GraphicsConfiguration getGraphicsConfiguration() {
-        return gc;
-    }
-
-    protected void addObserver(ImageObserver observer) {
-        if (observer != null && !isObserver(observer))
-            observers.addElement(observer);
-    }
-
-    protected boolean isObserver(ImageObserver observer) {
-        return observers.contains(observer);
-    }
-
-    protected void removeObserver(ImageObserver observer) {
-        observers.removeElement(observer);
-    }
-
-    protected void notifyObservers(Image img, int info, int x, int y, int w, int h) {
-        Enumeration enumeration = observers.elements();
-        Vector acquired = null;
-        while (enumeration.hasMoreElements()) {
-            ImageObserver observer = (ImageObserver)enumeration.nextElement();
-            if (!observer.imageUpdate(img, info, x, y, w, h)) {
-                if (acquired == null) {
-                    acquired = new Vector();
-                }
-                acquired.addElement(observer);
-            }
-        }
-        if (acquired != null) {
-            enumeration = acquired.elements();
-            while (enumeration.hasMoreElements()) {
-                ImageObserver observer = (ImageObserver)enumeration.nextElement();
-                removeObserver(observer);
-            }
-        }
-    }
-
-    public int getType() {
-        return BufferedImage.TYPE_INT_ARGB;
-    }
-
-    public ColorModel getColorModel() {
-        return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
-                32, 0x00ff0000, 0x0000ff00,     0x000000ff, 0xff000000, true,
-                DataBuffer.TYPE_INT);
-    }
-
-    public int getRGB(int x, int y) {
-        return backBuffer[y * width + x];
-    }
-
-    public int[] getRGB(int x, int y, int w, int h, int[] rgbArray, int offset, int scansize) {
-        if (rgbArray == null)
-            rgbArray = new int[offset + h * scansize];
-
-        for (int i = 0; i < h; i++)
-            System.arraycopy(backBuffer, (y + i) * width + x,
-                             rgbArray, i * scansize + offset,
-                             w);
-        return rgbArray;
-    }
-
-    public void setRGB(int x, int y, int rgb) {
-        backBuffer[y * width + x] = rgb;
-
-        dirty.add(x, y);
-    }
-
-    public void setRGB(int x, int y, int w, int h, int[] rgbArray, int offset, int scansize) {
-        for (int i = 0; i < h; i++)
-            System.arraycopy(rgbArray, i * scansize + offset,
-                             backBuffer, (y + i) * width + x,
-                             w);
-        dirty.add(new Rectangle(x, y, w, h));
-    }
-
-    public BufferedImage getSubimage(int x, int y, int w, int h) {
-        BDImage image = new BDImage(component, w, h, gc);
-        int[] rgbArray = image.getBdBackBuffer();
-        getRGB(x, y, w, h, rgbArray, 0, w);
-        return createBuffededImage(image);
-    }
-
-    public static BufferedImage getBuffededImage(int w, int h, GraphicsConfiguration gc) {
-        BDImage image = new BDImage(null, w, h, gc);
-        return createBuffededImage(image);
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDImage.java 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDImage.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/awt/BDImage.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/awt/BDImage.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,257 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2012  libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package java.awt;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Vector;
+import java.util.Enumeration;
+import java.awt.color.ColorSpace;
+import java.awt.image.AreaAveragingScaleFilter;
+import java.awt.image.DataBuffer;
+import java.awt.image.DirectColorModel;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageProducer;
+import java.awt.image.ImageObserver;
+import java.awt.image.ColorModel;
+import java.awt.image.BufferedImage;
+
+import sun.awt.image.BufferedImagePeer;
+
+class BDImage extends Image implements BufferedImagePeer {
+    private static Constructor bufferedImageConstructor;
+
+    private Component component;
+    protected int width, height;
+    protected int[] backBuffer;
+    protected Area dirty;
+    private GraphicsConfiguration gc;
+    private Vector observers = new Vector();
+    private ImageProducer offscreenSource = null;
+
+    static {
+        try {
+            final Class c = Class.forName("java.awt.image.BufferedImage");
+            AccessController.doPrivileged(
+                new PrivilegedAction() {
+                    public Object run() {
+                        bufferedImageConstructor = c.getDeclaredConstructors()[0];
+                        bufferedImageConstructor.setAccessible(true);
+                        return null;
+                    }
+                }
+           );
+        } catch (ClassNotFoundException e) {
+            throw new AWTError("java.awt.image.BufferedImage not found");
+        }
+    }
+
+    private static BufferedImage createBuffededImage(Image image) {
+        try {
+            return (BufferedImage)bufferedImageConstructor.newInstance(new Object[] { image });
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    BDImage(Component component, int width, int height, GraphicsConfiguration gc) {
+
+        this.component = component;
+        this.width = width;
+        this.height = height;
+        this.gc = gc;
+        if (width > 0 && height > 0)
+            backBuffer = new int[width * height];
+
+        dirty = new Area(width, height);
+
+        offscreenSource = new BDOffScreenImageSource(backBuffer, width, height);
+    }
+
+    public void flush() {
+    }
+
+    public Graphics getGraphics() {
+        return new BDGraphics(this);
+    }
+
+    public int getWidth() {
+        return width;
+    }
+
+    public int getWidth(ImageObserver observer) {
+        if (width < 0)
+            addObserver(observer);
+        return width;
+    }
+
+    public int getHeight() {
+        return height;
+    }
+
+    public int getHeight(ImageObserver observer) {
+        if (height < 0)
+            addObserver(observer);
+        return height;
+    }
+
+    public Object getProperty(String name) {
+        return null;
+    }
+
+    public Object getProperty(String name, ImageObserver observer) {
+        return null;
+    }
+
+    public String[] getPropertyNames() {
+        return null;
+    }
+
+    public Image getScaledInstance(int width, int height, int hints) {
+        BDImageConsumer scaledImage = new BDImageConsumer(null);
+        AreaAveragingScaleFilter scaleFilter =
+            new AreaAveragingScaleFilter(width, height);
+        scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage);
+        scaleFilter.setDimensions(this.width, this.height);
+        scaleFilter.setPixels(0, 0, this.width, this.height,
+                              ColorModel.getRGBdefault(), backBuffer, 0, this.width);
+        scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE);
+        return scaledImage;
+    }
+
+    public ImageProducer getSource() {
+        return offscreenSource;
+    }
+
+    public Component getComponent() {
+        return component;
+    }
+
+    protected int[] getBdBackBuffer() {
+        return backBuffer;
+    }
+
+    protected int[] getBackBuffer() {
+        System.err.println("**** BDIMAGE GETBACKBUFFER ****");
+        return backBuffer;
+    }
+
+    protected Area getDirtyArea() {
+        return dirty;
+    }
+
+    public GraphicsConfiguration getGraphicsConfiguration() {
+        return gc;
+    }
+
+    protected void addObserver(ImageObserver observer) {
+        if (observer != null && !isObserver(observer))
+            observers.addElement(observer);
+    }
+
+    protected boolean isObserver(ImageObserver observer) {
+        return observers.contains(observer);
+    }
+
+    protected void removeObserver(ImageObserver observer) {
+        observers.removeElement(observer);
+    }
+
+    protected void notifyObservers(Image img, int info, int x, int y, int w, int h) {
+        Enumeration enumeration = observers.elements();
+        Vector acquired = null;
+        while (enumeration.hasMoreElements()) {
+            ImageObserver observer = (ImageObserver)enumeration.nextElement();
+            if (!observer.imageUpdate(img, info, x, y, w, h)) {
+                if (acquired == null) {
+                    acquired = new Vector();
+                }
+                acquired.addElement(observer);
+            }
+        }
+        if (acquired != null) {
+            enumeration = acquired.elements();
+            while (enumeration.hasMoreElements()) {
+                ImageObserver observer = (ImageObserver)enumeration.nextElement();
+                removeObserver(observer);
+            }
+        }
+    }
+
+    public int getType() {
+        return BufferedImage.TYPE_INT_ARGB;
+    }
+
+    public ColorModel getColorModel() {
+        return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                32, 0x00ff0000, 0x0000ff00,     0x000000ff, 0xff000000, true,
+                DataBuffer.TYPE_INT);
+    }
+
+    public int getRGB(int x, int y) {
+        return backBuffer[y * width + x];
+    }
+
+    public int[] getRGB(int x, int y, int w, int h, int[] rgbArray, int offset, int scansize) {
+        if (rgbArray == null)
+            rgbArray = new int[offset + h * scansize];
+
+        for (int i = 0; i < h; i++)
+            System.arraycopy(backBuffer, (y + i) * width + x,
+                             rgbArray, i * scansize + offset,
+                             w);
+        return rgbArray;
+    }
+
+    public void setRGB(int x, int y, int rgb) {
+        backBuffer[y * width + x] = rgb;
+
+        dirty.add(x, y);
+    }
+
+    public void setRGB(int x, int y, int w, int h, int[] rgbArray, int offset, int scansize) {
+        for (int i = 0; i < h; i++)
+            System.arraycopy(rgbArray, i * scansize + offset,
+                             backBuffer, (y + i) * width + x,
+                             w);
+        dirty.add(new Rectangle(x, y, w, h));
+    }
+
+    public BufferedImage getSubimage(int x, int y, int w, int h) {
+        BDImage image = new BDImage(component, w, h, gc);
+        int[] rgbArray = image.getBdBackBuffer();
+        getRGB(x, y, w, h, rgbArray, 0, w);
+        return createBuffededImage(image);
+    }
+
+    public static BufferedImage getBuffededImage(int w, int h, GraphicsConfiguration gc) {
+        BDImage image = new BDImage(null, w, h, gc);
+        return createBuffededImage(image);
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/io/FileDescriptor.java 1:1.1.0-1/src/libbluray/bdj/java/java/io/FileDescriptor.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/io/FileDescriptor.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/io/FileDescriptor.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,115 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.io;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-
-public final class FileDescriptor {
-
-    /* for files used by JVM */
-    private int  fd;
-    private long handle;
-
-    /* for files in BD VFS */
-    private long fp;
-
-    /* for files inside .jar */
-    protected InputStream slave;
-
-    private int useCount;
-
-    public FileDescriptor() {
-	fd = -1;
-        handle = -1;
-        fp = 0;
-        slave = null;
-        useCount = 0;
-    }
-
-    private FileDescriptor(int fd) {
-        this();
-	this.fd = fd;
-    }
-
-    public static final FileDescriptor in  = new FileDescriptor(0);
-    public static final FileDescriptor out = new FileDescriptor(1);
-    public static final FileDescriptor err = new FileDescriptor(2);
-
-    public boolean valid() {
-	return (fd != -1) || (handle != -1) || (fp != 0) || (slave != null);
-    }
-
-    public native void sync() throws SyncFailedException;
-
-    private static native void initIDs();
-
-    static {
-	initIDs();
-    }
-
-    int incrementAndGetUseCount() {
-        synchronized (this) {
-            useCount = useCount + 1;
-            return useCount;
-        }
-    }
-
-    int decrementAndGetUseCount() {
-        synchronized (this) {
-            useCount = useCount - 1;
-            return useCount;
-        }
-    }
-
-    /* Java 8 */
-
-    private List parents = null;
-    private boolean closed = false;
-
-    synchronized void attach(Closeable c) {
-        if (parents == null) {
-            parents = new ArrayList();
-        }
-        parents.add(c);
-    }
-
-    synchronized void closeAll(Closeable releaser) throws IOException {
-        if (!closed) {
-            IOException ex = null;
-            closed = true;
-
-            for (Iterator it = parents.iterator(); it.hasNext(); ) {
-                Closeable c = (Closeable)it.next();
-                try {
-                    c.close();
-                } catch (IOException ioe) {
-                    if (ex != null)
-                        ex = ioe;
-                }
-            }
-
-            releaser.close();
-            if (ex != null) {
-                throw ex;
-            }
-        }
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/java/io/FileInputStream.java 1:1.1.0-1/src/libbluray/bdj/java/java/io/FileInputStream.java
--- 1:1.0.2-3/src/libbluray/bdj/java/java/io/FileInputStream.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/java/io/FileInputStream.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,215 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.io;
-
-
-import org.videolan.BDJLoader;
-import org.videolan.BDJXletContext;
-import org.videolan.Logger;
-
-public class FileInputStream extends InputStream
-{
-    private FileDescriptor fd;
-
-    private final Object closeLock = new Object();
-    private volatile boolean closed = false;
-
-    private static Logger logger = null;
-
-    private int available = 0;
-
-    public FileInputStream(File file) throws FileNotFoundException {
-        String name = file != null ? file.getPath() : null;
-
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(name);
-        }
-        if (name == null) {
-            throw new NullPointerException();
-        }
-
-        fd = new FileDescriptor();
-        fd.incrementAndGetUseCount();
-
-        if (file.isAbsolute()) {
-            String cachedName = BDJLoader.getCachedFile(name);
-            if (cachedName != name) {
-                synchronized (FileInputStream.class) {
-                if (logger == null) {
-                    logger = Logger.getLogger(FileInputStream.class.getName());
-                }
-                }
-                logger.info("Using cached " + cachedName + " for " + name);
-                name = cachedName;
-            }
-            openImpl(name);
-        } else {
-            /* relative paths are problematic ... */
-            /* Those should be mapped to xlet home directory, which is inside .jar file. */
-
-            String home = BDJXletContext.getCurrentXletHome();
-            if (home == null) {
-                synchronized (FileInputStream.class) {
-                if (logger == null) {
-                    logger = Logger.getLogger(FileInputStream.class.getName());
-                }
-                }
-                logger.error("no home found for " + name + " at " + Logger.dumpStack());
-                throw new FileNotFoundException(name);
-            }
-            openImpl(home + name);
-        }
-
-        available = 1024;
-    }
-
-    public FileInputStream(String name) throws FileNotFoundException {
-        this(name != null ? new File(name) : null);
-    }
-
-    public FileInputStream(FileDescriptor fdObj) {
-        SecurityManager security = System.getSecurityManager();
-        if (fdObj == null) {
-            throw new NullPointerException();
-        }
-        if (security != null) {
-            security.checkRead(fdObj);
-        }
-        fdObj.incrementAndGetUseCount();
-        fd = fdObj;
-        available = 1024;
-    }
-
-    /* open()/open0() wrapper to select correct native method at runtime */
-    private void openImpl(String name) throws FileNotFoundException {
-        try {
-            open(name);
-        } catch (UnsatisfiedLinkError e) {
-            /* OpenJDK 8 b40 */
-            open0(name);
-        }
-    }
-
-    private native int  readBytes(byte b[], int off, int len) throws IOException;
-    private native int  close0();
-    /* OpenJDK 6, OpenJDK 7, PhoneME, ... */
-    private native void open(String name) throws FileNotFoundException;
-    /* OpenJDK 8 */
-    private native void open0(String name) throws FileNotFoundException;
-
-    //public  native int  read() throws IOException;
-    //public  native long skip(long n) throws IOException;
-    //public  native int  available() throws IOException;
-
-    public int available() throws IOException {
-        if (fd != null && fd.slave != null) {
-            return fd.slave.available();
-        }
-        return available;
-    }
-
-    public  int  read() throws IOException {
-        byte b[] = new byte[1];
-        if (read(b) == 1)
-            return b[0];
-        return -1;
-    }
-
-    public int read(byte b[]) throws IOException {
-        return read(b, 0, b.length);
-    }
-
-    public int read(byte b[], int off, int len) throws IOException {
-        if (b == null) {
-            throw new NullPointerException();
-        }
-        if (off < 0 || len < 0 || off > b.length || (off + len) > b.length || (off + len) < 0) {
-            throw new IndexOutOfBoundsException();
-        }
-
-        if (fd != null && fd.slave != null) {
-            return fd.slave.read(b, off, len);
-        }
-
-        int r = readBytes(b, off, len);
-        if (r != len) {
-            available = 0;
-        }
-        return r;
-    }
-
-    public long skip(long n) throws IOException {
-        return super.skip(n);
-    }
-
-    public void close() throws IOException {
-        close(true);
-    }
-
-    public void close(boolean force) throws IOException {
-        synchronized (closeLock) {
-            if (closed) {
-                return;
-            }
-            closed = true;
-        }
-
-        available = 0;
-
-        if (fd != null) {
-            if (fd.slave != null) {
-                fd.slave.close();
-                return;
-            }
-
-            int n = fd.decrementAndGetUseCount();
-            if (n > 0 && !force) {
-                return;
-            }
-        }
-
-        close0();
-    }
-
-    public final FileDescriptor getFD() throws IOException {
-        if (fd == null) {
-            throw new IOException();
-        }
-        return fd;
-    }
-
-    /* not in J2SE
-    public FileChannel getChannel() {}
-    */
-
-    private static native void initIDs();
-
-    static {
-        initIDs();
-    }
-
-    protected void finalize() throws IOException {
-        if (fd != null) {
-            if (fd != FileDescriptor.in) {
-                close(false);
-            }
-        }
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/javax/microedition/xlet/UnavailableContainerException.java 1:1.1.0-1/src/libbluray/bdj/java/javax/microedition/xlet/UnavailableContainerException.java
--- 1:1.0.2-3/src/libbluray/bdj/java/javax/microedition/xlet/UnavailableContainerException.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/javax/microedition/xlet/UnavailableContainerException.java	2019-02-12 07:45:08.000000000 +0000
@@ -26,4 +26,6 @@ public class UnavailableContainerExcepti
     public UnavailableContainerException(String s) {
         super(s);
     }
+
+    private static final long serialVersionUID = -1496745004714375188L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java 1:1.1.0-1/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java
--- 1:1.0.2-3/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/javax/tv/util/TVTimerScheduleFailedException.java	2019-02-12 07:45:08.000000000 +0000
@@ -27,4 +27,6 @@ public class TVTimerScheduleFailedExcept
     public TVTimerScheduleFailedException(String param) {
         super(param);
     }
+
+    private static final long serialVersionUID = -1590752404469571809L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java 1:1.1.0-1/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/javax/tv/util/TVTimerWentOffEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -33,4 +33,5 @@ public class TVTimerWentOffEvent extends
     }
 
     private TVTimerSpec spec = null;
+    private static final long serialVersionUID = -2429738748897860796L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/bluray/ti/DiscEjectedEvent.java 1:1.1.0-1/src/libbluray/bdj/java/org/bluray/ti/DiscEjectedEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/bluray/ti/DiscEjectedEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/bluray/ti/DiscEjectedEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -23,4 +23,6 @@ public class DiscEjectedEvent extends Di
     public DiscEjectedEvent(Object source) {
         super(source);
     }
+
+    private static final long serialVersionUID = -5165934355777383590L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/bluray/ti/DiscInsertedEvent.java 1:1.1.0-1/src/libbluray/bdj/java/org/bluray/ti/DiscInsertedEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/bluray/ti/DiscInsertedEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/bluray/ti/DiscInsertedEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -23,4 +23,6 @@ public class DiscInsertedEvent extends D
     public DiscInsertedEvent(Object source) {
         super(source);
     }
+
+    private static final long serialVersionUID = -474637357700362624L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/media/AlignedSubtitleChangeEvent.java 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/media/AlignedSubtitleChangeEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/media/AlignedSubtitleChangeEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/media/AlignedSubtitleChangeEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -33,4 +33,6 @@ public class AlignedSubtitleChangeEvent
     public int getAlignedSubtitle() {
         return subtitleAlignment;
     }
+
+    private static final long serialVersionUID = -5865844251150398766L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/media/GraphicsOffsetSequenceChangeEvent.java 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/media/GraphicsOffsetSequenceChangeEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/media/GraphicsOffsetSequenceChangeEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/media/GraphicsOffsetSequenceChangeEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -33,4 +33,6 @@ public class GraphicsOffsetSequenceChang
     public int getOffsetSequenceId() {
         return sequenceId;
     }
+
+    private static final long serialVersionUID = 1603263652183869628L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/ti/StereoscopicCodingType.java 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/ti/StereoscopicCodingType.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/s3d/ti/StereoscopicCodingType.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/s3d/ti/StereoscopicCodingType.java	2019-02-12 07:45:08.000000000 +0000
@@ -34,7 +34,7 @@ public class StereoscopicCodingType {
                         Class classCodingType = Class.forName("org.bluray.ti.CodingType");
                         Constructor constructor = classCodingType.getDeclaredConstructor(new Class[] { String.class });
                         constructor.setAccessible(true);
-                        type = (CodingType)constructor.newInstance(new String[] { "MPEG4_MVC_VIDEO" });
+                        type = (CodingType)constructor.newInstance((Object [])new String[] { "MPEG4_MVC_VIDEO" });
                     }
                     catch (Exception e) {
                         System.err.println("StereoscopicCodingType.MPEG4_MVC_VIDEO initialization failed");
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/uhd/ti/UHDCodingType.java 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/uhd/ti/UHDCodingType.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/blurayx/uhd/ti/UHDCodingType.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/blurayx/uhd/ti/UHDCodingType.java	2019-02-12 07:45:08.000000000 +0000
@@ -35,7 +35,7 @@ public class UHDCodingType {
                         Class classCodingType = Class.forName("org.bluray.ti.CodingType");
                         Constructor constructor = classCodingType.getDeclaredConstructor(new Class[] { String.class });
                         constructor.setAccessible(true);
-                        type = (CodingType)constructor.newInstance(new String[] { "HEVC_VIDEO" });
+                        type = (CodingType)constructor.newInstance((Object [])new String[] { "HEVC_VIDEO" });
                     }
                     catch (Exception e) {
                         System.err.println("UHDCodingType.HEVC_VIDEO initialization failed");
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/davic/media/MediaTimeEvent.java 1:1.1.0-1/src/libbluray/bdj/java/org/davic/media/MediaTimeEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/davic/media/MediaTimeEvent.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/davic/media/MediaTimeEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -42,4 +42,5 @@ public class MediaTimeEvent extends java
     private final Object source;
     private final long eventTime;
     private final int eventId;
+    private static final long serialVersionUID = -5118752039526605115L;
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/dvb/event/EventManager.java 1:1.1.0-1/src/libbluray/bdj/java/org/dvb/event/EventManager.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/dvb/event/EventManager.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/dvb/event/EventManager.java	2019-02-12 07:45:08.000000000 +0000
@@ -29,10 +29,8 @@ import org.davic.resources.ResourceClien
 import org.davic.resources.ResourceServer;
 import org.davic.resources.ResourceStatusEvent;
 import org.davic.resources.ResourceStatusListener;
-import org.havi.ui.HScene;
 import org.videolan.BDJAction;
 import org.videolan.BDJXletContext;
-import org.videolan.GUIManager;
 import org.videolan.Logger;
 
 public class EventManager implements ResourceServer {
@@ -152,11 +150,10 @@ public class EventManager implements Res
 
     public boolean receiveKeyEventN(int type, int modifiers, int keyCode) {
         UserEvent ue = new UserEvent(this, 1, type, keyCode, modifiers, System.currentTimeMillis());
-        HScene focusHScene = GUIManager.getInstance().getFocusHScene();
+        BDJXletContext context = BDJXletContext.getFocusContext();
         boolean result = false;
 
-        if (focusHScene != null) {
-            BDJXletContext context = focusHScene.getXletContext();
+        if (context != null) {
             for (Iterator it = exclusiveAWTEventListener.iterator(); it.hasNext(); ) {
                 UserEventItem item = (UserEventItem)it.next();
                 if (item.context == null || item.context.isReleased()) {
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/dvb/io/persistent/FileAccessPermissions.java 1:1.1.0-1/src/libbluray/bdj/java/org/dvb/io/persistent/FileAccessPermissions.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/dvb/io/persistent/FileAccessPermissions.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/dvb/io/persistent/FileAccessPermissions.java	2019-02-12 07:45:08.000000000 +0000
@@ -39,11 +39,11 @@ public class FileAccessPermissions {
         return writeWorld;
     }
 
-    public boolean hasReadOrganizationAccessRight() {
+    public boolean hasReadOrganisationAccessRight() {
         return readOrganization;
     }
 
-    public boolean hasWriteOrganizationAccessRight() {
+    public boolean hasWriteOrganisationAccessRight() {
         return writeOrganization;
     }
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HBackgroundDevice.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,14 +20,26 @@
 
 package org.havi.ui;
 
+import org.blurayx.s3d.ui.HBackgroundConfigTemplateS3D;
+import org.blurayx.uhd.ui.HBackgroundConfigurationTemplateUHD;
+
 import java.awt.Color;
 
 public class HBackgroundDevice extends HScreenDevice {
     protected HBackgroundDevice() {
+        boolean is_p6 = isProfile6();
+        boolean is_p5 = isProfile5();
         int length = HScreenConfigTemplate.defaultConfig.length;
         hbcArray = new HBackgroundConfiguration[length];
         for (int i = 0; i < length; i++) {
-            HBackgroundConfigTemplate hbct = new HBackgroundConfigTemplate();
+            HBackgroundConfigTemplate hbct;
+            if (is_p6) {
+                hbct = new HBackgroundConfigurationTemplateUHD();
+            } else if (is_p5) {
+                hbct = new HBackgroundConfigTemplateS3D();
+            } else {
+                hbct = new HBackgroundConfigTemplate();
+            }
             HScreenConfigTemplate.initDefaultConfigTemplate(hbct, i);
             hbcArray[i] = new HStillImageBackgroundConfiguration(hbct, new Color(0, 0, 0, 0));
         }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,6 +20,9 @@
 
 package org.havi.ui;
 
+import org.blurayx.s3d.ui.HGraphicsConfigTemplateS3D;
+import org.blurayx.uhd.ui.HGraphicsConfigurationTemplateUHD;
+
 import java.awt.Dimension;
 
 import org.videolan.GUIManager;
@@ -26,10 +30,19 @@ import org.videolan.Logger;
 
 public class HGraphicsDevice extends HScreenDevice {
     protected HGraphicsDevice() {
+        boolean is_p6 = isProfile6();
+        boolean is_p5 = isProfile5();
         int length = HScreenConfigTemplate.defaultConfig.length;
         hgcArray = new HGraphicsConfiguration[length];
         for (int i = 0; i < length; i++) {
-            HGraphicsConfigTemplate hgct = new HGraphicsConfigTemplate();
+            HGraphicsConfigTemplate hgct;
+            if (is_p6) {
+                hgct = new HGraphicsConfigurationTemplateUHD();
+            } else if (is_p5) {
+                hgct = new HGraphicsConfigTemplateS3D();
+            } else {
+                hgct = new HGraphicsConfigTemplate();
+            }
             HScreenConfigTemplate.initDefaultConfigTemplate(hgct, i);
             hgcArray[i] = new HGraphicsConfiguration(hgct);
         }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -38,6 +39,15 @@ public class HScreenDevice implements Re
     HScreenDevice() {
     }
 
+    protected boolean isProfile5() {
+        String p = System.getProperty("bluray.profile.5");
+        return (p != null && p.equals("YES"));
+    }
+    protected boolean isProfile6() {
+        String p = System.getProperty("bluray.profile.6");
+        return (p != null && p.equals("YES"));
+    }
+
     public String getIDstring() {
         return "HAVi Screen Device";
     }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/havi/ui/HVideoDevice.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,12 +20,24 @@
 
 package org.havi.ui;
 
+import org.blurayx.s3d.ui.HVideoConfigTemplateS3D;
+import org.blurayx.uhd.ui.HVideoConfigurationTemplateUHD;
+
 public class HVideoDevice extends HScreenDevice {
     protected HVideoDevice() {
+        boolean is_p6 = isProfile6();
+        boolean is_p5 = isProfile5();
         int length = HScreenConfigTemplate.defaultConfig.length;
         hvcArray = new HVideoConfiguration[length];
         for (int i = 0; i < length; i++) {
-            HVideoConfigTemplate hvct = new HVideoConfigTemplate();
+            HVideoConfigTemplate hvct;
+            if (is_p6) {
+                hvct = new HVideoConfigurationTemplateUHD();
+            } else if (is_p5) {
+                hvct = new HVideoConfigTemplateS3D();
+            } else {
+                hvct = new HVideoConfigTemplate();
+            }
             HScreenConfigTemplate.initDefaultConfigTemplate(hvct, i);
             hvcArray[i] = new HVideoConfiguration(hvct);
         }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJClassFileTransformer.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJClassFileTransformer.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJClassFileTransformer.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJClassFileTransformer.java	2019-02-12 07:45:08.000000000 +0000
@@ -65,7 +65,7 @@ public class BDJClassFileTransformer
             ClassReader cr = new ClassReader(b);
             ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES/* | ClassWriter.COMPUTE_MAXS*/);
             ClassVisitor cv = new RemappingClassAdapter(cw, m);
-            cr.accept(cv, ClassReader.SKIP_DEBUG);
+            cr.accept(cv, ClassReader.SKIP_DEBUG | ClassReader.EXPAND_FRAMES);
             return cw.toByteArray();
         } catch (Exception e) {
             logger.error("Failed renaming class: " + e);
@@ -87,7 +87,7 @@ public class BDJClassFileTransformer
             ClassReader cr = new ClassReader(r);
             ClassWriter cw = new ClassWriter(cr, 0/*ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS*/);
             ClassVisitor cv = new MyClassVisitor(cw);
-            cr.accept(cv, ClassReader.SKIP_DEBUG);
+            cr.accept(cv, ClassReader.SKIP_DEBUG | ClassReader.EXPAND_FRAMES);
             return cw.toByteArray();
         } catch (Exception e) {
             logger.error("Failed transforming class: " + e);
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java	2019-02-12 07:45:08.000000000 +0000
@@ -109,7 +109,7 @@ public class BDJClassLoader extends URLC
         super(urls);
         this.xletClass = xletClass;
 
-        BDJClassLoaderAdapter a = Libbluray.getLoaderAdapter();
+        BDJClassLoaderAdapter a = Libbluray.getClassLoaderAdapter();
         if (a != null) {
             hideClasses = a.getHideClasses();
             bootClasses = a.getBootClasses();
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJLoaderAdapter.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJLoaderAdapter.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJLoaderAdapter.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJLoaderAdapter.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,32 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2018  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package org.videolan;
+
+import org.videolan.bdjo.AppEntry;
+
+public interface BDJLoaderAdapter {
+
+    /*
+     * Modify BDJO at run time
+     */
+
+    /* patch application table */
+    public abstract AppEntry[] patchAppTable(AppEntry[] in, int title);
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJLoader.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJLoader.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJLoader.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJLoader.java	2019-02-12 07:45:08.000000000 +0000
@@ -26,6 +26,7 @@ import java.util.Enumeration;
 import org.videolan.Logger;
 
 import org.bluray.net.BDLocator;
+import org.bluray.system.RegisterAccess;
 import org.bluray.ti.TitleImpl;
 import org.davic.media.MediaLocator;
 import org.dvb.application.AppID;
@@ -240,6 +241,14 @@ public class BDJLoader {
                 vfsCache.add(bdjo.getAppCaches());
             }
 
+            try {
+                BDJLoaderAdapter a = Libbluray.getLoaderAdapter();
+                if (a != null)
+                    appTable = a.patchAppTable(appTable, title.getTitleNum());
+            } catch (Throwable t) {
+                logger.error("" + t);
+            }
+
             // initialize appProxys
             for (int i = 0; i < appTable.length; i++) {
                 if (proxys[i] == null) {
@@ -259,7 +268,7 @@ public class BDJLoader {
             }
 
             // change psr
-            Libbluray.writePSR(Libbluray.PSR_TITLE_NUMBER, title.getTitleNum());
+            Libbluray.writePSR(RegisterAccess.PSR_TITLE_NR, title.getTitleNum());
 
             // notify AppsDatabase
             ((BDJAppsDatabase)BDJAppsDatabase.getAppsDatabase()).newDatabase(bdjo, proxys);
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java	2019-02-12 07:45:08.000000000 +0000
@@ -148,6 +148,28 @@ public class AppEntry implements AppAttr
         return ((binding & DISC_BOUND) != 0);
     }
 
+    public AppEntry(AppEntry a) {
+        try {
+            this.icon         = new AppIcon(new BDLocator(a.icon.getLocator().toExternalForm()),
+                                            (BitSet)a.icon.getIconFlags().clone());
+        } catch (Throwable t) {
+            /* may be null */
+        }
+        this.controlCode  = a.controlCode;
+        this.type         = a.type;
+        this.appid        = new AppID(a.appid.getOID(), a.appid.getAID());
+
+        this.profiles     = (AppProfile[])a.profiles.clone();
+        this.priority     = a.priority;
+        this.binding      = a.binding;
+        //this.visibility = visibility;
+        this.names        = (String[][])a.names.clone();
+        this.basePath     = a.basePath;
+        this.classpathExt = a.classpathExt;
+        this.initialClass = a.initialClass;
+        this.params       = (String[])a.params.clone();
+    }
+
     public AppEntry(int controlCode, int type, int orgId,
                     short appId, AppProfile[] profiles, short priority,
                     int binding, int visibility, String[][] names,
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java	2019-02-12 07:45:08.000000000 +0000
@@ -68,6 +68,18 @@ final class BDJSecurityManager extends S
      *
      */
 
+    private int classDepth0(String name) {
+        StackTraceElement e[] = new Exception("Stack trace").getStackTrace();
+        if (e != null && e.length > 1) {
+            for (int i = 1; i < e.length; i++) {
+                if (e[i].getClassName().equals(name)) {
+                    return i - 1;
+                }
+            }
+        }
+        return -1;
+    }
+
     private void deny(Permission perm) {
         logger.error("denied " + perm + "\n" + Logger.dumpStack());
         throw new SecurityException("denied " + perm);
@@ -78,14 +90,14 @@ final class BDJSecurityManager extends S
             if (perm.implies(new RuntimePermission("createSecurityManager"))) {
 
                 // allow initializing of javax.crypto.JceSecurityManager
-                if (classDepth("javax.crypto.JceSecurityManager") < 3) {
+                if (classDepth0("javax.crypto.JceSecurityManager") < 3) {
                     return;
                 }
 
                 deny(perm);
             }
             if (perm.implies(new RuntimePermission("setSecurityManager"))) {
-                if (classDepth("org.videolan.Libbluray") == 3) {
+                if (classDepth0("org.videolan.Libbluray") == 3) {
                     return;
                 }
                 deny(perm);
@@ -94,7 +106,7 @@ final class BDJSecurityManager extends S
             // work around bug in openjdk 7 / 8
             // sun.awt.AWTAutoShutdown.notifyThreadBusy is missing doPrivileged()
             // (fixed in jdk9 / http://hg.openjdk.java.net/jdk9/client/jdk/rev/5b613a3c04be )
-            if (classDepth("sun.awt.AWTAutoShutdown") > 0) {
+            if (classDepth0("sun.awt.AWTAutoShutdown") > 0) {
                 return;
             }
 
@@ -206,6 +218,31 @@ final class BDJSecurityManager extends S
     }
 
     /*
+     * Allow package access (Java 11)
+     */
+
+    private static String pkgPrefixes[] = {
+        "javax.media" ,
+        "javax.tv",
+        "javax.microedition",
+        "org.davic",
+        "org.dvb",
+        "org.havi",
+        "org.bluray",
+        "org.blurayx",
+        "com.aacsla.bluray",
+    };
+
+    public void checkPackageAccess(String pkg) {
+
+        for (int i = 0; i < pkgPrefixes.length; i++)
+            if (pkg.startsWith(pkgPrefixes[i]))
+                return;
+
+        super.checkPackageAccess(pkg);
+    }
+
+    /*
      *
      */
 
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJXletContext.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJXletContext.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/BDJXletContext.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/BDJXletContext.java	2019-02-12 07:45:08.000000000 +0000
@@ -155,7 +155,7 @@ public class BDJXletContext implements j
             return null;
         }
 
-        ClassLoader cldr = (ClassLoader)ctx.getClassLoader();
+        ClassLoader cldr = ctx.getClassLoader();
         if (cldr == null) {
             logger.error("getCurrentClassLoader(): no class loader: " + Logger.dumpStack());
             return null;
@@ -431,6 +431,14 @@ public class BDJXletContext implements j
         return ((BDJThreadGroup)obj).getContext();
     }
 
+    public static BDJXletContext getFocusContext() {
+        if (BDJXletContext.getCurrentContext() != null) {
+            logger.error("getFocusContext() called from Xlet code:\n" + Logger.dumpStack());
+            return null;
+        }
+        return GUIManager.getInstance().getFocusHSceneContext();
+    }
+
     protected void setArgs(String[] args) {
         this.args = args;
     }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/CacheDir.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/CacheDir.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/CacheDir.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/CacheDir.java	2019-02-12 07:45:08.000000000 +0000
@@ -84,7 +84,7 @@ class CacheDir {
         cleanupCache();
 
         for (int i = 0; i < 100; i++) {
-            File tmpDir = new File(baseDir, "" + System.nanoTime());
+            File tmpDir = new File(baseDir, Long.toHexString(System.nanoTime() + i));
             tmpDir = new File(tmpDir.getCanonicalPath());
 
             if (tmpDir.mkdirs()) {
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/GUIManager.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/GUIManager.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/GUIManager.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/GUIManager.java	2019-02-12 07:45:08.000000000 +0000
@@ -20,9 +20,7 @@
 package org.videolan;
 
 import java.awt.BDRootWindow;
-import java.awt.AWTException;
 import java.awt.Component;
-import java.awt.image.BufferedImage;
 
 import org.havi.ui.HScene;
 
@@ -54,21 +52,11 @@ public class GUIManager extends BDRootWi
         }
     }
 
-    public BufferedImage createBufferedImage(int width, int height)
-            throws AWTException {
-        BufferedImage img = getGraphicsConfiguration().createCompatibleImage(width, height);
-
-        if (img == null)
-            throw new AWTException("Failed to create buffered image");
-
-        return img;
-    }
-
-    public HScene getFocusHScene() {
+    BDJXletContext getFocusHSceneContext() {
         Component component = getFocusOwner();
         while (component != null) {
             if (component instanceof HScene)
-                return (HScene)component;
+                return ((HScene)component).getXletContext();
             component = component.getParent();
         }
         return null;
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/Libbluray.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/Libbluray.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/Libbluray.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/Libbluray.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010      William Hahne
- * Copyright (C) 2012-2014 Petri Hintukainen <phintuka@users.sourceforge.net>
+ * Copyright (C) 2012-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -53,6 +53,8 @@ public class Libbluray {
 
     /* hook system properties: make "user.dir" point to current Xlet home directory */
 
+    private static boolean booted;
+
     private static void hookProperties() {
         java.util.Properties p = new java.util.Properties(System.getProperties()) {
                 public String getProperty(String key) {
@@ -61,10 +63,13 @@ public class Libbluray {
                         if (ctx != null) {
                             return ctx.getXletHome();
                         }
-                        System.err.println("getProperty(user.dir): no context !  " + Logger.dumpStack());
+                        if (booted) {
+                            System.err.println("getProperty(user.dir): no context !  " + Logger.dumpStack());
+                        }
                     }
                     return super.getProperty(key);
                 }
+                private static final long serialVersionUID = -6253354431747524430L;
             };
         System.setProperties(p);
     }
@@ -73,22 +78,37 @@ public class Libbluray {
      * Loader hooks
      */
 
-    private static BDJClassLoaderAdapter loaderAdapter = null;
+    private static BDJClassLoaderAdapter classLoaderAdapter = null;
+    private static BDJLoaderAdapter      loaderAdapter = null;
 
-    protected static BDJClassLoaderAdapter getLoaderAdapter() {
+    protected static BDJClassLoaderAdapter getClassLoaderAdapter() {
+        return classLoaderAdapter;
+    }
+    protected static BDJLoaderAdapter getLoaderAdapter() {
         return loaderAdapter;
     }
 
     private static void loadAdapter(String pkg) {
         if (pkg == null)
             return;
+        if (pkg.indexOf(';') > 0) {
+            pkg = pkg.substring(0, pkg.indexOf(';'));
+        }
         try {
             final Object obj = Class.forName("org.videolan." + pkg + ".Adapter").newInstance();
-            if (obj instanceof BDJClassLoaderAdapter) {
-                loaderAdapter = (BDJClassLoaderAdapter)obj;
-            } else {
+            if (!((obj instanceof BDJClassLoaderAdapter) ||
+                  (obj instanceof BDJLoaderAdapter))) {
                 System.err.println("Unsupported interface in " + obj);
+                return;
             }
+            if (obj instanceof BDJLoaderAdapter) {
+                loaderAdapter = (BDJLoaderAdapter)obj;
+            }
+            if (obj instanceof BDJClassLoaderAdapter) {
+                classLoaderAdapter = (BDJClassLoaderAdapter)obj;
+            }
+        } catch (ClassNotFoundException ce) {
+            System.out.println("" + ce);  /* not really an error */
         } catch (Exception e) {
             System.err.println("" + e);
         }
@@ -252,6 +272,7 @@ public class Libbluray {
         boolean p5  = (profile & 0x10) != 0;
         boolean p6  = ((profile & 0x1f) == 0) && (version >= 0x0300);
 
+        resetProfile();
         if (!p6) {
             System.setProperty("bluray.profile.1", "YES");
             System.setProperty("bluray.p1.version.major", "1");
@@ -322,6 +343,8 @@ public class Libbluray {
 
         loadAdapter(System.getProperty("org.videolan.loader.adapter"));
         loadAdapter(pkg);
+
+        booted = true;
     }
 
     /* called only from native code */
@@ -362,7 +385,9 @@ public class Libbluray {
         synchronized (bdjoFilesLock) {
             bdjoFiles = null;
         }
+        classLoaderAdapter = null;
         loaderAdapter = null;
+        booted = false;
     }
 
     /*
@@ -549,7 +574,7 @@ public class Libbluray {
      */
 
     public static void writeGPR(int num, int value) {
-        int ret = writeGPRN(nativePointer, num, value);
+        int ret = writeRegN(nativePointer, 0, num, value, 0xffffffff);
 
         if (ret == -1)
             throw new IllegalArgumentException("Invalid GPR");
@@ -560,7 +585,7 @@ public class Libbluray {
     }
 
     public static void writePSR(int num, int value, int psr_value_mask) {
-        int ret = writePSRN(nativePointer, num, value, psr_value_mask);
+        int ret = writeRegN(nativePointer, 1, num, value, psr_value_mask);
 
         if (ret == -1)
             throw new IllegalArgumentException("Invalid PSR");
@@ -570,14 +595,14 @@ public class Libbluray {
         if (num < 0 || (num >= 4096))
             throw new IllegalArgumentException("Invalid GPR");
 
-        return readGPRN(nativePointer, num);
+        return readRegN(nativePointer, 0, num);
     }
 
     public static int readPSR(int num) {
         if (num < 0 || (num >= 128))
             throw new IllegalArgumentException("Invalid PSR");
 
-        return readPSRN(nativePointer, num);
+        return readRegN(nativePointer, 1, num);
     }
 
     /*
@@ -749,40 +774,6 @@ public class Libbluray {
     public  static final int BDJ_EVENT_UO_MASKED                = 17;
     private static final int BDJ_EVENT_MOUSE                    = 18;
 
-    /* TODO: use org/bluray/system/RegisterAccess instead */
-    public static final int PSR_IG_STREAM_ID     = 0;
-    public static final int PSR_PRIMARY_AUDIO_ID = 1;
-    public static final int PSR_PG_STREAM        = 2;
-    public static final int PSR_ANGLE_NUMBER     = 3;
-    public static final int PSR_TITLE_NUMBER     = 4;
-    public static final int PSR_CHAPTER          = 5;
-    public static final int PSR_PLAYLIST         = 6;
-    public static final int PSR_PLAYITEM         = 7;
-    public static final int PSR_TIME             = 8;
-    public static final int PSR_NAV_TIMER        = 9;
-    public static final int PSR_SELECTED_BUTTON_ID = 10;
-    public static final int PSR_MENU_PAGE_ID     = 11;
-    public static final int PSR_STYLE            = 12;
-    public static final int PSR_PARENTAL         = 13;
-    public static final int PSR_SECONDARY_AUDIO_VIDEO = 14;
-    public static final int PSR_AUDIO_CAP        = 15;
-    public static final int PSR_AUDIO_LANG       = 16;
-    public static final int PSR_PG_AND_SUB_LANG  = 17;
-    public static final int PSR_MENU_LANG        = 18;
-    public static final int PSR_COUNTRY          = 19;
-    public static final int PSR_REGION           = 20;
-    public static final int PSR_VIDEO_CAP        = 29;
-    public static final int PSR_TEXT_CAP         = 30;
-    public static final int PSR_PROFILE_VERSION  = 31;
-    public static final int PSR_BACKUP_PSR4      = 36;
-    public static final int PSR_BACKUP_PSR5      = 37;
-    public static final int PSR_BACKUP_PSR6      = 38;
-    public static final int PSR_BACKUP_PSR7      = 39;
-    public static final int PSR_BACKUP_PSR8      = 40;
-    public static final int PSR_BACKUP_PSR10     = 42;
-    public static final int PSR_BACKUP_PSR11     = 43;
-    public static final int PSR_BACKUP_PSR12     = 44;
-
     public static final int AACS_DISC_ID           = 1;
     public static final int AACS_MEDIA_VID         = 2;
     public static final int AACS_MEDIA_PMSN        = 3;
@@ -805,11 +796,9 @@ public class Libbluray {
     private static native void setKeyInterestN(long np, int mask);
     private static native long tellTimeN(long np);
     private static native int selectRateN(long np, float rate, int reason);
-    private static native int writeGPRN(long np, int num, int value);
-    private static native int writePSRN(long np, int num, int value, int psr_value_mask);
-    private static native int readGPRN(long np, int num);
+    private static native int writeRegN(long np, int is_psr, int num, int value, int psr_value_mask);
+    private static native int readRegN(long np, int is_psr, int num);
     private static native int setVirtualPackageN(long np, String vpPath, boolean psrBackup);
-    private static native int readPSRN(long np, int num);
     private static native int cacheBdRomFileN(long np, String path, String cachePath);
     private static native String[] listBdFilesN(long np, String path, boolean onlyBdRom);
     private static native Bdjo getBdjoN(long np, String name);
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010      William Hahne
- * Copyright (C) 2012-2014 Petri Hintukainen <phintuka@users.sourceforge.net>
+ * Copyright (C) 2012-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -138,18 +138,18 @@ public class Handler extends BDHandler {
                 int stream;
                 stream = sourceLocator.getPrimaryAudioStreamNumber();
                 if (stream > 0)
-                    Libbluray.writePSR(Libbluray.PSR_PRIMARY_AUDIO_ID, stream);
+                    Libbluray.writePSR(RegisterAccess.PSR_AUDIO_STN, stream);
                 stream = sourceLocator.getPGTextStreamNumber();
                 if (stream > 0) {
-                    Libbluray.writePSR(Libbluray.PSR_PG_STREAM, stream, 0x00000fff);
+                    Libbluray.writePSR(RegisterAccess.PSR_PG_TXTST_STN, stream, 0x00000fff);
                 }
                 stream = sourceLocator.getSecondaryVideoStreamNumber();
                 if (stream > 0) {
-                    Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream << 8, 0x0000ff00);
+                    Libbluray.writePSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN, stream << 8, 0x0000ff00);
                 }
                 stream = sourceLocator.getSecondaryAudioStreamNumber();
                 if (stream > 0) {
-                    Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream, 0x000000ff);
+                    Libbluray.writePSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN, stream, 0x000000ff);
                 }
 
                 int plId = sourceLocator.getPlayListId();
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2013-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -28,6 +29,7 @@ import org.bluray.media.PiPControl;
 import org.bluray.media.PiPStatusEvent;
 import org.bluray.media.PiPStatusListener;
 import org.bluray.media.StreamNotAvailableException;
+import org.bluray.system.RegisterAccess;
 import org.havi.ui.HScreenRectangle;
 
 import org.videolan.BDJListeners;
@@ -49,19 +51,19 @@ public class PiPControlImpl extends Vide
     }
 
     protected void setStreamNumber(int num) {
-        Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num << 8, 0x0000ff00);
+        Libbluray.writePSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN, num << 8, 0x0000ff00);
     }
 
     public int getCurrentStreamNumber() {
-        return (Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0x0000FF00) >> 8;
+        return (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN) & 0x0000FF00) >> 8;
     }
 
     public void setDisplay(boolean value) {
-        Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, value ? 0x80000000 : 0, 0x80000000);
+        Libbluray.writePSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN, value ? 0x80000000 : 0, 0x80000000);
     }
 
     public boolean getDisplay() {
-        return (Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0x80000000) != 0;
+        return (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN) & 0x80000000) != 0;
     }
 
     public void setFullScreen(boolean value) {
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryAudioControlImpl.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryAudioControlImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryAudioControlImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryAudioControlImpl.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2016-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,6 +21,8 @@
 package org.videolan.media.content.playlist;
 
 import org.bluray.media.PrimaryAudioControl;
+import org.bluray.system.RegisterAccess;
+
 import org.videolan.Libbluray;
 import org.videolan.StreamInfo;
 import org.videolan.TIClip;
@@ -37,15 +40,15 @@ public class PrimaryAudioControlImpl ext
     }
 
     protected String getDefaultLanguage() {
-        return languageFromInteger(Libbluray.readPSR(Libbluray.PSR_AUDIO_LANG));
+        return languageFromInteger(RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_LANG_CODE_AUDIO));
     }
 
     public int getCurrentStreamNumber() {
-        return Libbluray.readPSR(Libbluray.PSR_PRIMARY_AUDIO_ID);
+        return RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_AUDIO_STN);
     }
 
     protected void setStreamNumber(int num) {
-        Libbluray.writePSR(Libbluray.PSR_PRIMARY_AUDIO_ID, num);
+        Libbluray.writePSR(RegisterAccess.PSR_AUDIO_STN, num);
     }
 
     private Handler player;
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2014-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,6 +21,8 @@
 package org.videolan.media.content.playlist;
 
 import org.bluray.media.SecondaryAudioControl;
+import org.bluray.system.RegisterAccess;
+
 import org.videolan.Libbluray;
 import org.videolan.StreamInfo;
 import org.videolan.TIClip;
@@ -37,15 +40,15 @@ public class SecondaryAudioControlImpl e
     }
 
     protected String getDefaultLanguage() {
-        return languageFromInteger(Libbluray.readPSR(Libbluray.PSR_AUDIO_LANG));
+        return languageFromInteger(RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_LANG_CODE_AUDIO));
     }
 
     public int getCurrentStreamNumber() {
-        return Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0x000000FF;
+        return RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN) & 0x000000FF;
     }
 
     protected void setStreamNumber(int num) {
-        Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num, 0x000000ff);
+        Libbluray.writePSR(RegisterAccess.PSR_SECONDARY_AUDIO_STN, num, 0x000000ff);
     }
 
     private Handler player;
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2010  William Hahne
+ * Copyright (C) 2012-2019 Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -25,6 +26,7 @@ import org.bluray.media.StreamNotAvailab
 import org.bluray.media.SubtitleStyleNotAvailableException;
 import org.bluray.media.SubtitlingControl;
 import org.bluray.media.TextSubtitleNotAvailableException;
+import org.bluray.system.RegisterAccess;
 import org.bluray.ti.CodingType;
 import org.dvb.media.SubtitleAvailableEvent;
 import org.dvb.media.SubtitleListener;
@@ -49,24 +51,24 @@ public class SubtitlingControlImpl exten
     }
 
     protected String getDefaultLanguage() {
-        return languageFromInteger(Libbluray.readPSR(Libbluray.PSR_PG_AND_SUB_LANG));
+        return languageFromInteger(RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_LANG_CODE_PG_TXTST));
     }
 
     public int getCurrentStreamNumber() {
-        return Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x00000FFF;
+        return RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_PG_TXTST_STN) & 0x00000FFF;
     }
 
     protected void setStreamNumber(int num) {
-        Libbluray.writePSR(Libbluray.PSR_PG_STREAM, num, 0x00000fff);
+        Libbluray.writePSR(RegisterAccess.PSR_PG_TXTST_STN, num, 0x00000fff);
     }
 
     public boolean isSubtitlingOn() {
-        return (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x80000000) != 0;
+        return (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_PG_TXTST_STN) & 0x80000000) != 0;
     }
 
     public boolean setSubtitling(boolean mode) {
-        boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x80000000) != 0;
-        Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x80000000 : 0, 0x80000000);
+        boolean oldMode = (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_PG_TXTST_STN) & 0x80000000) != 0;
+        Libbluray.writePSR(RegisterAccess.PSR_PG_TXTST_STN, mode ? 0x80000000 : 0, 0x80000000);
         return oldMode;
     }
 
@@ -75,12 +77,12 @@ public class SubtitlingControlImpl exten
     }
 
     public boolean isPipSubtitleMode() {
-        return (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x40000000) != 0;
+        return (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_PG_TXTST_STN) & 0x40000000) != 0;
     }
 
     public boolean setPipSubtitleMode(boolean mode) {
-        boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x40000000) != 0;
-        Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x40000000 : 0, 0x40000000);
+        boolean oldMode = (RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_PG_TXTST_STN) & 0x40000000) != 0;
+        Libbluray.writePSR(RegisterAccess.PSR_PG_TXTST_STN, mode ? 0x40000000 : 0, 0x40000000);
         return oldMode;
     }
 
@@ -90,7 +92,7 @@ public class SubtitlingControlImpl exten
             throw new SubtitleStyleNotAvailableException();
         if (getCurrentSubtitleType() != CodingType.TEXT_SUBTITLE)
             throw new TextSubtitleNotAvailableException();
-        Libbluray.writePSR(Libbluray.PSR_STYLE, style);
+        Libbluray.writePSR(RegisterAccess.PSR_USER_STYLE_NR, style);
     }
 
     public CodingType getCurrentSubtitleType() {
@@ -107,7 +109,7 @@ public class SubtitlingControlImpl exten
         throws TextSubtitleNotAvailableException, SubtitleStyleNotAvailableException {
         if (getCurrentSubtitleType() != CodingType.TEXT_SUBTITLE)
             throw new TextSubtitleNotAvailableException();
-        int style = Libbluray.readPSR(Libbluray.PSR_STYLE);
+        int style = RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_USER_STYLE_NR);
         if ((style <= 0) || ((style > 25) && (style != 255)))
             throw new SubtitleStyleNotAvailableException();
         return style;
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/mmbd/Adapter.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/mmbd/Adapter.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/mmbd/Adapter.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/mmbd/Adapter.java	2019-02-12 07:45:08.000000000 +0000
@@ -34,6 +34,7 @@ import java.security.PrivilegedAction;
 
 import org.videolan.BDJClassFileTransformer;
 import org.videolan.BDJClassLoaderAdapter;
+import org.videolan.BDJXletContext;
 import org.videolan.Logger;
 
 import javax.media.ClockStartedError;
@@ -45,7 +46,7 @@ import javax.tv.xlet.XletContext;
 import javax.tv.xlet.XletStateChangeException;
 import org.bluray.bdplus.StatusListener;
 
-public class Adapter implements BDJClassLoaderAdapter {
+public class Adapter extends LoaderAdapter implements BDJClassLoaderAdapter {
 
     public Map getHideClasses() {
         return null;
@@ -60,6 +61,10 @@ public class Adapter implements BDJClass
     }
 
     public Adapter() throws ClassNotFoundException {
+
+        if (BDJXletContext.getCurrentContext() != null)
+            throw new ClassNotFoundException();
+
         /* relocate classes to avoid runtime package collisions */
 
         final String s1 = "org/videolan/mmbd/Adapter$Xlet";
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/mmbd/LoaderAdapter.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/mmbd/LoaderAdapter.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/mmbd/LoaderAdapter.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/mmbd/LoaderAdapter.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,113 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2018  VideoLAN
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package org.videolan.mmbd;
+
+import org.videolan.BDJXletContext;
+import org.videolan.BDJLoaderAdapter;
+import org.videolan.Logger;
+import org.videolan.StrUtil;
+import org.videolan.bdjo.AppEntry;
+
+public class LoaderAdapter implements BDJLoaderAdapter {
+
+    public LoaderAdapter() throws ClassNotFoundException {
+        if (BDJXletContext.getCurrentContext() != null)
+            throw new ClassNotFoundException();
+    }
+
+    public AppEntry[] patchAppTable(AppEntry[] in, int title) {
+        try {
+            return patchAppTable0(in, title);
+        } catch (Throwable t) {
+            logger.info("" + t);
+        }
+        return in;
+    }
+
+    private static long match(byte[] s, int m, long r) {
+        if ((r += (ll[m].length-(s.length+8)/9)) == 0) {
+            long[] a = new long[(s.length+8)/9];
+            for (int j = 0; j < s.length; j++)
+                a[j/9] |= (long)(s[j]&0x7f) << (7*(j%9));
+            for (int i = 0; i < a.length; i++)
+                r |= ll[m][i]-a[i];
+        }
+        return r;
+    }
+
+    private static AppEntry[] patchAppTable0(AppEntry[] in, int title) {
+
+        int i1, i2;
+        String xlet;
+
+        if (title != 65535)
+            return in;
+
+        for (i1 = 0; i1 < in.length; i1++) {
+            if (in[i1].getParams() != null &&
+                in[i1].getParams().length == 1 &&
+                in[i1].getControlCode() == AppEntry.AUTOSTART &&
+                match(in[i1].getInitialClass().getBytes(),0,0) == 0 &&
+                match(in[i1].getParams()[0].substring(0,9).getBytes(),1,0) == 0) {
+                break;
+            }
+        }
+        if (i1 == in.length)
+            return in;
+
+        xlet = "." + StrUtil.split(in[i1].getParams()[0], ':')[1];
+        for (i2 = 0; i2 < in.length; i2++) {
+            if (in[i2].getControlCode() == AppEntry.PRESENT &&
+                in[i2].getInitialClass().length() > xlet.length() &&
+                in[i2].getInitialClass().endsWith(xlet)) {
+                break;
+            }
+        }
+        if (i1 == in.length)
+            return in;
+
+        logger.info("Patching FirstPlay appTable for title Xlet " + in[i2].getInitialClass());
+        logger.info("Switching applications " +
+                    Integer.toHexString(in[i1].getIdentifier().getOID()) + "." +
+                    Integer.toHexString(in[i1].getIdentifier().getAID()) + " and " +
+                    Integer.toHexString(in[i2].getIdentifier().getOID()) + "." +
+                    Integer.toHexString(in[i2].getIdentifier().getAID()));
+
+        in = (AppEntry[])in.clone();
+
+        in[i1] = new AppEntry(in[i1]) {
+                public int getControlCode() {
+                    return AppEntry.PRESENT;
+                }
+            };
+        in[i2] = new AppEntry(in[i2]) {
+                public int getControlCode() {
+                    return AppEntry.AUTOSTART;
+                }
+            };
+
+        return in;
+    }
+
+    /* search array */
+    private static final long[][] ll = {{0x6fe58f0ed5db77e3l,0x64c4bb76fd3cf4f6l,0x64dd8642ee7d7670l,0x65d787473l},{0x3aa916658571212dl}};
+
+    private static final Logger logger = Logger.getLogger(LoaderAdapter.class.getName());
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/VFSCache.java 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/VFSCache.java
--- 1:1.0.2-3/src/libbluray/bdj/java/org/videolan/VFSCache.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java/org/videolan/VFSCache.java	2019-02-12 07:45:08.000000000 +0000
@@ -225,7 +225,7 @@ class VFSCache {
         // copy stream to tmp file in fontRoot. freetype can not read streams.
         File tmpFile = null;
         for (int i = 0; i < 100; i++) {
-            tmpFile = new File(fontRoot + System.nanoTime() + ".otf");
+            tmpFile = new File(fontRoot + Long.toHexString(System.nanoTime() + i) + ".otf");
             try {
                 tmpFile = new File(tmpFile.getCanonicalPath());
                 if (!tmpFile.exists()) {
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-build-support/java/awt/event/FocusEvent.java 1:1.1.0-1/src/libbluray/bdj/java-build-support/java/awt/event/FocusEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java-build-support/java/awt/event/FocusEvent.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-build-support/java/awt/event/FocusEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,63 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2019  libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package java.awt.event;
+
+import java.awt.Component;
+
+public class FocusEvent extends ComponentEvent {
+
+    /*
+     * Dummy class used during compilation
+     *
+     * This class is used at compile time to hide Java 8 / Java 9 differences in
+     * java.awt.peer.*, java.awt.FocusEvent and sun.awt.CausedFocusEvent.
+     *
+     * This allows compiling special version of BDFramePeer
+     * that will work both in Java < 9 and Java > 9.
+     * Correct methods and dependencies are automatically selected at run time,
+     * thanks to Java on-demand linking.
+     *
+     * NOTE:
+     * This class is not complete and should not be included at runtime.
+     *
+     */
+
+    static {
+        if (System.getProperty("does_not_exist") == null)
+            throw new Error("This class should not be included at run time");
+    }
+
+    public class /* enum */ Cause {
+    }
+
+    /* Needed when compiling for HaVi */
+    public static final int FOCUS_FIRST  = 1004;
+    public static final int FOCUS_LAST   = 1005;
+    public static final int FOCUS_GAINED = FOCUS_FIRST;
+    public static final int FOCUS_LOST   = 1 + FOCUS_FIRST;
+
+    public FocusEvent(Component src, int id, boolean t) {
+        super(src, id);
+    }
+
+    public FocusEvent(Component src, int id) {
+        super(src, id);
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-build-support/sun/awt/CausedFocusEvent.java 1:1.1.0-1/src/libbluray/bdj/java-build-support/sun/awt/CausedFocusEvent.java
--- 1:1.0.2-3/src/libbluray/bdj/java-build-support/sun/awt/CausedFocusEvent.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-build-support/sun/awt/CausedFocusEvent.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,53 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2019  libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package sun.awt;
+
+import java.awt.event.FocusEvent;
+import java.awt.Component;
+
+public class CausedFocusEvent extends FocusEvent {
+
+    /*
+     * Dummy class used during compilation
+     *
+     * This class is used at compile time to hide Java 8 / Java 9 differences in
+     * java.awt.peer.*, java.awt.FocusEvent and sun.awt.CausedFocusEvent.
+     *
+     * This allows compiling special version of BDFramePeer
+     * that will work both in Java < 9 and Java > 9.
+     * Correct methods and dependencies are automatically selected at run time,
+     * thanks to Java on-demand linking.
+     *
+     * NOTE:
+     * This class is not complete and should not be included at runtime.
+     *
+     */
+    static {
+        if (System.getProperty("does_not_exist") == null)
+            throw new Error("This class should not be included at run time");
+    }
+
+    public class /* enum */ Cause {
+    };
+
+    public CausedFocusEvent(Component src, int id) {
+        super(src, id);
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsDevice.java 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsDevice.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,26 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-class BDGraphicsDevice extends BDGraphicsDeviceImpl {
-
-    BDGraphicsDevice(BDGraphicsEnvironment environment) {
-        super(environment);
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/awt/BDImage.java 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/awt/BDImage.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/awt/BDImage.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/awt/BDImage.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,28 +0,0 @@
-/*
- * This file is part of libbluray
- * Copyright (C) 2012  libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-import sun.awt.image.BufferedImagePeer;
-
-public class BDImage extends BDImageBase implements BufferedImagePeer {
-    BDImage(Component component, int width, int height, GraphicsConfiguration gc) {
-        super(component, width, height, gc);
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/io/Closeable.java 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/io/Closeable.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/io/Closeable.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/io/Closeable.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,23 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.io;
-
-public interface Closeable {
-    public abstract void close() throws IOException;
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/io/FileInputStream.java 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/io/FileInputStream.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2me/java/io/FileInputStream.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2me/java/io/FileInputStream.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,142 @@
+/*
+ * This file is part of libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package java.io;
+
+
+import org.videolan.BDJLoader;
+import org.videolan.BDJXletContext;
+import org.videolan.Logger;
+
+public class FileInputStream extends InputStream
+{
+    private FileDescriptor fd;
+
+    private static Logger logger = null;
+
+    public FileInputStream(File file) throws FileNotFoundException {
+        String name = file != null ? file.getPath() : null;
+
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkRead(name);
+        }
+        if (name == null) {
+            throw new NullPointerException();
+        }
+
+        fd = new FileDescriptor();
+
+        if (file.isAbsolute()) {
+            String cachedName = BDJLoader.getCachedFile(name);
+            if (cachedName != name) {
+                synchronized (FileInputStream.class) {
+                if (logger == null) {
+                    logger = Logger.getLogger(FileInputStream.class.getName());
+                }
+                }
+                logger.info("Using cached " + cachedName + " for " + name);
+                name = cachedName;
+            }
+            open(name);
+        } else {
+            /* relative paths are problematic ... */
+            /* Those should be mapped to xlet home directory, which is inside .jar file. */
+
+            String home = BDJXletContext.getCurrentXletHome();
+            if (home == null) {
+                synchronized (FileInputStream.class) {
+                if (logger == null) {
+                    logger = Logger.getLogger(FileInputStream.class.getName());
+                }
+                }
+                logger.error("no home found for " + name + " at " + Logger.dumpStack());
+                throw new FileNotFoundException(name);
+            }
+            open(home + name);
+        }
+    }
+
+    public FileInputStream(String name) throws FileNotFoundException {
+        this(name != null ? new File(name) : null);
+    }
+
+    public FileInputStream(FileDescriptor fdObj) {
+        SecurityManager security = System.getSecurityManager();
+        if (fdObj == null) {
+            throw new NullPointerException();
+        }
+        if (security != null) {
+            security.checkRead(fdObj);
+        }
+        fd = fdObj;
+    }
+
+    private native int  readBytes(byte b[], int off, int len) throws IOException;
+    private native int  close0();
+    /* OpenJDK 6, OpenJDK 7, PhoneME, ... */
+    private native void open(String name) throws FileNotFoundException;
+
+    public  native int  read() throws IOException;
+    public  native long skip(long n) throws IOException;
+    public  native int  available() throws IOException;
+
+    public int read(byte b[]) throws IOException {
+        return read(b, 0, b.length);
+    }
+
+    public int read(byte b[], int off, int len) throws IOException {
+        if (b == null) {
+            throw new NullPointerException();
+        }
+        if (off < 0 || len < 0 || off > b.length || (off + len) > b.length || (off + len) < 0) {
+            throw new IndexOutOfBoundsException();
+        }
+
+        return readBytes(b, off, len);
+    }
+
+    public void close() throws IOException {
+        close0();
+    }
+
+    public final FileDescriptor getFD() throws IOException {
+        if (fd == null) {
+            throw new IOException();
+        }
+        return fd;
+    }
+
+    /* not in J2ME
+    public FileChannel getChannel() {}
+    */
+
+    private static native void initIDs();
+
+    static {
+        initIDs();
+    }
+
+    protected void finalize() throws IOException {
+        if (fd != null) {
+            if (fd != FileDescriptor.in) {
+                close();
+            }
+        }
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsDevice.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsDevice.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsDevice.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsDevice.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,33 +0,0 @@
-/*
- * This file is part of libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-class BDGraphicsDevice extends BDGraphicsDeviceImpl {
-
-    BDGraphicsDevice(BDGraphicsEnvironment environment) {
-        super(environment);
-    }
-
-    /* J2SE java 7 */
-    /*
-    public boolean isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency translucencyKind) {
-        return true;
-    }
-    */
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDImage.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDImage.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDImage.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDImage.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,28 +0,0 @@
-/*
- * This file is part of libbluray
- * Copyright (C) 2012  libbluray
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-package java.awt;
-
-import sun.awt.image.BufferedImagePeer;
-
-class BDImage extends BDImageBase implements BufferedImagePeer {
-    BDImage(Component component, int width, int height, GraphicsConfiguration gc) {
-        super(component, width, height, gc);
-    }
-}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java	2019-02-12 07:45:08.000000000 +0000
@@ -21,13 +21,23 @@
 package java.awt;
 
 import java.awt.peer.KeyboardFocusManagerPeer;
+import java.awt.peer.RobotPeer;
 
+import sun.awt.ComponentFactory;
 import sun.awt.KeyboardFocusManagerPeerProvider;
+import sun.awt.datatransfer.DataTransferer;
 
 import java.awt.peer.BDFramePeer;
 import java.awt.peer.BDKeyboardFocusManagerPeer;
 
-public class BDToolkit extends BDToolkitBase implements KeyboardFocusManagerPeerProvider {
+import org.videolan.GUIManager;
+import org.videolan.Logger;
+
+public class BDToolkit extends BDToolkitBase
+    implements KeyboardFocusManagerPeerProvider, ComponentFactory {
+
+    private static final Logger logger = Logger.getLogger(BDToolkit.class.getName());
+
     public BDToolkit () {
     }
 
@@ -62,92 +72,129 @@ public class BDToolkit extends BDToolkit
     }
 
     public void sync() {
-        org.videolan.GUIManager.getInstance().sync();
+        GUIManager.getInstance().sync();
     }
 
     public java.util.Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight h) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public  boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public  boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.FramePeer createFrame(Frame target) {
+    public java.awt.peer.FramePeer createFrame(Frame target) {
         return new BDFramePeer(target, (BDRootWindow)target);
     }
 
-    protected java.awt.peer.ButtonPeer createButton(Button target) {
+    public java.awt.peer.ButtonPeer createButton(Button target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.CanvasPeer createCanvas(Canvas target) {
+    public java.awt.peer.CanvasPeer createCanvas(Canvas target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.CheckboxPeer createCheckbox(Checkbox target) {
+    public java.awt.peer.CheckboxPeer createCheckbox(Checkbox target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
+    public java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.ChoicePeer createChoice(Choice target) {
+    public java.awt.peer.ChoicePeer createChoice(Choice target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.DesktopPeer createDesktopPeer(Desktop target) {
+    public java.awt.peer.DesktopPeer createDesktopPeer(Desktop target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.DialogPeer createDialog(Dialog target) {
+    public java.awt.peer.DialogPeer createDialog(Dialog target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public java.awt.dnd.peer.DragSourceContextPeer createDragSourceContextPeer(java.awt.dnd.DragGestureEvent dge) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public java.awt.peer.FileDialogPeer createFileDialog(FileDialog target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.LabelPeer createLabel(Label target) {
+    public java.awt.peer.LabelPeer createLabel(Label target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.ListPeer createList(List target) {
+    public java.awt.peer.ListPeer createList(List target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.MenuPeer createMenu(Menu target) {
+    public java.awt.peer.MenuPeer createMenu(Menu target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.MenuBarPeer createMenuBar(MenuBar target) {
+    public java.awt.peer.MenuBarPeer createMenuBar(MenuBar target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.MenuItemPeer createMenuItem(MenuItem target) {
+    public java.awt.peer.MenuItemPeer createMenuItem(MenuItem target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.PanelPeer createPanel(Panel target) {
+    public java.awt.peer.PanelPeer createPanel(Panel target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.PopupMenuPeer createPopupMenu(PopupMenu target) {
+    public java.awt.peer.PopupMenuPeer createPopupMenu(PopupMenu target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.ScrollbarPeer createScrollbar(Scrollbar target) {
+    public java.awt.peer.ScrollbarPeer createScrollbar(Scrollbar target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.ScrollPanePeer createScrollPane(ScrollPane target) {
+    public java.awt.peer.ScrollPanePeer createScrollPane(ScrollPane target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.TextAreaPeer createTextArea(TextArea target) {
+    public java.awt.peer.TextAreaPeer createTextArea(TextArea target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.TextFieldPeer createTextField(TextField target) {
+    public java.awt.peer.TextFieldPeer createTextField(TextField target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.WindowPeer createWindow(Window target) {
+    public java.awt.peer.WindowPeer createWindow(Window target) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public java.awt.datatransfer.Clipboard getSystemClipboard() {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
     public PrintJob getPrintJob(Frame frame, String jobtitle, java.util.Properties props)  {
+        logger.unimplemented();
+        throw new Error("Not implemented");
+    }
+    public java.awt.peer.FontPeer getFontPeer(String name, int style) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
-    protected java.awt.peer.FontPeer getFontPeer(String name, int style) {
+
+    /* required for Java < 9 */
+    public DataTransferer getDataTransferer() {
+        return null;
+    }
+    public RobotPeer createRobot(Robot target, GraphicsDevice screen) {
+        logger.unimplemented();
         throw new Error("Not implemented");
     }
+
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  * This file is part of libbluray
- * Copyright (C) 2012  Petri Hintukainen <phintuka@users.sourceforge.net>
+ * Copyright (C) 2012-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -173,7 +173,20 @@ public class BDFramePeer extends BDCompo
         return ((BDToolkit)BDToolkit.getDefaultToolkit()).createImage((Component)null, width, height);
     }
 
+    /* Java >= 9 */
+    public boolean requestFocus(Component c/*lightweightChild*/, boolean a/*temporary*/,
+                                boolean b/*focusedWindowChangeAllowed*/, long l/*time*/,
+                                java.awt.event.FocusEvent.Cause cause
+                                ) {
+        return requestFocusHelper(c, a, b, l);
+    }
+
+    /* Java < 9 */
     public boolean requestFocus(Component c, boolean a, boolean b, long l, sun.awt.CausedFocusEvent.Cause d) {
+        return requestFocusHelper(c, a, b, l);
+    }
+
+    private boolean requestFocusHelper(Component c, boolean a, boolean b, long l) {
         if (c == null) {
             return true;
         }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java	2019-02-12 07:45:08.000000000 +0000
@@ -38,4 +38,9 @@ class BDFileSystemImpl extends BDFileSys
     public long getSpace(File f, int t) {
         return fs.getSpace(f, t);
     }
+
+    /* Java 9 */
+    public int getNameMax(String path) {
+        return 255;
+    }
 }
diff -pruN 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/io/FileInputStream.java 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/io/FileInputStream.java
--- 1:1.0.2-3/src/libbluray/bdj/java-j2se/java/io/FileInputStream.java	1970-01-01 00:00:00.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/java-j2se/java/io/FileInputStream.java	2019-02-12 07:45:08.000000000 +0000
@@ -0,0 +1,304 @@
+/*
+ * This file is part of libbluray
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package java.io;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.videolan.BDJLoader;
+import org.videolan.BDJXletContext;
+import org.videolan.Logger;
+
+public class FileInputStream extends InputStream
+{
+    private FileDescriptor fd;
+
+    private final Object closeLock = new Object();
+    private volatile boolean closed = false;
+
+    private static Logger logger = null;
+
+    private int available = 0;
+
+    public FileInputStream(File file) throws FileNotFoundException {
+        String name = file != null ? file.getPath() : null;
+
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkRead(name);
+        }
+        if (name == null) {
+            throw new NullPointerException();
+        }
+
+        fd = new FileDescriptor();
+        fdAttach();
+
+        if (file.isAbsolute()) {
+            String cachedName = BDJLoader.getCachedFile(name);
+            if (cachedName != name) {
+                getLogger().info("Using cached " + cachedName + " for " + name);
+                name = cachedName;
+            }
+            openImpl(name);
+        } else {
+            /* relative paths are problematic ... */
+            /* Those should be mapped to xlet home directory, which is inside .jar file. */
+
+            String home = BDJXletContext.getCurrentXletHome();
+            if (home == null) {
+                getLogger().error("Xlet home directory not found for " + name + " at " + Logger.dumpStack());
+                throw new FileNotFoundException(name);
+            }
+            openImpl(home + name);
+        }
+
+        available = 1024;
+    }
+
+    public FileInputStream(String name) throws FileNotFoundException {
+        this(name != null ? new File(name) : null);
+    }
+
+    public FileInputStream(FileDescriptor fdObj) {
+        SecurityManager security = System.getSecurityManager();
+        if (fdObj == null) {
+            throw new NullPointerException();
+        }
+        if (security != null) {
+            security.checkRead(fdObj);
+        }
+        fd = fdObj;
+        available = 1024;
+        fdAttach();
+    }
+
+    /* open()/open0() wrapper to select correct native method at runtime */
+    private void openImpl(String name) throws FileNotFoundException {
+        try {
+            open(name);
+        } catch (UnsatisfiedLinkError e) {
+            /* OpenJDK 8 b40 */
+            open0(name);
+        }
+    }
+
+    private native int  readBytes(byte b[], int off, int len) throws IOException;
+    /* OpenJDK < 10 */
+    private native int  close0();
+    /* OpenJDK 6, OpenJDK 7, PhoneME, ... */
+    private native void open(String name) throws FileNotFoundException;
+    /* OpenJDK 8 */
+    private native void open0(String name) throws FileNotFoundException;
+
+    //public  native int  read() throws IOException;
+    //public  native long skip(long n) throws IOException;
+    //public  native int  available() throws IOException;
+
+    public int available() throws IOException {
+        return available;
+    }
+
+    public  int  read() throws IOException {
+        byte b[] = new byte[1];
+        if (read(b) == 1)
+            return b[0];
+        return -1;
+    }
+
+    public int read(byte b[]) throws IOException {
+        return read(b, 0, b.length);
+    }
+
+    public int read(byte b[], int off, int len) throws IOException {
+        if (b == null) {
+            throw new NullPointerException();
+        }
+        if (off < 0 || len < 0 || off > b.length || (off + len) > b.length || (off + len) < 0) {
+            throw new IndexOutOfBoundsException();
+        }
+
+        int r = readBytes(b, off, len);
+        if (r != len) {
+            available = 0;
+        }
+        return r;
+    }
+
+    public long skip(long n) throws IOException {
+        return super.skip(n);
+    }
+
+    public void close() throws IOException {
+        close(true);
+    }
+
+    private void close(boolean force) throws IOException {
+        synchronized (closeLock) {
+            if (closed) {
+                return;
+            }
+            closed = true;
+        }
+
+        available = 0;
+
+        fdClose(force);
+    }
+
+    public final FileDescriptor getFD() throws IOException {
+        if (fd == null) {
+            throw new IOException();
+        }
+        return fd;
+    }
+
+    /* not in J2SE
+    public FileChannel getChannel() {}
+    */
+
+    private static Logger getLogger() {
+        synchronized (FileInputStream.class) {
+            if (logger == null) {
+                logger = Logger.getLogger(FileInputStream.class.getName());
+            }
+        }
+        return logger;
+    }
+
+    private static native void initIDs();
+
+    static {
+        initIDs();
+    }
+
+    protected void finalize() throws IOException {
+        if (fd != null) {
+            if (fd != FileDescriptor.in) {
+                close(false);
+            }
+        }
+    }
+
+    /*
+     * compat layer
+     */
+
+    private boolean useFdCount = false;
+
+    private void fdAttach() {
+
+        /*
+         * Reflection fails at very early stage in JVM bootstrap.
+         * -> hide all errors in this function.
+         */
+        try {
+            try {
+                fd.getClass().getDeclaredMethod("attach", new Class[] { Closeable.class })
+                    .invoke(fd, new Object[] { (Object)this });
+                return;
+            } catch (NoSuchMethodException e) {
+                /* older RT libs */
+            }
+
+            try {
+                fd.getClass().getDeclaredMethod("incrementAndGetUseCount", new Class[0]).invoke((Object)fd, new Object[0]);
+                useFdCount = true;
+                return;
+            } catch (NoSuchMethodException e) {
+                getLogger().error("internal error in FileDescriptor usage");
+            }
+
+        } catch (Throwable t) {
+            if (logger != null)
+                logger.error("" + t);
+        }
+    }
+
+    private void closeImpl() throws IOException {
+
+        /* OpenJDK 10+ */
+        try {
+            fd.getClass().getDeclaredMethod("close", new Class[0])
+                .invoke(fd, new Object[0]);
+            return;
+        } catch (InvocationTargetException ite) {
+            Throwable t = ite.getTargetException();
+            getLogger().error("" + t);
+            if (t instanceof IOException) {
+                throw (IOException)t;
+            }
+            throw new IOException();
+        } catch (IllegalAccessException iae) {
+            getLogger().error("internal error in FileDescriptor usage: " + iae);
+            return;
+        } catch (NoSuchMethodException no_jdk10) {
+            /* JDK < 10 */
+        }
+
+        /* JDK < 10 */
+        try {
+            close0();
+        } catch (UnsatisfiedLinkError no_close0) {
+            getLogger().error("internal error in FileDescriptor usage: " + no_close0);
+        }
+    }
+
+    private void fdClose(boolean force) throws IOException {
+
+        try {
+
+            if (useFdCount) {
+                try {
+                    Integer i = (Integer) fd.getClass().getDeclaredMethod("decrementAndGetUseCount", new Class[0]).invoke((Object)fd, new Object[0]);
+                    if (i.intValue() > 0 && !force) {
+                        return;
+                    }
+                    closeImpl();
+                } catch (NoSuchMethodException no_method) {
+                    getLogger().error("internal error in FileDescriptor usage: " + no_method);
+                }
+                return;
+            }
+
+            try {
+                fd.getClass().getDeclaredMethod("closeAll", new Class[] { Closeable.class })
+                    .invoke(fd, new Object[] { (Object)
+                                               new Closeable() {
+                                                   public void close() throws IOException {
+                                                       closeImpl();
+                                                   }
+                                               }});
+                return;
+            } catch (NoSuchMethodException no_closeAll) {
+                getLogger().error("internal error in FileDescriptor usage: " + no_closeAll);
+            }
+
+        } catch (IllegalAccessException iae) {
+            getLogger().error("internal error in FileDescriptor usage: " + iae);
+            return;
+        } catch (InvocationTargetException ite) {
+            Throwable t = ite.getTargetException();
+            getLogger().error("" + t);
+            if (t instanceof IOException) {
+                throw (IOException)t;
+            }
+            throw new IOException();
+        }
+    }
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdj/native/org_videolan_Libbluray.c 1:1.1.0-1/src/libbluray/bdj/native/org_videolan_Libbluray.c
--- 1:1.0.2-3/src/libbluray/bdj/native/org_videolan_Libbluray.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/native/org_videolan_Libbluray.c	2019-02-12 07:45:08.000000000 +0000
@@ -349,46 +349,29 @@ JNIEXPORT jint JNICALL Java_org_videolan
     return 1;
 }
 
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeGPRN(JNIEnv * env,
-        jclass cls, jlong np, jint num, jint value) {
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readRegN(JNIEnv * env,
+        jclass cls, jlong np, jint is_psr, jint num) {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
+    int value = bd_reg_read(bd, is_psr, num);
 
-    BD_DEBUG(DBG_JNI, "writeGPRN(%d,%d)\n", (int)num, (int)value);
-
-    return bd_reg_write(bd, 0, num, value, ~0);
-}
-
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readGPRN(JNIEnv * env,
-        jclass cls, jlong np, jint num) {
-    BLURAY* bd = (BLURAY*)(intptr_t)np;
-    int value = bd_reg_read(bd, 0, num);
-
-    BD_DEBUG(DBG_JNI, "readGPRN(%d) -> %d\n", (int)num, (int)value);
+    BD_DEBUG(DBG_JNI, "readRegN(%s_%d) -> %d\n", is_psr ? "PSR" : "GPR", (int)num, (int)value);
 
     return value;
 }
 
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN(JNIEnv * env,
-        jclass cls, jlong np, jint num, jint value, jint mask) {
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeRegN(JNIEnv * env,
+        jclass cls, jlong np, jint is_psr, jint num, jint value, jint mask) {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
 
     if ((uint32_t)mask == 0xffffffff) {
-        BD_DEBUG(DBG_JNI, "writePSRN(%d,%d)\n", (int)num, (int)value);
+        BD_DEBUG(DBG_JNI, "writeRegN(%s_%d,%d)\n",
+                 is_psr ? "PSR" : "GPR", (int)num, (int)value);
     } else {
-        BD_DEBUG(DBG_JNI, "writePSRN(%d,0x%x,0x%08x)\n", (int)num, (int)value, (int)mask);
+        BD_DEBUG(DBG_JNI, "writeRegN(%s_%d,0x%x,0x%08x)\n",
+                 is_psr ? "PSR" : "GPR", (int)num, (int)value, (int)mask);
     }
 
-    return bd_reg_write(bd, 1, num, value, mask);
-}
-
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN(JNIEnv * env,
-        jclass cls, jlong np, jint num) {
-    BLURAY* bd = (BLURAY*)(intptr_t)np;
-    int value = bd_reg_read(bd, 1, num);
-
-    BD_DEBUG(DBG_JNI, "readPSRN(%d) -> %d\n", (int)num, (int)value);
-
-    return value;
+    return bd_reg_write(bd, is_psr, num, value, mask);
 }
 
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_cacheBdRomFileN(JNIEnv * env,
@@ -724,24 +707,14 @@ Java_org_videolan_Libbluray_methods[] =
         VC(Java_org_videolan_Libbluray_selectRateN),
     },
     {
-        CC("writeGPRN"),
-        CC("(JII)I"),
-        VC(Java_org_videolan_Libbluray_writeGPRN),
+        CC("writeRegN"),
+        CC("(JIIII)I"),
+        VC(Java_org_videolan_Libbluray_writeRegN),
     },
     {
-        CC("writePSRN"),
-        CC("(JIII)I"),
-        VC(Java_org_videolan_Libbluray_writePSRN),
-    },
-    {
-        CC("readGPRN"),
-        CC("(JI)I"),
-        VC(Java_org_videolan_Libbluray_readGPRN),
-    },
-    {
-        CC("readPSRN"),
-        CC("(JI)I"),
-        VC(Java_org_videolan_Libbluray_readPSRN),
+        CC("readRegN"),
+        CC("(JII)I"),
+        VC(Java_org_videolan_Libbluray_readRegN),
     },
     {
         CC("cacheBdRomFileN"),
diff -pruN 1:1.0.2-3/src/libbluray/bdj/native/org_videolan_Libbluray.h 1:1.1.0-1/src/libbluray/bdj/native/org_videolan_Libbluray.h
--- 1:1.0.2-3/src/libbluray/bdj/native/org_videolan_Libbluray.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdj/native/org_videolan_Libbluray.h	2019-02-12 07:45:08.000000000 +0000
@@ -206,35 +206,19 @@ JNIEXPORT jint JNICALL Java_org_videolan
 
 /*
  * Class:     org_videolan_Libbluray
- * Method:    writeGPRN
- * Signature: (JII)I
- */
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeGPRN
-  (JNIEnv *, jclass, jlong, jint, jint);
-
-/*
- * Class:     org_videolan_Libbluray
- * Method:    writePSRN
- * Signature: (JIII)I
+ * Method:    writeRegN
+ * Signature: (JIIII)I
  */
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN
-  (JNIEnv *, jclass, jlong, jint, jint, jint);
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeRegN
+(JNIEnv *, jclass, jlong, jint, jint, jint, jint);
 
 /*
  * Class:     org_videolan_Libbluray
- * Method:    readGPRN
- * Signature: (JI)I
- */
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readGPRN
-  (JNIEnv *, jclass, jlong, jint);
-
-/*
- * Class:     org_videolan_Libbluray
- * Method:    readPSRN
- * Signature: (JI)I
+ * Method:    readRegN
+ * Signature: (JII)I
  */
-JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN
-  (JNIEnv *, jclass, jlong, jint);
+JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readRegN
+  (JNIEnv *, jclass, jlong, jint, jint);
 
 /*
  * Class:     org_videolan_Libbluray
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/bdmv_parse.c 1:1.1.0-1/src/libbluray/bdnav/bdmv_parse.c
--- 1:1.0.2-3/src/libbluray/bdnav/bdmv_parse.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/bdmv_parse.c	2019-02-12 07:45:08.000000000 +0000
@@ -59,6 +59,7 @@ int bdmv_parse_header(BITSTREAM *bs, uin
     switch (ver) {
         case BDMV_VERSION_0100:
         case BDMV_VERSION_0200:
+        case BDMV_VERSION_0240:
         case BDMV_VERSION_0300:
             break;
         default:
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/bdmv_parse.h 1:1.1.0-1/src/libbluray/bdnav/bdmv_parse.h
--- 1:1.0.2-3/src/libbluray/bdnav/bdmv_parse.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/bdmv_parse.h	2019-02-12 07:45:08.000000000 +0000
@@ -27,6 +27,7 @@
 
 #define BDMV_VERSION_0100 ('0' << 24 | '1' << 16 | '0' << 8 | '0')
 #define BDMV_VERSION_0200 ('0' << 24 | '2' << 16 | '0' << 8 | '0')
+#define BDMV_VERSION_0240 ('0' << 24 | '2' << 16 | '4' << 8 | '0')
 #define BDMV_VERSION_0300 ('0' << 24 | '3' << 16 | '0' << 8 | '0')
 
 BD_PRIVATE int bdmv_parse_header(BITSTREAM *bs, uint32_t type, uint32_t *version);
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/clpi_parse.c 1:1.1.0-1/src/libbluray/bdnav/clpi_parse.c
--- 1:1.0.2-3/src/libbluray/bdnav/clpi_parse.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/clpi_parse.c	2019-02-12 07:45:08.000000000 +0000
@@ -23,6 +23,7 @@
 #endif
 
 #include "clpi_parse.h"
+#include "clpi_data.h"
 
 #include "extdata_parse.h"
 #include "bdmv_parse.h"
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/clpi_parse.h 1:1.1.0-1/src/libbluray/bdnav/clpi_parse.h
--- 1:1.0.2-3/src/libbluray/bdnav/clpi_parse.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/clpi_parse.h	2019-02-12 07:45:08.000000000 +0000
@@ -20,19 +20,21 @@
 #if !defined(_CLPI_PARSE_H_)
 #define _CLPI_PARSE_H_
 
-#include "clpi_data.h"
 #include "util/attributes.h"
 
 #include <stdint.h>
 
+struct clpi_cl;
 struct bd_disc;
 
-BD_PRIVATE uint32_t clpi_find_stc_spn(const CLPI_CL *cl, uint8_t stc_id);
-BD_PRIVATE uint32_t clpi_lookup_spn(const CLPI_CL *cl, uint32_t timestamp, int before, uint8_t stc_id);
-BD_PRIVATE uint32_t clpi_access_point(const CLPI_CL *cl, uint32_t pkt, int next, int angle_change, uint32_t *time);
-BD_PRIVATE CLPI_CL* clpi_parse(const char *path) BD_ATTR_MALLOC;
-BD_PRIVATE CLPI_CL* clpi_get(struct bd_disc *disc, const char *file);
-BD_PRIVATE CLPI_CL* clpi_copy(const CLPI_CL* src_cl);
-BD_PRIVATE void clpi_free(CLPI_CL **cl);
+BD_PRIVATE struct clpi_cl* clpi_parse(const char *path);
+BD_PRIVATE struct clpi_cl* clpi_get(struct bd_disc *disc, const char *file);
+BD_PRIVATE struct clpi_cl* clpi_copy(const struct clpi_cl* src_cl);
+BD_PRIVATE void clpi_free(struct clpi_cl **cl);
+
+BD_PRIVATE uint32_t clpi_find_stc_spn(const struct clpi_cl *cl, uint8_t stc_id);
+BD_PRIVATE uint32_t clpi_lookup_spn(const struct clpi_cl *cl, uint32_t timestamp, int before, uint8_t stc_id);
+BD_PRIVATE uint32_t clpi_access_point(const struct clpi_cl *cl, uint32_t pkt, int next, int angle_change, uint32_t *time);
+
 
 #endif // _CLPI_PARSE_H_
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/index_parse.c 1:1.1.0-1/src/libbluray/bdnav/index_parse.c
--- 1:1.0.2-3/src/libbluray/bdnav/index_parse.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/index_parse.c	2019-02-12 07:45:08.000000000 +0000
@@ -105,8 +105,14 @@ static int _parse_index(BITSTREAM *bs, I
 
     index->num_titles = bs_read(bs, 16);
     if (!index->num_titles) {
-        BD_DEBUG(DBG_CRIT, "empty index\n");
-        return 0;
+        /* no "normal" titles - check for first play and top menu */
+        if ((index->first_play.object_type == indx_object_type_hdmv && index->first_play.hdmv.id_ref == 0xffff) &&
+            (index->top_menu.object_type == indx_object_type_hdmv && index->top_menu.hdmv.id_ref == 0xffff)) {
+
+            BD_DEBUG(DBG_CRIT, "empty index\n");
+            return 0;
+        }
+        return 1;
     }
 
     index->titles = calloc(index->num_titles, sizeof(INDX_TITLE));
@@ -189,6 +195,55 @@ static int _parse_header(BITSTREAM *bs,
     return 1;
 }
 
+static int _parse_indx_extension_hevc(BITSTREAM *bs, INDX_ROOT *index)
+{
+  uint32_t len;
+  unsigned unk0, unk1, unk2, unk3, unk4;
+
+  len = bs_read(bs, 32);
+  if (len < 8) {
+      BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unsupported extension 3.1 length (%d)\n", len);
+      return 0;
+  }
+
+  index->disc_type     = bs_read(bs, 4);
+  unk0                 = bs_read(bs, 3);
+  index->exist_4k_flag = bs_read(bs, 1);
+  unk1                 = bs_read(bs, 8);
+  unk2                 = bs_read(bs, 6);
+  index->hdr_flags     = bs_read(bs, 2);
+  unk3                 = bs_read(bs, 8);
+  unk4                 = bs_read(bs, 32);
+
+  BD_DEBUG(DBG_NAV, "UHD disc type: %d, 4k: %d, HDR: %d\n",
+           index->disc_type, index->exist_4k_flag, index->hdr_flags);
+
+  if (unk0 | unk1 | unk2 | unk3 | unk4) {
+      BD_DEBUG(DBG_CRIT|DBG_NAV,
+               "index.bdmv: unknown data in extension 3.1: "
+               "0x%02x 0x%02x 0x%02x 0x%02x 0x%08x\n", unk0, unk1, unk2, unk3, unk4);
+  }
+
+  return 1;
+}
+
+static int
+_parse_indx_extension(BITSTREAM *bits, int id1, int id2, void *handle)
+{
+    INDX_ROOT *index = (INDX_ROOT *)handle;
+    (void)bits;
+
+    if (id1 == 3) {
+        if (id2 == 1) {
+            return _parse_indx_extension_hevc(bits, index);
+        }
+    }
+
+    BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_indx_extension(): unknown extension %d.%d\n", id1, id2);
+
+    return 0;
+}
+
 static INDX_ROOT *_indx_parse(BD_FILE_H *fp)
 {
     BITSTREAM  bs;
@@ -224,7 +279,10 @@ static INDX_ROOT *_indx_parse(BD_FILE_H
     }
 
     if (extension_data_start) {
-        BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown extension data at %u\n", (unsigned)extension_data_start);
+        bdmv_parse_extension_data(&bs,
+                                  extension_data_start,
+                                  _parse_indx_extension,
+                                  index);
     }
 
     return index;
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/index_parse.h 1:1.1.0-1/src/libbluray/bdnav/index_parse.h
--- 1:1.0.2-3/src/libbluray/bdnav/index_parse.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/index_parse.h	2019-02-12 07:45:08.000000000 +0000
@@ -114,6 +114,11 @@ typedef struct indx_root_s {
     INDX_TITLE    *titles;
 
     uint32_t       indx_version;
+
+    /* UHD extension */
+    uint8_t        disc_type;
+    uint8_t        exist_4k_flag;
+    uint8_t        hdr_flags;
 } INDX_ROOT;
 
 
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/mpls_data.h 1:1.1.0-1/src/libbluray/bdnav/mpls_data.h
--- 1:1.0.2-3/src/libbluray/bdnav/mpls_data.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/mpls_data.h	2019-02-12 07:45:08.000000000 +0000
@@ -107,6 +107,7 @@ typedef struct
     uint8_t         random_access_flag;
     uint8_t         audio_mix_flag;
     uint8_t         lossless_bypass_flag;
+    uint8_t         mvc_base_view_r_flag;
 } MPLS_AI;
 
 typedef struct
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/mpls_parse.c 1:1.1.0-1/src/libbluray/bdnav/mpls_parse.c
--- 1:1.0.2-3/src/libbluray/bdnav/mpls_parse.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/mpls_parse.c	2019-02-12 07:45:08.000000000 +0000
@@ -26,6 +26,7 @@
 
 #include "extdata_parse.h"
 #include "bdmv_parse.h"
+#include "mpls_data.h"
 #include "uo_mask.h"
 
 #include "disc/disc.h"
@@ -77,9 +78,10 @@ _parse_appinfo(BITSTREAM *bits, MPLS_AI
     ai->random_access_flag = bs_read(bits, 1);
     ai->audio_mix_flag = bs_read(bits, 1);
     ai->lossless_bypass_flag = bs_read(bits, 1);
+    ai->mvc_base_view_r_flag = bs_read(bits, 1);
 #if 0
     // Reserved
-    bs_skip(bits, 13);
+    bs_skip(bits, 12);
     bs_seek_byte(bits, pos + len);
 #endif
     return 1;
@@ -980,6 +982,14 @@ _parse_mpls_extension(BITSTREAM *bits, i
         }
     }
 
+    if (id1 == 3) {
+        if (id2 == 5) {
+            // UHD extension
+            BD_DEBUG(DBG_NAV, "_parse_mpls_extension(): unhandled extension %d.%d\n", id1, id2);
+            return 0;
+        }
+    }
+
     BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_mpls_extension(): unhandled extension %d.%d\n", id1, id2);
 
     return 0;
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/mpls_parse.h 1:1.1.0-1/src/libbluray/bdnav/mpls_parse.h
--- 1:1.0.2-3/src/libbluray/bdnav/mpls_parse.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/mpls_parse.h	2019-02-12 07:45:08.000000000 +0000
@@ -21,17 +21,15 @@
 #if !defined(_MPLS_PARSE_H_)
 #define _MPLS_PARSE_H_
 
-#include "mpls_data.h"
-#include "uo_mask_table.h"
-
 #include "util/attributes.h"
 
 #include <stdint.h>
 
 struct bd_disc;
+struct mpls_pl;
 
-BD_PRIVATE MPLS_PL* mpls_parse(const char *path) BD_ATTR_MALLOC;
-BD_PRIVATE MPLS_PL* mpls_get(struct bd_disc *disc, const char *file);
-BD_PRIVATE void mpls_free(MPLS_PL **pl);
+BD_PRIVATE struct mpls_pl *mpls_parse(const char *path);
+BD_PRIVATE struct mpls_pl *mpls_get(struct bd_disc *disc, const char *file);
+BD_PRIVATE void mpls_free(struct mpls_pl **pl);
 
 #endif // _MPLS_PARSE_H_
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/navigation.c 1:1.1.0-1/src/libbluray/bdnav/navigation.c
--- 1:1.0.2-3/src/libbluray/bdnav/navigation.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/navigation.c	2019-02-12 07:45:08.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * This file is part of libbluray
  * Copyright (C) 2009-2010  John Stebbins
- * Copyright (C) 2010-2016  Petri Hintukainen
+ * Copyright (C) 2010-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -25,7 +25,9 @@
 #include "navigation.h"
 
 #include "clpi_parse.h"
+#include "clpi_data.h"
 #include "mpls_parse.h"
+#include "mpls_data.h"
 #include "bdparse.h"
 
 #include "disc/disc.h"
@@ -43,11 +45,11 @@
  */
 
 static uint32_t
-_pl_duration(MPLS_PL *pl)
+_pl_duration(const MPLS_PL *pl)
 {
     unsigned ii;
     uint32_t duration = 0;
-    MPLS_PI *pi;
+    const MPLS_PI *pi;
 
     for (ii = 0; ii < pl->list_count; ii++) {
         pi = &pl->play_item[ii];
@@ -57,7 +59,7 @@ _pl_duration(MPLS_PL *pl)
 }
 
 static uint32_t
-_pl_chapter_count(MPLS_PL *pl)
+_pl_chapter_count(const MPLS_PL *pl)
 {
     unsigned ii, chapters = 0;
 
@@ -71,11 +73,30 @@ _pl_chapter_count(MPLS_PL *pl)
     return chapters;
 }
 
+static uint32_t
+_pl_streams_score(const MPLS_PL *pl)
+{
+    const MPLS_PI *pi;
+    uint32_t i_num_audio = 0;
+    uint32_t i_num_pg = 0;
+
+    for (int ii = 0; ii < pl->list_count; ii++) {
+        pi = &pl->play_item[ii];
+        if(pi->stn.num_audio > i_num_audio)
+            i_num_audio= pi->stn.num_audio;
+
+        if(pi->stn.num_pg > i_num_pg)
+            i_num_pg = pi->stn.num_pg;
+    }
+
+    return i_num_audio * 2 + i_num_pg;
+}
+
 /*
  * Check if two playlists are the same
  */
 
-static int _stream_cmp(MPLS_STREAM *a, MPLS_STREAM *b)
+static int _stream_cmp(const MPLS_STREAM *a, const MPLS_STREAM *b)
 {
     if (a->stream_type == b->stream_type &&
         a->coding_type == b->coding_type &&
@@ -91,7 +112,7 @@ static int _stream_cmp(MPLS_STREAM *a, M
     return 1;
 }
 
-static int _streams_cmp(MPLS_STREAM *s1, MPLS_STREAM *s2, unsigned count)
+static int _streams_cmp(const MPLS_STREAM *s1, const MPLS_STREAM *s2, unsigned count)
 {
     unsigned ii;
     for (ii = 0; ii < count; ii++) {
@@ -102,7 +123,7 @@ static int _streams_cmp(MPLS_STREAM *s1,
     return 0;
 }
 
-static int _pi_cmp(MPLS_PI *pi1, MPLS_PI *pi2)
+static int _pi_cmp(const MPLS_PI *pi1, const MPLS_PI *pi2)
 {
     if (memcmp(pi1->clip[0].clip_id, pi2->clip[0].clip_id, 5) != 0 ||
         pi1->in_time != pi2->in_time ||
@@ -131,7 +152,7 @@ static int _pi_cmp(MPLS_PI *pi1, MPLS_PI
     return 0;
 }
 
-static int _pm_cmp(MPLS_PLM *pm1, MPLS_PLM *pm2)
+static int _pm_cmp(const MPLS_PLM *pm1, const MPLS_PLM *pm2)
 {
     if (pm1->mark_type     == pm2->mark_type     &&
         pm1->play_item_ref == pm2->play_item_ref &&
@@ -144,7 +165,7 @@ static int _pm_cmp(MPLS_PLM *pm1, MPLS_P
     return 1;
 }
 
-static int _pl_cmp(MPLS_PL *pl1, MPLS_PL *pl2)
+static int _pl_cmp(const MPLS_PL *pl1, const MPLS_PL *pl2)
 {
     unsigned ii;
 
@@ -180,7 +201,7 @@ static int _pl_cmp(MPLS_PL *pl1, MPLS_PL
  */
 
 /* return 0 if duplicate playlist */
-static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl)
+static int _filter_dup(MPLS_PL *pl_list[], unsigned count, const MPLS_PL *pl)
 {
     unsigned ii;
 
@@ -193,12 +214,12 @@ static int _filter_dup(MPLS_PL *pl_list[
 }
 
 static unsigned int
-_find_repeats(MPLS_PL *pl, const char *m2ts, uint32_t in_time, uint32_t out_time)
+_find_repeats(const MPLS_PL *pl, const char *m2ts, uint32_t in_time, uint32_t out_time)
 {
     unsigned ii, count = 0;
 
     for (ii = 0; ii < pl->list_count; ii++) {
-        MPLS_PI *pi;
+        const MPLS_PI *pi;
 
         pi = &pl->play_item[ii];
         // Ignore titles with repeated segments
@@ -212,12 +233,12 @@ _find_repeats(MPLS_PL *pl, const char *m
 }
 
 static int
-_filter_repeats(MPLS_PL *pl, unsigned repeats)
+_filter_repeats(const MPLS_PL *pl, unsigned repeats)
 {
     unsigned ii;
 
     for (ii = 0; ii < pl->list_count; ii++) {
-      MPLS_PI *pi;
+      const MPLS_PI *pi;
 
       pi = &pl->play_item[ii];
       // Ignore titles with repeated segments
@@ -234,27 +255,32 @@ _filter_repeats(MPLS_PL *pl, unsigned re
 
 #define DBG_MAIN_PL DBG_NAV
 
-static void _video_props(MPLS_STN *s, int *full_hd, int *mpeg12)
+static void _video_props(const MPLS_STN *s, int *format, int *codec)
 {
     unsigned ii;
-    *mpeg12 = 1;
-    *full_hd = 0;
+    *codec = 0;
+    *format = 0;
     for (ii = 0; ii < s->num_video; ii++) {
         if (s->video[ii].coding_type > 4) {
-            *mpeg12 = 0;
+            if (*codec < 1) {
+                *codec = 1;
+            }
+        }
+        if (s->video[ii].coding_type == BD_STREAM_TYPE_VIDEO_HEVC) {
+            *codec = 2;
         }
         if (s->video[ii].format == BD_VIDEO_FORMAT_1080I || s->video[ii].format == BD_VIDEO_FORMAT_1080P) {
-            if (*full_hd < 1) {
-                *full_hd = 1;
+            if (*format < 1) {
+                *format = 1;
             }
         }
         if (s->video[ii].format == BD_VIDEO_FORMAT_2160P) {
-            *full_hd = 2;
+            *format = 2;
         }
     }
 }
 
-static void _audio_props(MPLS_STN *s, int *hd_audio)
+static void _audio_props(const MPLS_STN *s, int *hd_audio)
 {
     unsigned ii;
     *hd_audio = 0;
@@ -267,25 +293,25 @@ static void _audio_props(MPLS_STN *s, in
 
 static int _cmp_video_props(const MPLS_PL *p1, const MPLS_PL *p2)
 {
-    MPLS_STN *s1 = &p1->play_item[0].stn;
-    MPLS_STN *s2 = &p2->play_item[0].stn;
-    int fhd1, fhd2, mp12_1, mp12_2;
+    const MPLS_STN *s1 = &p1->play_item[0].stn;
+    const MPLS_STN *s2 = &p2->play_item[0].stn;
+    int format1, format2, codec1, codec2;
 
-    _video_props(s1, &fhd1, &mp12_1);
-    _video_props(s2, &fhd2, &mp12_2);
+    _video_props(s1, &format1, &codec1);
+    _video_props(s2, &format2, &codec2);
 
     /* prefer UHD over FHD over HD/SD */
-    if (fhd1 != fhd2)
-        return fhd2 - fhd1;
+    if (format1 != format2)
+        return format2 - format1;
 
-    /* prefer H.264/VC1 over MPEG1/2 */
-    return mp12_2 - mp12_1;
+    /* prefer H.265 over H.264/VC1 over MPEG1/2 */
+    return codec2 - codec1;
 }
 
 static int _cmp_audio_props(const MPLS_PL *p1, const MPLS_PL *p2)
 {
-    MPLS_STN *s1 = &p1->play_item[0].stn;
-    MPLS_STN *s2 = &p2->play_item[0].stn;
+    const MPLS_STN *s1 = &p1->play_item[0].stn;
+    const MPLS_STN *s2 = &p2->play_item[0].stn;
     int hda1, hda2;
 
     _audio_props(s1, &hda1);
@@ -295,7 +321,7 @@ static int _cmp_audio_props(const MPLS_P
     return hda2 - hda1;
 }
 
-static int _pl_guess_main_title(MPLS_PL *p1, MPLS_PL *p2,
+static int _pl_guess_main_title(const MPLS_PL *p1, const MPLS_PL *p2,
                                 const char *mpls_id1, const char *mpls_id2,
                                 const char *known_mpls_ids)
 {
@@ -353,7 +379,10 @@ static int _pl_guess_main_title(MPLS_PL
         return -1;
     }
 
-    return 0;
+    /* prefer playlist with higher number of tracks */
+    int sc1 = _pl_streams_score(p1);
+    int sc2 = _pl_streams_score(p2);
+    return sc2 - sc1;
 }
 
 /*
@@ -505,12 +534,12 @@ uint8_t nav_lookup_aspect(NAV_CLIP *clip
 }
 
 static void
-_fill_mark(NAV_TITLE *title, NAV_MARK *mark, int entry)
+_fill_mark(const NAV_TITLE *title, NAV_MARK *mark, int entry)
 {
-    MPLS_PL *pl = title->pl;
-    MPLS_PLM *plm;
-    MPLS_PI *pi;
-    NAV_CLIP *clip;
+    const MPLS_PL *pl = title->pl;
+    const MPLS_PLM *plm;
+    const MPLS_PI *pi;
+    const NAV_CLIP *clip;
 
     plm = &pl->play_mark[entry];
 
@@ -540,9 +569,9 @@ _extrapolate_title(NAV_TITLE *title)
     uint32_t duration = 0;
     uint32_t pkt = 0;
     unsigned ii, jj;
-    MPLS_PL *pl = title->pl;
-    MPLS_PI *pi;
-    MPLS_PLM *plm;
+    const MPLS_PL *pl = title->pl;
+    const MPLS_PI *pi;
+    const MPLS_PLM *plm;
     NAV_MARK *mark, *prev = NULL;
     NAV_CLIP *clip;
 
@@ -592,9 +621,9 @@ _extrapolate_title(NAV_TITLE *title)
 }
 
 static void _fill_clip(NAV_TITLE *title,
-                       MPLS_CLIP *mpls_clip,
+                       const MPLS_CLIP *mpls_clip,
                        uint8_t connection_condition, uint32_t in_time, uint32_t out_time,
-                       unsigned pi_angle_count,
+                       unsigned pi_angle_count, unsigned still_mode, unsigned still_time,
                        NAV_CLIP *clip,
                        unsigned ref, uint32_t *pos, uint32_t *time)
 
@@ -603,6 +632,8 @@ static void _fill_clip(NAV_TITLE *title,
 
     clip->title = title;
     clip->ref   = ref;
+    clip->still_mode = still_mode;
+    clip->still_time = still_time;
 
     if (title->angle >= pi_angle_count) {
         clip->angle = 0;
@@ -655,6 +686,44 @@ static void _fill_clip(NAV_TITLE *title,
     clip->stc_spn = clpi_find_stc_spn(clip->cl, mpls_clip[clip->angle].stc_id);
 }
 
+static
+void _nav_title_close(NAV_TITLE *title)
+{
+    unsigned ii, ss;
+
+    if (title->sub_path) {
+        for (ss = 0; ss < title->sub_path_count; ss++) {
+            if (title->sub_path[ss].clip_list.clip) {
+                for (ii = 0; ii < title->sub_path[ss].clip_list.count; ii++) {
+                    clpi_free(&title->sub_path[ss].clip_list.clip[ii].cl);
+                }
+                X_FREE(title->sub_path[ss].clip_list.clip);
+            }
+        }
+        X_FREE(title->sub_path);
+    }
+
+    if (title->clip_list.clip) {
+        for (ii = 0; ii < title->clip_list.count; ii++) {
+            clpi_free(&title->clip_list.clip[ii].cl);
+        }
+        X_FREE(title->clip_list.clip);
+    }
+
+    mpls_free(&title->pl);
+    X_FREE(title->chap_list.mark);
+    X_FREE(title->mark_list.mark);
+    X_FREE(title);
+}
+
+void nav_title_close(NAV_TITLE **title)
+{
+    if (*title) {
+        _nav_title_close(*title);
+        *title = NULL;
+    }
+}
+
 NAV_TITLE* nav_title_open(BD_DISC *disc, const char *playlist, unsigned angle)
 {
     NAV_TITLE *title = NULL;
@@ -679,19 +748,25 @@ NAV_TITLE* nav_title_open(BD_DISC *disc,
     }
 
     // Find length in packets and end_pkt for each clip
-    title->clip_list.count = title->pl->list_count;
-    title->clip_list.clip = calloc(title->pl->list_count, sizeof(NAV_CLIP));
-    title->packets = 0;
-    for (ii = 0; ii < title->pl->list_count; ii++) {
-        MPLS_PI *pi;
-        NAV_CLIP *clip;
+    if (title->pl->list_count) {
+        title->clip_list.count = title->pl->list_count;
+        title->clip_list.clip = calloc(title->pl->list_count, sizeof(NAV_CLIP));
+        if (!title->clip_list.clip) {
+            _nav_title_close(title);
+            return NULL;
+        }
+        title->packets = 0;
+        for (ii = 0; ii < title->pl->list_count; ii++) {
+            const MPLS_PI *pi;
+            NAV_CLIP *clip;
 
-        pi = &title->pl->play_item[ii];
+            pi = &title->pl->play_item[ii];
 
-        clip = &title->clip_list.clip[ii];
+            clip = &title->clip_list.clip[ii];
 
-        _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
-                   clip, ii, &pos, &time);
+            _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
+                       pi->still_mode, pi->still_time, clip, ii, &pos, &time);
+        }
     }
 
     // sub paths
@@ -699,29 +774,44 @@ NAV_TITLE* nav_title_open(BD_DISC *disc,
     if (title->pl->sub_count > 0) {
         title->sub_path_count = title->pl->sub_count;
         title->sub_path       = calloc(title->sub_path_count, sizeof(NAV_SUB_PATH));
+        if (!title->sub_path) {
+          _nav_title_close(title);
+          return NULL;
+        }
 
         for (ss = 0; ss < title->sub_path_count; ss++) {
             NAV_SUB_PATH *sub_path = &title->sub_path[ss];
 
             sub_path->type            = title->pl->sub_path[ss].type;
             sub_path->clip_list.count = title->pl->sub_path[ss].sub_playitem_count;
+            if (!sub_path->clip_list.count)
+              continue;
+
             sub_path->clip_list.clip  = calloc(sub_path->clip_list.count, sizeof(NAV_CLIP));
+            if (!sub_path->clip_list.clip) {
+              _nav_title_close(title);
+              return NULL;
+            }
 
             pos = time = 0;
             for (ii = 0; ii < sub_path->clip_list.count; ii++) {
-                MPLS_SUB_PI *pi   = &title->pl->sub_path[ss].sub_play_item[ii];
+                const MPLS_SUB_PI *pi   = &title->pl->sub_path[ss].sub_play_item[ii];
                 NAV_CLIP    *clip = &sub_path->clip_list.clip[ii];
 
                 _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, 0,
-                           clip, ii, &pos, &time);
+                           0, 0, clip, ii, &pos, &time);
             }
         }
     }
 
     title->chap_list.count = _pl_chapter_count(title->pl);
-    title->chap_list.mark = calloc(title->chap_list.count, sizeof(NAV_MARK));
+    if (title->chap_list.count) {
+        title->chap_list.mark = calloc(title->chap_list.count, sizeof(NAV_MARK));
+    }
     title->mark_list.count = title->pl->mark_count;
-    title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
+    if (title->mark_list.count) {
+        title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
+    }
 
     _extrapolate_title(title);
 
@@ -732,44 +822,6 @@ NAV_TITLE* nav_title_open(BD_DISC *disc,
     return title;
 }
 
-static
-void _nav_title_close(NAV_TITLE *title)
-{
-    unsigned ii, ss;
-
-    if (title->sub_path) {
-        for (ss = 0; ss < title->sub_path_count; ss++) {
-            if (title->sub_path[ss].clip_list.clip) {
-                for (ii = 0; ii < title->sub_path[ss].clip_list.count; ii++) {
-                    clpi_free(&title->sub_path[ss].clip_list.clip[ii].cl);
-                }
-                X_FREE(title->sub_path[ss].clip_list.clip);
-            }
-        }
-        X_FREE(title->sub_path);
-    }
-
-    if (title->clip_list.clip) {
-        for (ii = 0; ii < title->clip_list.count; ii++) {
-            clpi_free(&title->clip_list.clip[ii].cl);
-        }
-        X_FREE(title->clip_list.clip);
-    }
-
-    mpls_free(&title->pl);
-    X_FREE(title->chap_list.mark);
-    X_FREE(title->mark_list.mark);
-    X_FREE(title);
-}
-
-void nav_title_close(NAV_TITLE **title)
-{
-    if (*title) {
-        _nav_title_close(*title);
-        *title = NULL;
-    }
-}
-
 // Search for random access point closest to the requested packet
 // Packets are 192 byte TS packets
 NAV_CLIP* nav_chapter_search(NAV_TITLE *title, unsigned chapter, uint32_t *clip_pkt, uint32_t *out_pkt)
@@ -916,7 +968,7 @@ uint32_t nav_angle_change_search(NAV_CLI
 NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt)
 {
     uint32_t pos, len;
-    MPLS_PI *pi = NULL;
+    const MPLS_PI *pi = NULL;
     NAV_CLIP *clip;
     unsigned ii;
 
@@ -966,7 +1018,9 @@ void nav_clip_time_search(NAV_CLIP *clip
             *clip_pkt = clip->start_pkt;
         }
     }
-    *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
+    if (out_pkt) {
+        *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
+    }
 }
 
 /*
@@ -1010,16 +1064,26 @@ NAV_CLIP* nav_set_angle(NAV_TITLE *title
     // Find length in packets and end_pkt for each clip
     title->packets = 0;
     for (ii = 0; ii < title->pl->list_count; ii++) {
-        MPLS_PI *pi;
+        const MPLS_PI *pi;
         NAV_CLIP *cl;
 
         pi = &title->pl->play_item[ii];
         cl = &title->clip_list.clip[ii];
 
         _fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
-                   cl, ii, &pos, &time);
+                   pi->still_mode, pi->still_time, cl, ii, &pos, &time);
     }
     _extrapolate_title(title);
     return clip;
 }
 
+char *nav_clip_textst_font(NAV_CLIP *clip, int index)
+{
+    char *file;
+
+    if (index < 0 || index >= clip->cl->clip.font_info.font_count)
+        return NULL;
+
+    file = str_printf("%s.otf", clip->cl->clip.font_info.font[index].file_id);
+    return file;
+}
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/navigation.h 1:1.1.0-1/src/libbluray/bdnav/navigation.h
--- 1:1.0.2-3/src/libbluray/bdnav/navigation.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/navigation.h	2019-02-12 07:45:08.000000000 +0000
@@ -23,9 +23,11 @@
 #include "util/attributes.h"
 
 #include "mpls_data.h"
-#include "clpi_data.h"
+
+#include <stdint.h>
 
 struct bd_disc;
+struct clpi_cl;
 
 #define CONNECT_NON_SEAMLESS 0
 #define CONNECT_SEAMLESS 1
@@ -81,9 +83,12 @@ struct nav_clip_s
 
     NAV_TITLE *title;
 
-    CLPI_CL  *cl;
-
     uint32_t stc_spn;  /* start packet of clip STC sequence */
+
+    uint8_t  still_mode;
+    uint16_t still_time;
+
+    struct clpi_cl *cl;
 };
 
 typedef struct nav_clip_list_s NAV_CLIP_LIST;
@@ -154,4 +159,6 @@ BD_PRIVATE NAV_CLIP* nav_set_angle(NAV_T
 BD_PRIVATE NAV_TITLE_LIST* nav_get_title_list(struct bd_disc *disc, uint32_t flags, uint32_t min_title_length) BD_ATTR_MALLOC;
 BD_PRIVATE void nav_free_title_list(NAV_TITLE_LIST **title_list);
 
+BD_PRIVATE char *nav_clip_textst_font(NAV_CLIP *clip, int index);
+
 #endif // _NAVIGATION_H_
diff -pruN 1:1.0.2-3/src/libbluray/bdnav/sound_parse.c 1:1.1.0-1/src/libbluray/bdnav/sound_parse.c
--- 1:1.0.2-3/src/libbluray/bdnav/sound_parse.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bdnav/sound_parse.c	2019-02-12 07:45:08.000000000 +0000
@@ -1,6 +1,6 @@
 /*
  * This file is part of libbluray
- * Copyright (C) 2010  hpi1
+ * Copyright (C) 2010-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,8 @@
 
 #include "sound_parse.h"
 
+#include "bdmv_parse.h"
+
 #include "disc/disc.h"
 
 #include "file/file.h"
@@ -33,26 +35,16 @@
 #include <stdlib.h>
 
 #define BCLK_SIG1  ('B' << 24 | 'C' << 16 | 'L' << 8 | 'K')
-#define BCLK_SIG2A ('0' << 24 | '2' << 16 | '0' << 8 | '0')
-#define BCLK_SIG2B ('0' << 24 | '1' << 16 | '0' << 8 | '0')
-
 
 static int _bclk_parse_header(BITSTREAM *bs, uint32_t *data_start, uint32_t *extension_data_start)
 {
-    uint32_t sig1, sig2;
-
-    if (bs_seek_byte(bs, 0) < 0) {
+    if (!bdmv_parse_header(bs, BCLK_SIG1, NULL)) {
         return 0;
     }
 
-    sig1 = bs_read(bs, 32);
-    sig2 = bs_read(bs, 32);
-
-    if (sig1 != BCLK_SIG1 ||
-       (sig2 != BCLK_SIG2A &&
-        sig2 != BCLK_SIG2B)) {
-     BD_DEBUG(DBG_NAV, "sound.bdmv failed signature match: expected BCLK0100 got %8.8s\n", bs->buf);
-     return 0;
+    if (bs_avail(bs) < 2 * 32) {
+        BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_header: unexpected end of file\n");
+        return 0;
     }
 
     *data_start           = bs_read(bs, 32);
diff -pruN 1:1.0.2-3/src/libbluray/bluray.c 1:1.1.0-1/src/libbluray/bluray.c
--- 1:1.0.2-3/src/libbluray/bluray.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bluray.c	2019-02-12 07:45:08.000000000 +0000
@@ -2,7 +2,7 @@
  * This file is part of libbluray
  * Copyright (C) 2009-2010  Obliter0n
  * Copyright (C) 2009-2010  John Stebbins
- * Copyright (C) 2010-2017  Petri Hintukainen
+ * Copyright (C) 2010-2019  Petri Hintukainen <phintuka@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -39,7 +39,6 @@
 #include "bdnav/index_parse.h"
 #include "bdnav/meta_parse.h"
 #include "bdnav/meta_data.h"
-#include "bdnav/clpi_parse.h"
 #include "bdnav/sound_parse.h"
 #include "bdnav/uo_mask.h"
 #include "hdmv/hdmv_vm.h"
@@ -488,8 +487,8 @@ static void _update_textst_timer(BLURAY
                 /* find event position in main path clip */
                 NAV_CLIP *clip = bd->st0.clip;
                 if (clip->cl) {
-                    uint32_t spn = clpi_lookup_spn(clip->cl, cmds.wakeup_time, /*before=*/1,
-                                                   bd->title->pl->play_item[clip->ref].clip[clip->angle].stc_id);
+                    uint32_t spn;
+                    nav_clip_time_search(clip, cmds.wakeup_time, &spn, NULL);
                     if (spn) {
                         bd->gc_wakeup_pos = (uint64_t)spn * 192L;
                   }
@@ -502,8 +501,8 @@ static void _update_textst_timer(BLURAY
 static void _init_textst_timer(BLURAY *bd)
 {
     if (bd->st_textst.clip && bd->st0.clip->cl) {
-        uint32_t clip_time;
-        clpi_access_point(bd->st0.clip->cl, SPN(bd->st0.clip_block_pos), /*next=*/0, /*angle_change=*/0, &clip_time);
+        uint32_t clip_time, clip_pkt;
+        nav_clip_packet_search(bd->st0.clip, SPN(bd->st0.clip_block_pos), &clip_pkt, &clip_time);
         bd->gc_wakeup_time = clip_time;
         bd->gc_wakeup_pos = 0;
         _update_textst_timer(bd);
@@ -904,10 +903,13 @@ static void _check_bdj(BLURAY *bd)
 
             /* Check if jvm + jar can be loaded ? */
             switch (bdj_jvm_available(&bd->bdjstorage)) {
-            case 2: bd->disc_info.bdj_handled = 1;
+                case BDJ_CHECK_OK:
+                    bd->disc_info.bdj_handled = 1;
+                    /* fall thru */
+                case BDJ_CHECK_NO_JAR:
+                    bd->disc_info.libjvm_detected = 1;
                     /* fall thru */
-            case 1: bd->disc_info.libjvm_detected = 1;
-            default:;
+                default:;
             }
         }
     }
@@ -1060,19 +1062,24 @@ static void _fill_disc_info(BLURAY *bd,
             bd->disc_info.top_menu = titles[0];
         }
 
-        /* populate title names */
-        bd_get_meta(bd);
+        /* increase player profile and version when 3D or UHD disc is detected */
 
-        /* no BD-J menu support for profile 6 */
-        if (bd->disc_info.num_bdj_titles) {
-            // XXX actually, should check from bdjo files ...
-            if (index->indx_version >= ('0' << 24 | '3' << 16 | '0' << 8 | '0')) {
-                BD_DEBUG(DBG_CRIT | DBG_BLURAY, "WARNING: BluRay profile 6 BD-J menus are not supported\n");
-                bd->disc_info.no_menu_support = 1;
+        if (index->indx_version >= ('0' << 24 | '3' << 16 | '0' << 8 | '0')) {
+            BD_DEBUG(DBG_CRIT | DBG_BLURAY, "WARNING: BluRay profile 6 BD-J menu support is experimental\n");
+            /* Switch to UHD profile */
+            psr_init_UHD(bd->regs, 1);
+        }
+        if (((index->indx_version >> 16) & 0xff) == '2') {
+            if (index->app_info.content_exist_flag) {
+                /* Switch to 3D profile */
+                psr_init_3D(bd->regs, index->app_info.initial_output_mode_preference, 0);
             }
         }
 
         indx_free(&index);
+
+        /* populate title names */
+        bd_get_meta(bd);
     }
 
 #if 0
@@ -1096,9 +1103,7 @@ static void _fill_disc_info(BLURAY *bd,
 const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd)
 {
     if (!bd->disc) {
-        BD_ENC_INFO enc_info;
-        memset(&enc_info, 0, sizeof(enc_info));
-        _fill_disc_info(bd, &enc_info);
+        _fill_disc_info(bd, NULL);
     }
     return &bd->disc_info;
 }
@@ -1934,16 +1939,14 @@ static int _bd_read(BLURAY *bd, unsigned
                         return out_len;
                     }
 
-                    MPLS_PI *pi = &st->clip->title->pl->play_item[st->clip->ref];
-
                     // handle still mode clips
-                    if (pi->still_mode == BLURAY_STILL_INFINITE) {
+                    if (st->clip->still_mode == BLURAY_STILL_INFINITE) {
                         _queue_event(bd, BD_EVENT_STILL_TIME, 0);
                         return 0;
                     }
-                    if (pi->still_mode == BLURAY_STILL_TIME) {
+                    if (st->clip->still_mode == BLURAY_STILL_TIME) {
                         if (bd->event_queue) {
-                            _queue_event(bd, BD_EVENT_STILL_TIME, pi->still_time);
+                            _queue_event(bd, BD_EVENT_STILL_TIME, st->clip->still_time);
                             return 0;
                         }
                     }
@@ -2063,9 +2066,7 @@ int bd_read_skip_still(BLURAY *bd)
     bd_mutex_lock(&bd->mutex);
 
     if (st->clip) {
-        MPLS_PI *pi = &st->clip->title->pl->play_item[st->clip->ref];
-
-        if (pi->still_mode == BLURAY_STILL_TIME) {
+        if (st->clip->still_mode == BLURAY_STILL_TIME) {
             st->clip = nav_next_clip(bd->title, st->clip);
             if (st->clip) {
                 ret = _open_m2ts(bd, st);
@@ -2089,6 +2090,7 @@ static int _preload_textst_subpath(BLURA
     unsigned       textst_subclip = 0;
     uint16_t       textst_pid     = 0;
     unsigned       ii;
+    char          *font_file;
 
     if (!bd->graphics_controller) {
         return 0;
@@ -2102,7 +2104,15 @@ static int _preload_textst_subpath(BLURA
     if (textst_subpath < 0) {
         return 0;
     }
+    if (textst_pid != 0x1800) {
+        BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_preload_textst_subpath(): ignoring pid 0x%x\n", (unsigned)textst_pid);
+        return 0;
+    }
 
+    if ((unsigned)textst_subpath >= bd->title->sub_path_count) {
+        BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_preload_textst_subpath(): invalid subpath id\n");
+        return -1;
+    }
     if (textst_subclip >= bd->title->sub_path[textst_subpath].clip_list.count) {
         BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_preload_textst_subpath(): invalid subclip id\n");
         return -1;
@@ -2127,21 +2137,19 @@ static int _preload_textst_subpath(BLURA
         return 0;
     }
 
-    gc_decode_ts(bd->graphics_controller, 0x1800, bd->st_textst.buf, SPN(bd->st_textst.clip_size) / 32, -1);
+    gc_decode_ts(bd->graphics_controller, textst_pid, bd->st_textst.buf, SPN(bd->st_textst.clip_size) / 32, -1);
 
     /* set fonts and encoding from clip info */
-    gc_add_font(bd->graphics_controller, NULL, -1);
-    for (ii = 0; ii < bd->st_textst.clip->cl->clip.font_info.font_count; ii++) {
-        char *file = str_printf("%s.otf", bd->st_textst.clip->cl->clip.font_info.font[ii].file_id);
-        if (file) {
-            uint8_t *data = NULL;
-            size_t size = disc_read_file(bd->disc, "BDMV" DIR_SEP "AUXDATA", file, &data);
-            if (data && size > 0 && gc_add_font(bd->graphics_controller, data, size) < 0) {
-                X_FREE(data);
-            }
-            X_FREE(file);
+    gc_add_font(bd->graphics_controller, NULL, -1); /* reset fonts */
+    for (ii = 0; NULL != (font_file = nav_clip_textst_font(bd->st_textst.clip, ii)); ii++) {
+        uint8_t *data = NULL;
+        size_t size = disc_read_file(bd->disc, "BDMV" DIR_SEP "AUXDATA", font_file, &data);
+        if (data && size > 0 && gc_add_font(bd->graphics_controller, data, size) < 0) {
+            X_FREE(data);
         }
+        X_FREE(font_file);
     }
+
     gc_run(bd->graphics_controller, GC_CTRL_PG_CHARCODE, char_code, NULL);
 
     /* start presentation timer */
@@ -2221,7 +2229,7 @@ static int _preload_subpaths(BLURAY *bd)
     _close_preload(&bd->st_ig);
     _close_preload(&bd->st_textst);
 
-    if (bd->title->pl->sub_count <= 0) {
+    if (bd->title->sub_path_count <= 0) {
         return 0;
     }
 
@@ -2236,7 +2244,7 @@ static int _init_ig_stream(BLURAY *bd)
 
     bd->st0.ig_pid = 0;
 
-    if (!bd->graphics_controller) {
+    if (!bd->title || !bd->graphics_controller) {
         return 0;
     }
 
@@ -2675,6 +2683,8 @@ static BLURAY_TITLE_INFO* _fill_title_in
         }
     }
 
+    title_info->mvc_base_view_r_flag = title->pl->app_info.mvc_base_view_r_flag;
+
     return title_info;
 
  error:
@@ -3230,27 +3240,16 @@ static int _play_title(BLURAY *bd, unsig
 
     /* top menu ? */
     if (title == BLURAY_TITLE_TOP_MENU) {
-
-        bd_psr_write(bd->regs, PSR_TITLE_NUMBER, 0); /* 5.2.3.3 */
-
         if (!bd->disc_info.top_menu_supported) {
             /* no top menu (5.2.3.3) */
             BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_play_title(): No top menu title\n");
             bd->title_type = title_hdmv;
             return 0;
         }
-
-        if (bd->disc_info.top_menu->bdj) {
-            return _play_bdj(bd, title);
-        } else {
-            return _play_hdmv(bd, bd->disc_info.top_menu->id_ref);
-        }
-
-        return 0;
     }
 
     /* valid title from disc index ? */
-    if (title > 0 && title <= bd->disc_info.num_titles) {
+    if (title <= bd->disc_info.num_titles) {
 
         bd_psr_write(bd->regs, PSR_TITLE_NUMBER, title); /* 5.2.3.3 */
         if (bd->disc_info.titles[title]->bdj) {
@@ -3782,6 +3781,7 @@ int bd_get_meta_file(BLURAY *bd, const c
  * Database access
  */
 
+#include "bdnav/clpi_parse.h"
 #include "bdnav/mpls_parse.h"
 
 struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref)
diff -pruN 1:1.0.2-3/src/libbluray/bluray.h 1:1.1.0-1/src/libbluray/bluray.h
--- 1:1.0.2-3/src/libbluray/bluray.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bluray.h	2019-02-12 07:45:08.000000000 +0000
@@ -274,6 +274,8 @@ typedef struct bd_title_info {
     BLURAY_CLIP_INFO     *clips;
     BLURAY_TITLE_CHAPTER *chapters;
     BLURAY_TITLE_MARK    *marks;
+
+    uint8_t              mvc_base_view_r_flag;
 } BLURAY_TITLE_INFO;
 
 /*
diff -pruN 1:1.0.2-3/src/libbluray/bluray-version.h 1:1.1.0-1/src/libbluray/bluray-version.h
--- 1:1.0.2-3/src/libbluray/bluray-version.h	2017-12-03 15:27:47.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/bluray-version.h	2019-02-12 07:45:51.000000000 +0000
@@ -26,10 +26,10 @@
      ((micro) *     1))
 
 #define BLURAY_VERSION_MAJOR 1
-#define BLURAY_VERSION_MINOR 0
-#define BLURAY_VERSION_MICRO 2
+#define BLURAY_VERSION_MINOR 1
+#define BLURAY_VERSION_MICRO 0
 
-#define BLURAY_VERSION_STRING "1.0.2"
+#define BLURAY_VERSION_STRING "1.1.0"
 
 #define BLURAY_VERSION \
     BLURAY_VERSION_CODE(BLURAY_VERSION_MAJOR, BLURAY_VERSION_MINOR, BLURAY_VERSION_MICRO)
diff -pruN 1:1.0.2-3/src/libbluray/disc/aacs.c 1:1.1.0-1/src/libbluray/disc/aacs.c
--- 1:1.0.2-3/src/libbluray/disc/aacs.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/disc/aacs.c	2019-02-12 07:45:08.000000000 +0000
@@ -101,6 +101,13 @@ static void *_open_libaacs(int *impl_id)
         if (libaacs[ii]) {
             void *handle = dl_dlopen(libaacs[ii], "0");
             if (handle) {
+                /* One more libmmbd check. This is needed if libaacs is just a link to libmmbd ... */
+                fptr_int32 fp;
+                *(void **)(&fp) = dl_dlsym(handle, "bdplus_get_code_date");
+                if (fp && fp(NULL) == 0) {
+                    ii = IMPL_LIBMMBD;
+                }
+
                 *impl_id = ii;
                 BD_DEBUG(DBG_BLURAY, "Using %s for AACS\n", libaacs[ii]);
                 return handle;
diff -pruN 1:1.0.2-3/src/libbluray/disc/bdplus.c 1:1.1.0-1/src/libbluray/disc/bdplus.c
--- 1:1.0.2-3/src/libbluray/disc/bdplus.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/disc/bdplus.c	2019-02-12 07:45:08.000000000 +0000
@@ -105,6 +105,13 @@ static void *_libbdplus_open(int *impl_i
         if (libbdplus[ii]) {
             void *handle = dl_dlopen(libbdplus[ii], "0");
             if (handle) {
+                /* One more libmmbd check. This is needed if libbdplus is just a link to libmmbd ... */
+                fptr_int32 fp;
+                *(void **)(&fp) = dl_dlsym(handle, "bdplus_get_code_date");
+                if (fp && fp(NULL) == 0) {
+                    ii = IMPL_LIBMMBD;
+                }
+
                 *impl_id = ii;
                 BD_DEBUG(DBG_BLURAY, "Using %s for BD+\n", libbdplus[ii]);
                 return handle;
diff -pruN 1:1.0.2-3/src/libbluray/disc/dec.c 1:1.1.0-1/src/libbluray/disc/dec.c
--- 1:1.0.2-3/src/libbluray/disc/dec.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/disc/dec.c	2019-02-12 07:45:08.000000000 +0000
@@ -242,7 +242,7 @@ static int _libbdplus_init(BD_DEC *dec,
 
     if (i->bdplus_date == 0) {
         // libmmbd -> no menu support
-        BD_DEBUG(DBG_BLURAY | DBG_CRIT, "WARNING: using libmmbd for BD+. On-disc menus will not work.\n");
+        BD_DEBUG(DBG_BLURAY | DBG_CRIT, "WARNING: using libmmbd for BD+. On-disc menus won't work with all discs.\n");
         //i->no_menu_support = 1;
     }
 
diff -pruN 1:1.0.2-3/src/libbluray/disc/disc.c 1:1.1.0-1/src/libbluray/disc/disc.c
--- 1:1.0.2-3/src/libbluray/disc/disc.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/disc/disc.c	2019-02-12 07:45:08.000000000 +0000
@@ -683,6 +683,15 @@ const uint8_t *disc_get_data(BD_DISC *di
     if (disc->dec) {
         return dec_data(disc->dec, type);
     }
+    if (type == 0x1000) {
+        /* this shouldn't cause any extra optical disc access */
+        BD_DIR_H *d = disc->pf_dir_open_bdrom(disc->fs_handle, "MAKEMKV");
+        if (d) {
+            dir_close(d);
+            BD_DEBUG(DBG_FILE, "Detected MakeMKV backup data\n");
+            return (const uint8_t *)"mmbd;backup";
+        }
+    }
     return NULL;
 }
 
diff -pruN 1:1.0.2-3/src/libbluray/disc/udf_fs.c 1:1.1.0-1/src/libbluray/disc/udf_fs.c
--- 1:1.0.2-3/src/libbluray/disc/udf_fs.c	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/libbluray/disc/udf_fs.c	2019-02-12 07:45:08.000000000 +0000
@@ -263,20 +263,20 @@ void *udf_image_open(const char *img_pat
         }
     } else {
 
-    /* app handles file I/O ? */
-    if (result < 0 && file_open != file_open_default()) {
-        struct udfread_block_input *bi = _block_input(img_path);
-        if (bi) {
-            result = udfread_open_input(udf, bi);
-            if (result < 0) {
-                bi->close(bi);
+        /* app handles file I/O ? */
+        if (result < 0 && file_open != file_open_default()) {
+            struct udfread_block_input *bi = _block_input(img_path);
+            if (bi) {
+                result = udfread_open_input(udf, bi);
+                if (result < 0) {
+                    bi->close(bi);
+                }
             }
         }
-    }
 
-    if (result < 0) {
-        result = udfread_open(udf, img_path);
-    }
+        if (result < 0) {
+            result = udfread_open(udf, img_path);
+        }
     }
 
     if (result < 0) {
diff -pruN 1:1.0.2-3/src/util/array.h 1:1.1.0-1/src/util/array.h
--- 1:1.0.2-3/src/util/array.h	2017-12-03 15:25:55.000000000 +0000
+++ 1:1.1.0-1/src/util/array.h	2019-02-12 07:45:08.000000000 +0000
@@ -35,7 +35,7 @@
  * @return     array of n pointers, each pointing to memory block of size sz.
  *
  */
-BD_PRIVATE void *array_alloc(size_t n, size_t sz) BD_ATTR_MALLOC;
+BD_PRIVATE void *array_alloc(size_t n, size_t sz);
 
 /*
  * array_free()
