diff -Nru libbluray-0.5.0/aclocal.m4 libbluray-0.8.1/aclocal.m4 --- libbluray-0.5.0/aclocal.m4 2013-12-21 08:35:52.000000000 +0000 +++ libbluray-0.8.1/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,1033 +0,0 @@ -# generated automatically by aclocal 1.11.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.6], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.6])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # 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 - shift - for 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 - # 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"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # 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 - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# 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. -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"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 16 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) - -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.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 -]) - -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/attributes.m4]) -m4_include([m4/ax_prog_doxygen.m4]) -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) -m4_include([m4/pkg.m4]) diff -Nru libbluray-0.5.0/build-aux/compile libbluray-0.8.1/build-aux/compile --- libbluray-0.5.0/build-aux/compile 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.8.1/build-aux/compile 2015-09-02 11:11:20.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-03-05.13; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -113,6 +112,11 @@ lib=$dir/$lib.lib break fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi done IFS=$save_IFS diff -Nru libbluray-0.5.0/build-aux/config.guess libbluray-0.8.1/build-aux/config.guess --- libbluray-0.5.0/build-aux/config.guess 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.8.1/build-aux/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1530 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. - -timestamp='2012-02-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) 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 - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -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*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - 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 ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # 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 - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - 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}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # 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'` - # 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 - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - 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/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - 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. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - 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/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - 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 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - 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 - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # 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} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - 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); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - 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` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - 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 - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - 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 - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - 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 - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - 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 - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - 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 ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') 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 - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (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" ] - then - 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 - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - 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} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $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:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - 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/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - 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/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - 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/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - 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 - 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/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - 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 - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86: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} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V: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} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - 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' /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 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - 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 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - 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; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - 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; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { 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; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - 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} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - 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} - 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} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - 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} - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/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} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru libbluray-0.5.0/build-aux/config.sub libbluray-0.8.1/build-aux/config.sub --- libbluray-0.5.0/build-aux/config.sub 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.8.1/build-aux/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1782 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. - -timestamp='2012-04-18' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (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 . -# -# 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. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# 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;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -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/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - 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/'` - ;; - -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/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - 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/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # 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 - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - 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 - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i386-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - 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) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - 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 - ;; - we32k) - basic_machine=we32k-att - ;; - 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 - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # 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 - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -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. - # The portable systems comes first. - # 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]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru libbluray-0.5.0/build-aux/depcomp libbluray-0.8.1/build-aux/depcomp --- libbluray-0.5.0/build-aux/depcomp 2013-12-21 08:36:04.000000000 +0000 +++ libbluray-0.8.1/build-aux/depcomp 2015-09-02 11:11:20.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-03-27.16; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -57,11 +56,65 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + # A tabulation character. tab=' ' # A newline character. nl=' ' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 @@ -75,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -86,32 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 fi if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. - gccflag=-qmakedep=gcc,-MF - depmode=gcc + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -134,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -143,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -157,15 +216,14 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. @@ -174,15 +232,15 @@ ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -200,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -209,7 +266,6 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in @@ -217,19 +273,15 @@ # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr "$nl" ' ' >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; @@ -247,9 +299,8 @@ # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -262,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -273,65 +322,113 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependent.h'. - # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. - # However on - # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\': + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - # tcc 0.9.26 (FIXME still under development at the moment of writing) - # will emit a similar output, but also prepend the continuation lines - # with horizontal tabulation characters. - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" - # Each line is of the form 'foo.o: dependent.h', - # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ - < "$tmpdepfile" > "$depfile" - sed ' - s/[ '"$tab"'][ '"$tab"']*/ /g - s/^ *// - s/ *\\*$// - s/^[^:]*: *// - /^$/d - /:$/d - s/$/ :/ - ' < "$tmpdepfile" >> "$depfile" + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -342,9 +439,8 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -355,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -366,76 +461,61 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -446,8 +526,7 @@ "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -473,6 +552,7 @@ G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -524,13 +604,14 @@ # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' "$nl" < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -583,10 +664,12 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -622,10 +705,10 @@ esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -657,15 +740,15 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | diff -Nru libbluray-0.5.0/build-aux/install-sh libbluray-0.8.1/build-aux/install-sh --- libbluray-0.5.0/build-aux/install-sh 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.8.1/build-aux/install-sh 2015-09-02 11:11:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in diff -Nru libbluray-0.5.0/build-aux/ltmain.sh libbluray-0.8.1/build-aux/ltmain.sh --- libbluray-0.5.0/build-aux/ltmain.sh 2013-12-21 08:35:37.000000000 +0000 +++ libbluray-0.8.1/build-aux/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,9661 +0,0 @@ - -# libtool (GNU libtool) 2.4.2 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 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. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1" -TIMESTAMP="" -package_revision=1.3337 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and 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_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_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 () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_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. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - 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 - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # 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" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - 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" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - 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" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - 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" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - 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" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # 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" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - 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" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - 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" - 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"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff -Nru libbluray-0.5.0/build-aux/missing libbluray-0.8.1/build-aux/missing --- libbluray-0.5.0/build-aux/missing 2013-12-21 08:36:03.000000000 +0000 +++ libbluray-0.8.1/build-aux/missing 2015-09-02 11:11:20.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru libbluray-0.5.0/ChangeLog libbluray-0.8.1/ChangeLog --- libbluray-0.5.0/ChangeLog 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/ChangeLog 2015-05-15 09:25:06.000000000 +0000 @@ -1,3 +1,68 @@ +2015-05-15: Version 0.8.1 +- Notify application when UO mask changes. +- Improved error resilience. +- Improved BD-J compability. +- Fix crash after bd_open(NULL). +- Fix compability problem with libbdplus. +- Fix memory leak in UDF filesystem parser. +- Fix crash in freetype. + +2015-04-15: Version 0.8.0 +- Add security checks to BD-J. +- Add support for UDF image files and unmounted discs. +- Add UDF volume identifier to DISC_INFO. +- Add bd_init(), bd_open_disc() and bd_open_stream(). +- Add /usr/share/libbluray/lib/ to .jar file search paths. +- Add BD_EVENT_PLAYLIST_STOP (playlist playback is interrupted). +- Accept directory name (without .jar file name) in LIBBLURAY_CP. +- Improved error resilience. +- Improve BD-J compability. +- Fix Java 8u40 compability. +- Fix infinite loop with some broken HDMV menus. + +2015-01-26: Version 0.7.0 +- Add player setting for BD-J persistent storage and cache paths. +- Add support for system fonts. BD-J fonts in jre/lib/fonts/ are not required anymore. +- Add BD-J organization ID and disc ID to BLURAY_DISC_INFO. +- Release still mode when BD-J terminates. +- Implement BD-J caching. +- Improve BD-J compability. +- Java 8 compability fixes. +- Fix storage size for bdjo object reference in BLURAY_DISC_INFO. +- Fix BD-J on-disc font usage. +- Fix animations in some BD-J menus. +- Fix BD-J storage path charset issues in Windows. + +2014-09-03: Version 0.6.2 +- Fix possible subtitle corruption after seek. +- Fix some main path embedded HDMV menus. +- Fix reading outside of source image in BD-J drawImage(). +- Fix missing BD_EVENT_ERROR when BD-J is not supported. +- Several stability and code quality fixes. + +2014-08-03: Version 0.6.1 +- Fix stream position when seamless angle change point is at clip boundary. +- Fix Mac OS X jni compilation +- Fix bd_seek() jumping outside of clip/playlist. +- Fix crash when stream selection is changed after playlist end. +- Fix J2ME build. +- Fix seamless angle change. +- Fix freetype2 resource leaks on shutdown. +- Improve duplicate playlist detection. + +2014-05-27: Version 0.6.0 +- Improved BD-J support (Most BD-J discs are correctly played). +- Mark BD-J titles supported in BLURAY_DISC_INFO if BD-J is functional. +- Install .jar files to datadir (/usr/share/java/) instead of libdir. +- Added version number to .jar file names. +- Added JNI headers for BD-J (cross) compilation. +- Added HDMV/BD-J title information to BLURAY_DISC_INFO. +- Added disc application info to BLURAY_DISC_INFO. +- Added bd_set_rate(). +- Added color keys (RED, GREEN, YELLOW, BLUE). +- Improved error resilience. +- Fix build without libxml. + 2013-12-21: Version 0.5.0 - Portability fixes. - Build system updates. diff -Nru libbluray-0.5.0/config.h.in libbluray-0.8.1/config.h.in --- libbluray-0.5.0/config.h.in 2013-12-21 08:36:01.000000000 +0000 +++ libbluray-0.8.1/config.h.in 2015-09-02 11:11:19.000000000 +0000 @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if libudfread is to be used for disc image access */ +#undef ENABLE_UDF + /* Define to 1 if using libbluray J2ME stack */ #undef HAVE_BDJ_J2ME @@ -13,6 +16,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define this if you have fontconfig library */ +#undef HAVE_FONTCONFIG + /* Define this if you have FreeType2 library */ #undef HAVE_FT2 @@ -97,9 +106,6 @@ */ #undef LT_OBJDIR -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Name of package */ #undef PACKAGE @@ -147,5 +153,5 @@ /* Define to '0x0501' for IE 5.01. */ #undef _WIN32_IE -/* Define to '0x0500' for Windows XP APIs. */ +/* Define to '0x0502' for Windows XP SP2 APIs. */ #undef _WIN32_WINNT diff -Nru libbluray-0.5.0/configure libbluray-0.8.1/configure --- libbluray-0.5.0/configure 2013-12-21 08:35:57.000000000 +0000 +++ libbluray-0.8.1/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,17477 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libbluray 0.5.0. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://www.videolan.org/developers/libbluray.html about -$0: your system, including any error possibly output before -$0: this message. Then install a modern shell, or manually -$0: run the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='libbluray' -PACKAGE_TARNAME='libbluray' -PACKAGE_VERSION='0.5.0' -PACKAGE_STRING='libbluray 0.5.0' -PACKAGE_BUGREPORT='http://www.videolan.org/developers/libbluray.html' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -BDJAVA_CFLAGS -LT_VERSION_INFO -BLURAY_VERSION_MICRO -BLURAY_VERSION_MINOR -BLURAY_VERSION_MAJOR -DOXYGEN_PAPER_SIZE -DX_COND_latex_FALSE -DX_COND_latex_TRUE -DX_COND_pdf_FALSE -DX_COND_pdf_TRUE -DX_PDFLATEX -DX_FLAG_pdf -DX_COND_ps_FALSE -DX_COND_ps_TRUE -DX_EGREP -DX_DVIPS -DX_MAKEINDEX -DX_LATEX -DX_FLAG_ps -DX_COND_html_FALSE -DX_COND_html_TRUE -DX_FLAG_html -DX_COND_chi_FALSE -DX_COND_chi_TRUE -DX_FLAG_chi -DX_COND_chm_FALSE -DX_COND_chm_TRUE -DX_HHC -DX_FLAG_chm -DX_COND_xml_FALSE -DX_COND_xml_TRUE -DX_FLAG_xml -DX_COND_rtf_FALSE -DX_COND_rtf_TRUE -DX_FLAG_rtf -DX_COND_man_FALSE -DX_COND_man_TRUE -DX_FLAG_man -DX_COND_dot_FALSE -DX_COND_dot_TRUE -DX_DOT -DX_FLAG_dot -DX_COND_doc_FALSE -DX_COND_doc_TRUE -DX_PERL -DX_DOXYGEN -DX_FLAG_doc -DX_ENV -DX_DOCDIR -DX_CONFIG -DX_PROJECT -BDJ_BOOTCLASSPATH -BDJ_TYPE -USING_BDJAVA_FALSE -USING_BDJAVA_TRUE -USING_EXAMPLES_FALSE -USING_EXAMPLES_TRUE -FT2_LIBS -FT2_CFLAGS -LIBXML2_LIBS -LIBXML2_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -DLOPEN_LIBS -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -LIBTOOL -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -JDK_HOME -HAVE_DARWIN_FALSE -HAVE_DARWIN_TRUE -HAVE_WIN32_FALSE -HAVE_WIN32_TRUE -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_werror -enable_extra_warnings -enable_optimizations -enable_examples -enable_bdjava -with_libxml2 -with_freetype -with_bdj_type -with_bdj_bootclasspath -enable_dependency_tracking -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -with_sysroot -enable_libtool_lock -enable_largefile -enable_doxygen_doc -enable_doxygen_dot -enable_doxygen_man -enable_doxygen_rtf -enable_doxygen_xml -enable_doxygen_chm -enable_doxygen_chi -enable_doxygen_html -enable_doxygen_ps -enable_doxygen_pdf -' - ac_precious_vars='build_alias -host_alias -target_alias -JDK_HOME -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -LIBXML2_CFLAGS -LIBXML2_LIBS -FT2_CFLAGS -FT2_LIBS -DOXYGEN_PAPER_SIZE' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -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 0.5.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/libbluray] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of libbluray 0.5.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-werror set warnings as errors via -Werror - [default=disabled] - --disable-extra-warnings - set extra warnings [default=enabled] - --disable-optimizations disable optimizations [default=enabled] - --enable-examples build examples (default is yes) - --enable-bdjava enable BD-Java support (default is no) - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --disable-largefile omit support for large files - --disable-doxygen-doc don't generate any doxygen documentation - --disable-doxygen-dot don't generate graphics for doxygen documentation - --enable-doxygen-man generate doxygen manual pages - --enable-doxygen-rtf generate doxygen RTF documentation - --enable-doxygen-xml generate doxygen XML documentation - --enable-doxygen-chm generate doxygen compressed HTML help documentation - --enable-doxygen-chi generate doxygen seperate compressed HTML help index - file - --disable-doxygen-html don't generate doxygen plain HTML documentation - --disable-doxygen-ps don't generate doxygen PostScript documentation - --disable-doxygen-pdf don't generate doxygen PDF documentation - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-libxml2 build without libxml2 support [default=with] - --without-freetype build without freetype support [default=with] - --with-bdj-type=TYPE Specify the type of BD-J implementation (j2se, - j2me). Default is j2se. - --with-bdj-bootclasspath=PATH - Specify BD-J build-time bootclass path (example - /opt/PhoneME/lib/btclasses.zip;/opt/PhoneME/lib/xmlparer.jar). - Default is empty. - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - -Some influential environment variables: - JDK_HOME Path to the JDK [default=/usr/lib/jvm/java-6-openjdk] - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - LIBXML2_CFLAGS - C compiler flags for LIBXML2, overriding pkg-config - LIBXML2_LIBS - linker flags for LIBXML2, overriding pkg-config - FT2_CFLAGS C compiler flags for FT2, overriding pkg-config - FT2_LIBS linker flags for FT2, overriding pkg-config - DOXYGEN_PAPER_SIZE - a4wide (default), a4, letter, legal or executive - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -libbluray configure 0.5.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------------------------------------- ## -## Report this to http://www.videolan.org/developers/libbluray.html ## -## ---------------------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member -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 0.5.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -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 - - -ac_aux_dir= -for ac_dir in build-aux "$srcdir"/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -am__api_version='1.11' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" - $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 -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" - $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_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - 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 - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -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_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # 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_AWK="$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 -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='libbluray' - VERSION='0.5.0' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar plaintar pax cpio none' -_am_tools=${am_cv_prog_tar_ustar-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - { echo "$as_me:$LINENO: $_am_tar --version" >&5 - ($_am_tar --version) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && break - done - am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x ustar -w "$$tardir"' - am__tar_='pax -L -x ustar -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H ustar -L' - am__tar_='find "$tardir" -print | cpio -o -H ustar -L' - am__untar='cpio -i -H ustar -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_ustar}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 - (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - rm -rf conftest.dir - if test -s conftest.tar; then - { echo "$as_me:$LINENO: $am__untar &5 - ($am__untar &5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -if ${am_cv_prog_tar_ustar+:} false; then : - $as_echo_n "(cached) " >&6 -else - am_cv_prog_tar_ustar=$_am_tool -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -$as_echo "$am_cv_prog_tar_ustar" >&6; } - - - - - -ac_config_headers="$ac_config_headers config.h" - - -case "${host_os}" in - "") - SYS=unknown - ;; - *mingw32* | *cygwin* | *wince* | *mingwce*) - case "${host_os}" in - *wince* | *mingwce* | *mingw32ce*) - SYS=mingwce - ;; - *mingw32*) - SYS=mingw32 - -$as_echo "#define _WIN32_WINNT 0x0501" >>confdefs.h - - -$as_echo "#define _WIN32_IE 0x0501" >>confdefs.h - - ;; - esac - ;; - *darwin*) - SYS=darwin - ;; - *) - SYS="${host_os}" - ;; -esac - - if test "${SYS}" = "mingw32"; then - HAVE_WIN32_TRUE= - HAVE_WIN32_FALSE='#' -else - HAVE_WIN32_TRUE='#' - HAVE_WIN32_FALSE= -fi - - if test "${SYS}" = "darwin"; then - HAVE_DARWIN_TRUE= - HAVE_DARWIN_FALSE='#' -else - HAVE_DARWIN_TRUE='#' - HAVE_DARWIN_FALSE= -fi - - -library_not_found="Could not find required library!" -function_not_found="Could not find required function!" - - -if test -z "$JDK_HOME"; then : - JDK_HOME="/usr/lib/jvm/java-6-openjdk" -fi - -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; -fi - - -# Check whether --enable-extra-warnings was given. -if test "${enable_extra_warnings+set}" = set; then : - enableval=$enable_extra_warnings; -fi - - -# Check whether --enable-optimizations was given. -if test "${enable_optimizations+set}" = set; then : - enableval=$enable_optimizations; -fi - - -# Check whether --enable-examples was given. -if test "${enable_examples+set}" = set; then : - enableval=$enable_examples; use_examples=$enableval -else - use_examples=yes -fi - - -# Check whether --enable-bdjava was given. -if test "${enable_bdjava+set}" = set; then : - enableval=$enable_bdjava; use_bdjava=$enableval -else - use_bdjava=no -fi - - - -# Check whether --with-libxml2 was given. -if test "${with_libxml2+set}" = set; then : - withval=$with_libxml2; -fi - - - -# Check whether --with-freetype was given. -if test "${with_freetype+set}" = set; then : - withval=$with_freetype; -fi - - - -# Check whether --with-bdj-type was given. -if test "${with_bdj_type+set}" = set; then : - withval=$with_bdj_type; BDJ_TYPE=$withval -else - BDJ_TYPE=j2se -fi - - - -# Check whether --with-bdj-bootclasspath was given. -if test "${with_bdj_bootclasspath+set}" = set; then : - withval=$with_bdj_bootclasspath; BDJ_BOOTCLASSPATH=$withval -else - BDJ_BOOTCLASSPATH= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}gcc" - $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 -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" - $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_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - 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 - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" - $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 -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -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 - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $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 - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - 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_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # 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_CC="$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 -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -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_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$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_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - 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 - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.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 - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - 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_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - 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_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -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_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - 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 - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" - $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 -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; 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_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" - $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="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 - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" - $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 -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; 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_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" - $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="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 - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - 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 -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} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_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 - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" - $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 -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" - $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_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - 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 - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} 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 - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext 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: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" - $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 -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; 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_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" - $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - 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 - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" - $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 -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; 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_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" - $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - 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 - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" - $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 -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; 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_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" - $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - 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 - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" - $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 -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; 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_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" - $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_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - 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 - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" - $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 -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; 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_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" - $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - 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 - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" - $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 -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; 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_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" - $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - 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 - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -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 - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - -for ac_header in stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in stdlib.h mntent.h linux/cdrom.h inttypes.h strings.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in sys/time.h time.h mntent.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - - - - ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" " -#include -#ifdef HAVE_DIRENT_H -# include -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -#endif - -" -if test "x$ac_cv_member_struct_dirent_d_type" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_DIRENT_D_TYPE 1 -_ACEOF - - -fi - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break -fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi - - -fi - - -ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" -if test "x$ac_cv_func_snprintf" = xyes; then : - -else - as_fn_error $? "$function_not_found" "$LINENO" 5 -fi - - -if test "${SYS}" != "mingw32"; then : - - for ac_header in pthread.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF - -else - as_fn_error $? "pthread required" "$LINENO" 5 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 -$as_echo_n "checking for library containing pthread_create... " >&6; } -if ${ac_cv_search_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_pthread_create=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_pthread_create+:} false; then : - break -fi -done -if ${ac_cv_search_pthread_create+:} false; then : - -else - ac_cv_search_pthread_create=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 -$as_echo "$ac_cv_search_pthread_create" >&6; } -ac_res=$ac_cv_search_pthread_create -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - as_fn_error $? "pthread required" "$LINENO" 5 -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dlopen+:} false; then : - break -fi -done -if ${ac_cv_search_dlopen+:} false; then : - -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - DLOPEN_LIBS="$ac_cv_search_dlopen" - case $DLOPEN_LIBS in #( - no|none\ required) : - DLOPEN_LIBS="" ;; #( - *) : - ;; -esac - - -fi - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi -if test "x$with_libxml2" != "xno"; then : - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5 -$as_echo_n "checking for LIBXML2... " >&6; } - -if test -n "$LIBXML2_CFLAGS"; then - pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBXML2_LIBS"; then - pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0 >= 2.6" 2>&1` - else - LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0 >= 2.6" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBXML2_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libxml-2.0 >= 2.6) were not met: - -$LIBXML2_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBXML2_CFLAGS -and LIBXML2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables LIBXML2_CFLAGS -and LIBXML2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } - -else - LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS - LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_libxml2=yes; -$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h - -fi - -fi - -if test "x$with_freetype" != "xno"; then : - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT2" >&5 -$as_echo_n "checking for FT2... " >&6; } - -if test -n "$FT2_CFLAGS"; then - pkg_cv_FT2_CFLAGS="$FT2_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FT2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$FT2_LIBS"; then - pkg_cv_FT2_LIBS="$FT2_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FT2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - FT2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` - else - FT2_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$FT2_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (freetype2) were not met: - -$FT2_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables FT2_CFLAGS -and FT2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables FT2_CFLAGS -and FT2_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } - -else - FT2_CFLAGS=$pkg_cv_FT2_CFLAGS - FT2_LIBS=$pkg_cv_FT2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_freetype=yes; -$as_echo "#define HAVE_FT2 1" >>confdefs.h - -fi - -fi - - - for flag in -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wshadow; do - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 -$as_echo_n "checking if $CC supports $flag flag... " >&6; } -if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - - if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" -else - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - -fi - -fi -eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - CFLAGS="$CFLAGS $flag"; -fi - - done - - - - for flag in -Werror=implicit-function-declaration -Werror-implicit-function-declaration; do - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 -$as_echo_n "checking if $CC supports $flag flag... " >&6; } -if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - - if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" -else - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - -fi - -fi -eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - CFLAGS="$CFLAGS $flag"; break; -fi - - done - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC way to treat warnings as errors" >&5 -$as_echo_n "checking for $CC way to treat warnings as errors... " >&6; } -if ${cc_cv_werror+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if ${cc_cv_cflags__Werror+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "cc_cv_cflags__Werror='yes'" -else - eval "cc_cv_cflags__Werror='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$cc_cv_cflags__Werror = xyes; then : - cc_cv_werror=-Werror -else - - if ${cc_cv_cflags__errwarn__all+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -errwarn=%all" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "cc_cv_cflags__errwarn__all='yes'" -else - eval "cc_cv_cflags__errwarn__all='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$cc_cv_cflags__errwarn__all = xyes; then : - cc_cv_werror=-errwarn=%all -fi - -fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_cv_werror" >&5 -$as_echo "$cc_cv_werror" >&6; } - -if test "x$enable_werror" = "xyes"; then : - - CFLAGS="${CFLAGS} $cc_cv_werror" - -fi - -if test "x$enable_extra_warnings" != "xno"; then : - - - for flag in -Wextra -Winline; do - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 -$as_echo_n "checking if $CC supports $flag flag... " >&6; } -if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - - if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" -else - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - -fi - -fi -eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - CFLAGS="$CFLAGS $flag"; -fi - - done - - -fi - -if test "x$enable_optimizations" != "xno"; then : - - - for flag in -O3 -fomit-frame-pointer; do - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 -$as_echo_n "checking if $CC supports $flag flag... " >&6; } -if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - - if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" -else - eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - -fi - - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - -fi - -fi -eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : - CFLAGS="$CFLAGS $flag"; -fi - - done - - -fi - - if test $use_examples = "yes" ; then - USING_EXAMPLES_TRUE= - USING_EXAMPLES_FALSE='#' -else - USING_EXAMPLES_TRUE='#' - USING_EXAMPLES_FALSE= -fi - - -if [ $use_bdjava = "yes" ]; then - case $host_cpu in - x86_64) java_arch=amd64 ;; - i?86) java_arch=i386 ;; - *) java_arch=$host_cpu ;; - esac - case $host_os in - linux*) java_os=linux ;; - win*) java_os=win32 ;; - mingw*) java_os=win32 ;; - freebsd*) java_os=freebsd ;; - solaris*) java_os=solaris ;; - *) java_os=$host_os ;; - esac - - BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" - - temp_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" - for ac_header in jni.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" -if test "x$ac_cv_header_jni_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_JNI_H 1 -_ACEOF - -else - as_fn_error $? "\"Could not find jni.h\"" "$LINENO" 5 -fi - -done - - CPPFLAGS="$temp_CPPFLAGS" - - -$as_echo "#define USING_BDJAVA 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define JAVA_ARCH "$java_arch" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define JDK_HOME "$JDK_HOME" -_ACEOF - -fi - if test $use_bdjava = "yes" ; then - USING_BDJAVA_TRUE= - USING_BDJAVA_FALSE='#' -else - USING_BDJAVA_TRUE='#' - USING_BDJAVA_FALSE= -fi - - -if test "$BDJ_TYPE" = "j2me"; then - -$as_echo "#define HAVE_BDJ_J2ME 1" >>confdefs.h - -else - BDJ_TYPE=j2se -fi - - - - - -# Files: -DX_PROJECT=libbluray - -DX_CONFIG=doc/doxygen-config - -DX_DOCDIR=doc/doxygen - - -# Environment variables used inside doxygen.cfg: -DX_ENV="$DX_ENV SRCDIR='$srcdir'" - -DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" - -DX_ENV="$DX_ENV DOCDIR='$DX_DOCDIR'" - -DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" - - -# Doxygen itself: - - - - # Check whether --enable-doxygen-doc was given. -if test "${enable_doxygen_doc+set}" = set; then : - enableval=$enable_doxygen_doc; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_doc=1 - - -;; #( -n|N|no|No|NO) - DX_FLAG_doc=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_doc=1 - - - -fi - -if test "$DX_FLAG_doc" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. -set dummy ${ac_tool_prefix}doxygen; 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_DX_DOXYGEN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # 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_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN -if test -n "$DX_DOXYGEN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 -$as_echo "$DX_DOXYGEN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOXYGEN"; then - ac_pt_DX_DOXYGEN=$DX_DOXYGEN - # Extract the first word of "doxygen", so it can be a program name with args. -set dummy doxygen; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_DOXYGEN+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN -if test -n "$ac_pt_DX_DOXYGEN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 -$as_echo "$ac_pt_DX_DOXYGEN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_DOXYGEN" = x; then - DX_DOXYGEN="" - 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 - DX_DOXYGEN=$ac_pt_DX_DOXYGEN - fi -else - DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" -fi - -if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 -$as_echo "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. -set dummy ${ac_tool_prefix}perl; 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_DX_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PERL="$DX_PERL" # 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_DX_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PERL=$ac_cv_path_DX_PERL -if test -n "$DX_PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 -$as_echo "$DX_PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PERL"; then - ac_pt_DX_PERL=$DX_PERL - # Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL -if test -n "$ac_pt_DX_PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 -$as_echo "$ac_pt_DX_PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_PERL" = x; then - DX_PERL="" - 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 - DX_PERL=$ac_pt_DX_PERL - fi -else - DX_PERL="$ac_cv_path_DX_PERL" -fi - -if test "$DX_FLAG_doc$DX_PERL" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 -$as_echo "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} - DX_FLAG_doc=0 - -fi - - : -fi -if test "$DX_FLAG_doc" = 1; then - if :; then - DX_COND_doc_TRUE= - DX_COND_doc_FALSE='#' -else - DX_COND_doc_TRUE='#' - DX_COND_doc_FALSE= -fi - - DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" - - : -else - if false; then - DX_COND_doc_TRUE= - DX_COND_doc_FALSE='#' -else - DX_COND_doc_TRUE='#' - DX_COND_doc_FALSE= -fi - - - : -fi - - -# Dot for graphics: - - - - # Check whether --enable-doxygen-dot was given. -if test "${enable_doxygen_dot+set}" = set; then : - enableval=$enable_doxygen_dot; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_dot=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-dot requires doxygen-dot" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_dot=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_dot=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 - - - -fi - -if test "$DX_FLAG_dot" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. -set dummy ${ac_tool_prefix}dot; 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_DX_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DOT="$DX_DOT" # 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_DX_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DOT=$ac_cv_path_DX_DOT -if test -n "$DX_DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 -$as_echo "$DX_DOT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DOT"; then - ac_pt_DX_DOT=$DX_DOT - # Extract the first word of "dot", so it can be a program name with args. -set dummy dot; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT -if test -n "$ac_pt_DX_DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 -$as_echo "$ac_pt_DX_DOT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_DOT" = x; then - DX_DOT="" - 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 - DX_DOT=$ac_pt_DX_DOT - fi -else - DX_DOT="$ac_cv_path_DX_DOT" -fi - -if test "$DX_FLAG_dot$DX_DOT" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 -$as_echo "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} - DX_FLAG_dot=0 - -fi - - : -fi -if test "$DX_FLAG_dot" = 1; then - if :; then - DX_COND_dot_TRUE= - DX_COND_dot_FALSE='#' -else - DX_COND_dot_TRUE='#' - DX_COND_dot_FALSE= -fi - - DX_ENV="$DX_ENV HAVE_DOT='YES'" - - DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" - - : -else - if false; then - DX_COND_dot_TRUE= - DX_COND_dot_FALSE='#' -else - DX_COND_dot_TRUE='#' - DX_COND_dot_FALSE= -fi - - DX_ENV="$DX_ENV HAVE_DOT='NO'" - - : -fi - - -# Man pages generation: - - - - # Check whether --enable-doxygen-man was given. -if test "${enable_doxygen_man+set}" = set; then : - enableval=$enable_doxygen_man; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_man=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-man requires doxygen-man" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_man=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_man=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 - - - -fi - -if test "$DX_FLAG_man" = 1; then - - : -fi -if test "$DX_FLAG_man" = 1; then - if :; then - DX_COND_man_TRUE= - DX_COND_man_FALSE='#' -else - DX_COND_man_TRUE='#' - DX_COND_man_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_MAN='YES'" - - : -else - if false; then - DX_COND_man_TRUE= - DX_COND_man_FALSE='#' -else - DX_COND_man_TRUE='#' - DX_COND_man_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_MAN='NO'" - - : -fi - - -# RTF file generation: - - - - # Check whether --enable-doxygen-rtf was given. -if test "${enable_doxygen_rtf+set}" = set; then : - enableval=$enable_doxygen_rtf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_rtf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-rtf requires doxygen-rtf" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_rtf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_rtf=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 - - - -fi - -if test "$DX_FLAG_rtf" = 1; then - - : -fi -if test "$DX_FLAG_rtf" = 1; then - if :; then - DX_COND_rtf_TRUE= - DX_COND_rtf_FALSE='#' -else - DX_COND_rtf_TRUE='#' - DX_COND_rtf_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_RTF='YES'" - - : -else - if false; then - DX_COND_rtf_TRUE= - DX_COND_rtf_FALSE='#' -else - DX_COND_rtf_TRUE='#' - DX_COND_rtf_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_RTF='NO'" - - : -fi - - -# XML file generation: - - - - # Check whether --enable-doxygen-xml was given. -if test "${enable_doxygen_xml+set}" = set; then : - enableval=$enable_doxygen_xml; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_xml=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-xml requires doxygen-xml" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_xml=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_xml=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 - - - -fi - -if test "$DX_FLAG_xml" = 1; then - - : -fi -if test "$DX_FLAG_xml" = 1; then - if :; then - DX_COND_xml_TRUE= - DX_COND_xml_FALSE='#' -else - DX_COND_xml_TRUE='#' - DX_COND_xml_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_XML='YES'" - - : -else - if false; then - DX_COND_xml_TRUE= - DX_COND_xml_FALSE='#' -else - DX_COND_xml_TRUE='#' - DX_COND_xml_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_XML='NO'" - - : -fi - - -# (Compressed) HTML help generation: - - - - # Check whether --enable-doxygen-chm was given. -if test "${enable_doxygen_chm+set}" = set; then : - enableval=$enable_doxygen_chm; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chm=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-chm requires doxygen-chm" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chm=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_chm=0 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 - - - -fi - -if test "$DX_FLAG_chm" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. -set dummy ${ac_tool_prefix}hhc; 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_DX_HHC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_HHC="$DX_HHC" # 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_DX_HHC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_HHC=$ac_cv_path_DX_HHC -if test -n "$DX_HHC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 -$as_echo "$DX_HHC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_HHC"; then - ac_pt_DX_HHC=$DX_HHC - # Extract the first word of "hhc", so it can be a program name with args. -set dummy hhc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_HHC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_HHC in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_HHC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC -if test -n "$ac_pt_DX_HHC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 -$as_echo "$ac_pt_DX_HHC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_HHC" = x; then - DX_HHC="" - 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 - DX_HHC=$ac_pt_DX_HHC - fi -else - DX_HHC="$ac_cv_path_DX_HHC" -fi - -if test "$DX_FLAG_chm$DX_HHC" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 -$as_echo "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} - DX_FLAG_chm=0 - -fi - - : -fi -if test "$DX_FLAG_chm" = 1; then - if :; then - DX_COND_chm_TRUE= - DX_COND_chm_FALSE='#' -else - DX_COND_chm_TRUE='#' - DX_COND_chm_FALSE= -fi - - DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" - - DX_ENV="$DX_ENV GENERATE_HTML='YES'" - - DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" - - : -else - if false; then - DX_COND_chm_TRUE= - DX_COND_chm_FALSE='#' -else - DX_COND_chm_TRUE='#' - DX_COND_chm_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" - - : -fi - - -# Seperate CHI file generation. - - - - # Check whether --enable-doxygen-chi was given. -if test "${enable_doxygen_chi+set}" = set; then : - enableval=$enable_doxygen_chi; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_chi=1 - - -test "$DX_FLAG_chm" = "1" \ -|| as_fn_error $? "doxygen-chi requires doxygen-chi" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_chi=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_chi=0 - - -test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 - - - -fi - -if test "$DX_FLAG_chi" = 1; then - - : -fi -if test "$DX_FLAG_chi" = 1; then - if :; then - DX_COND_chi_TRUE= - DX_COND_chi_FALSE='#' -else - DX_COND_chi_TRUE='#' - DX_COND_chi_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_CHI='YES'" - - : -else - if false; then - DX_COND_chi_TRUE= - DX_COND_chi_FALSE='#' -else - DX_COND_chi_TRUE='#' - DX_COND_chi_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_CHI='NO'" - - : -fi - - -# Plain HTML pages generation: - - - - # Check whether --enable-doxygen-html was given. -if test "${enable_doxygen_html+set}" = set; then : - enableval=$enable_doxygen_html; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-html requires doxygen-html" "$LINENO" 5 - -test "$DX_FLAG_chm" = "0" \ -|| as_fn_error $? "doxygen-html contradicts doxygen-html" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_html=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_html=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 - - -test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 - - - -fi - -if test "$DX_FLAG_html" = 1; then - - : -fi -if test "$DX_FLAG_html" = 1; then - if :; then - DX_COND_html_TRUE= - DX_COND_html_FALSE='#' -else - DX_COND_html_TRUE='#' - DX_COND_html_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_HTML='YES'" - - : -else - if false; then - DX_COND_html_TRUE= - DX_COND_html_FALSE='#' -else - DX_COND_html_TRUE='#' - DX_COND_html_FALSE= -fi - - test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" - - : -fi - - -# PostScript file generation: - - - - # Check whether --enable-doxygen-ps was given. -if test "${enable_doxygen_ps+set}" = set; then : - enableval=$enable_doxygen_ps; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-ps requires doxygen-ps" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_ps=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_ps=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 - - - -fi - -if test "$DX_FLAG_ps" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. -set dummy ${ac_tool_prefix}latex; 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_DX_LATEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_LATEX="$DX_LATEX" # 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_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_LATEX=$ac_cv_path_DX_LATEX -if test -n "$DX_LATEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 -$as_echo "$DX_LATEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_LATEX"; then - ac_pt_DX_LATEX=$DX_LATEX - # Extract the first word of "latex", so it can be a program name with args. -set dummy latex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_LATEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_LATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX -if test -n "$ac_pt_DX_LATEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 -$as_echo "$ac_pt_DX_LATEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_LATEX" = x; then - DX_LATEX="" - 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 - DX_LATEX=$ac_pt_DX_LATEX - fi -else - DX_LATEX="$ac_cv_path_DX_LATEX" -fi - -if test "$DX_FLAG_ps$DX_LATEX" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 -$as_echo "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; 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_DX_MAKEINDEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -$as_echo "$DX_MAKEINDEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_MAKEINDEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -$as_echo "$ac_pt_DX_MAKEINDEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - 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 - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 -$as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. -set dummy ${ac_tool_prefix}dvips; 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_DX_DVIPS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_DVIPS="$DX_DVIPS" # 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_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_DVIPS=$ac_cv_path_DX_DVIPS -if test -n "$DX_DVIPS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 -$as_echo "$DX_DVIPS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_DVIPS"; then - ac_pt_DX_DVIPS=$DX_DVIPS - # Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_DVIPS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS -if test -n "$ac_pt_DX_DVIPS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 -$as_echo "$ac_pt_DX_DVIPS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_DVIPS" = x; then - DX_DVIPS="" - 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 - DX_DVIPS=$ac_pt_DX_DVIPS - fi -else - DX_DVIPS="$ac_cv_path_DX_DVIPS" -fi - -if test "$DX_FLAG_ps$DX_DVIPS" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 -$as_echo "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; 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_DX_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -$as_echo "$DX_EGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -$as_echo "$ac_pt_DX_EGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - 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 - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" -fi - -if test "$DX_FLAG_ps$DX_EGREP" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 -$as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} - DX_FLAG_ps=0 - -fi - - : -fi -if test "$DX_FLAG_ps" = 1; then - if :; then - DX_COND_ps_TRUE= - DX_COND_ps_FALSE='#' -else - DX_COND_ps_TRUE='#' - DX_COND_ps_FALSE= -fi - - - : -else - if false; then - DX_COND_ps_TRUE= - DX_COND_ps_FALSE='#' -else - DX_COND_ps_TRUE='#' - DX_COND_ps_FALSE= -fi - - - : -fi - - -# PDF file generation: - - - - # Check whether --enable-doxygen-pdf was given. -if test "${enable_doxygen_pdf+set}" = set; then : - enableval=$enable_doxygen_pdf; -case "$enableval" in -#( -y|Y|yes|Yes|YES) - DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" \ -|| as_fn_error $? "doxygen-pdf requires doxygen-pdf" "$LINENO" 5 - -;; #( -n|N|no|No|NO) - DX_FLAG_pdf=0 - -;; #( -*) - as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 -;; -esac - -else - -DX_FLAG_pdf=1 - - -test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 - - - -fi - -if test "$DX_FLAG_pdf" = 1; then - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. -set dummy ${ac_tool_prefix}pdflatex; 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_DX_PDFLATEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # 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_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX -if test -n "$DX_PDFLATEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 -$as_echo "$DX_PDFLATEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_PDFLATEX"; then - ac_pt_DX_PDFLATEX=$DX_PDFLATEX - # Extract the first word of "pdflatex", so it can be a program name with args. -set dummy pdflatex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_PDFLATEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_PDFLATEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX -if test -n "$ac_pt_DX_PDFLATEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 -$as_echo "$ac_pt_DX_PDFLATEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_PDFLATEX" = x; then - DX_PDFLATEX="" - 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 - DX_PDFLATEX=$ac_pt_DX_PDFLATEX - fi -else - DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" -fi - -if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 -$as_echo "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. -set dummy ${ac_tool_prefix}makeindex; 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_DX_MAKEINDEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX -if test -n "$DX_MAKEINDEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 -$as_echo "$DX_MAKEINDEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_MAKEINDEX"; then - ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX - # Extract the first word of "makeindex", so it can be a program name with args. -set dummy makeindex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_MAKEINDEX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_MAKEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX -if test -n "$ac_pt_DX_MAKEINDEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 -$as_echo "$ac_pt_DX_MAKEINDEX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_MAKEINDEX" = x; then - DX_MAKEINDEX="" - 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 - DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX - fi -else - DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" -fi - -if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 -$as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. -set dummy ${ac_tool_prefix}egrep; 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_DX_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_DX_EGREP="$DX_EGREP" # 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DX_EGREP=$ac_cv_path_DX_EGREP -if test -n "$DX_EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 -$as_echo "$DX_EGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_DX_EGREP"; then - ac_pt_DX_EGREP=$DX_EGREP - # Extract the first word of "egrep", so it can be a program name with args. -set dummy egrep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_DX_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_DX_EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP -if test -n "$ac_pt_DX_EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 -$as_echo "$ac_pt_DX_EGREP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_DX_EGREP" = x; then - DX_EGREP="" - 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 - DX_EGREP=$ac_pt_DX_EGREP - fi -else - DX_EGREP="$ac_cv_path_DX_EGREP" -fi - -if test "$DX_FLAG_pdf$DX_EGREP" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 -$as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} - DX_FLAG_pdf=0 - -fi - - : -fi -if test "$DX_FLAG_pdf" = 1; then - if :; then - DX_COND_pdf_TRUE= - DX_COND_pdf_FALSE='#' -else - DX_COND_pdf_TRUE='#' - DX_COND_pdf_FALSE= -fi - - - : -else - if false; then - DX_COND_pdf_TRUE= - DX_COND_pdf_FALSE='#' -else - DX_COND_pdf_TRUE='#' - DX_COND_pdf_FALSE= -fi - - - : -fi - - -# LaTeX generation for PS and/or PDF: -if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then - if :; then - DX_COND_latex_TRUE= - DX_COND_latex_FALSE='#' -else - DX_COND_latex_TRUE='#' - DX_COND_latex_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_LATEX='YES'" - -else - if false; then - DX_COND_latex_TRUE= - DX_COND_latex_FALSE='#' -else - DX_COND_latex_TRUE='#' - DX_COND_latex_FALSE= -fi - - DX_ENV="$DX_ENV GENERATE_LATEX='NO'" - -fi - -# Paper size for PS and/or PDF: - -case "$DOXYGEN_PAPER_SIZE" in -#( -"") - DOXYGEN_PAPER_SIZE="" - -;; #( -a4wide|a4|letter|legal|executive) - DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" - -;; #( -*) - as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 -;; -esac - -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_man=$DX_FLAG_man -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_FLAG_chm=$DX_FLAG_chm -#echo DX_FLAG_chi=$DX_FLAG_chi -#echo DX_FLAG_rtf=$DX_FLAG_rtf -#echo DX_FLAG_xml=$DX_FLAG_xml -#echo DX_FLAG_pdf=$DX_FLAG_pdf -#echo DX_FLAG_ps=$DX_FLAG_ps -#echo DX_ENV=$DX_ENV - - -BLURAY_VERSION_MAJOR=0 - -BLURAY_VERSION_MINOR=5 - -BLURAY_VERSION_MICRO=0 - - -LT_VERSION_INFO="6:0:5" - - - -ac_config_files="$ac_config_files Makefile src/Makefile src/libbluray.pc src/libbluray/bluray-version.h" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${HAVE_WIN32_TRUE}" && test -z "${HAVE_WIN32_FALSE}"; then - as_fn_error $? "conditional \"HAVE_WIN32\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_DARWIN_TRUE}" && test -z "${HAVE_DARWIN_FALSE}"; then - as_fn_error $? "conditional \"HAVE_DARWIN\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USING_EXAMPLES_TRUE}" && test -z "${USING_EXAMPLES_FALSE}"; then - as_fn_error $? "conditional \"USING_EXAMPLES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USING_BDJAVA_TRUE}" && test -z "${USING_BDJAVA_FALSE}"; then - as_fn_error $? "conditional \"USING_BDJAVA\" 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 -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 -fi -if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_dot\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_dot\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_man\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_man\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_xml\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_xml\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_chm\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_chm\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_chi\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_chi\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_html\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_html\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_ps\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_ps\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_latex\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then - as_fn_error $? "conditional \"DX_COND_latex\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# 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 0.5.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_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 0.5.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/libbluray.pc") CONFIG_FILES="$CONFIG_FILES src/libbluray.pc" ;; - "src/libbluray/bluray-version.h") CONFIG_FILES="$CONFIG_FILES src/libbluray/bluray-version.h" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # 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 - shift - for 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 - # 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 '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - 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"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # 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\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="" - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - - - -echo " Summary:" -echo " --------" -echo " BD-J support: $use_bdjava" -if [ $use_bdjava = "yes" ]; then -echo " BD-J type: $BDJ_TYPE" -if test x"$BDJ_BOOTCLASSPATH" != x""; then -echo " BD-J bootclasspath: $BDJ_BOOTCLASSPATH" -fi -fi -echo " Font support (freetype2): $with_freetype" -echo " Metadata support (libxml2): $with_libxml2" -echo " Build examples: $use_examples" - diff -Nru libbluray-0.5.0/configure.ac libbluray-0.8.1/configure.ac --- libbluray-0.5.0/configure.ac 2013-12-21 08:34:24.000000000 +0000 +++ libbluray-0.8.1/configure.ac 2015-05-15 09:25:06.000000000 +0000 @@ -1,7 +1,7 @@ dnl library version number m4_define([bluray_major], 0) -m4_define([bluray_minor], 5) -m4_define([bluray_micro], 0) +m4_define([bluray_minor], 8) +m4_define([bluray_micro], 1) m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro]) dnl shared library version (.so version) @@ -12,9 +12,9 @@ dnl dnl Library file name will be libbluray.so.(current-age).age.revision dnl -m4_define([lt_current], 6) -m4_define([lt_revision], 0) -m4_define([lt_age], 5) +m4_define([lt_current], 9) +m4_define([lt_revision], 1) +m4_define([lt_age], 8) dnl initilization AC_INIT([libbluray], bluray_version, [http://www.videolan.org/developers/libbluray.html]) @@ -24,6 +24,9 @@ AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip subdir-objects]) AC_CONFIG_HEADERS(config.h) +dnl Enable silent rules only when available (automake 1.11 or later). +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + case "${host_os}" in "") SYS=unknown @@ -35,14 +38,19 @@ ;; *mingw32*) SYS=mingw32 - AC_DEFINE([_WIN32_WINNT], 0x0501, [Define to '0x0500' for Windows XP APIs.]) + AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.]) AC_DEFINE([_WIN32_IE], 0x0501, [Define to '0x0501' for IE 5.01.]) + CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1" ;; esac ;; *darwin*) SYS=darwin ;; + netbsd*) + SYS=netbsd + CFLAGS="${CFLAGS} -D_NETBSD_SOURCE" + ;; *) SYS="${host_os}" ;; @@ -56,8 +64,7 @@ function_not_found="Could not find required function!" dnl configure options -AC_ARG_VAR([JDK_HOME], [Path to the JDK @<:@default=/usr/lib/jvm/java-6-openjdk@:>@]) -AS_IF([test -z "$JDK_HOME"], [JDK_HOME="/usr/lib/jvm/java-6-openjdk"]) +AC_ARG_VAR([JDK_HOME], [Path to the JDK]) AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [set warnings as errors via -Werror @<:@default=disabled@:>@])]) @@ -75,10 +82,12 @@ [use_examples=yes]) AC_ARG_ENABLE([bdjava], - [AS_HELP_STRING([--enable-bdjava], - [enable BD-Java support (default is no)])], + [AS_HELP_STRING([--disable-bdjava], [disable BD-Java support @<:@default=enabled@:>@])], [use_bdjava=$enableval], - [use_bdjava=no]) + [use_bdjava=yes]) + +AC_ARG_ENABLE([udf], + [AS_HELP_STRING([--enable-udf], [enable UDF support @<:@default=disabled@:>@])]) AC_ARG_WITH([libxml2], [AS_HELP_STRING([--without-libxml2], [build without libxml2 support @<:@default=with@:>@])]) @@ -86,6 +95,9 @@ AC_ARG_WITH([freetype], [AS_HELP_STRING([--without-freetype], [build without freetype support @<:@default=with@:>@])]) +AC_ARG_WITH([fontconfig], + [AS_HELP_STRING([--without-fontconfig], [build without fontconfig support @<:@default=with@:>@])]) + AC_ARG_WITH([bdj-type], [AS_HELP_STRING([--with-bdj-type=TYPE], [Specify the type of BD-J implementation (j2se, j2me). Default is j2se.])], @@ -145,6 +157,17 @@ AS_IF([test "x$with_freetype" != "xno"], [ PKG_CHECK_MODULES([FT2], [freetype2], [with_freetype=yes; AC_DEFINE([HAVE_FT2], 1, [Define this if you have FreeType2 library])]) + + dnl fontconfig support + AS_IF([test "${SYS}" != "mingw32"], [ + AS_IF([test "x$with_fontconfig" != "xno"], [ + PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], + [with_fontconfig=yes; AC_DEFINE([HAVE_FONTCONFIG], 1, [Define this if you have fontconfig library])]) + ]) + ],[ + FONTCONFIG_LIBS="-lgdi32" + AC_SUBST([FONTCONFIG_LIBS]) + ]) ]) CC_CHECK_CFLAGS_APPEND([-Wall -Wdisabled-optimization -Wpointer-arith ]dnl @@ -176,6 +199,7 @@ case $host_cpu in x86_64) java_arch=amd64 ;; i?86) java_arch=i386 ;; + arm*) java_arch=arm ;; *) java_arch=$host_cpu ;; esac case $host_os in @@ -184,15 +208,25 @@ mingw*) java_os=win32 ;; freebsd*) java_os=freebsd ;; solaris*) java_os=solaris ;; + darwin*) java_os=darwin ;; *) java_os=$host_os ;; esac - BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" + AS_IF([test "x${JDK_HOME}" != "x"], [ + BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os" - temp_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR("Could not find jni.h")]) - CPPFLAGS="$temp_CPPFLAGS" + temp_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS" + AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR(could not find jni.h)]) + CPPFLAGS="$temp_CPPFLAGS" + ], [ + 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$HAVE_ANT" = "xno"; then + AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.]) + fi AC_DEFINE([USING_BDJAVA], [1], ["Define to 1 if using BD-Java"]) AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."]) @@ -210,6 +244,24 @@ dnl bootclasspath AC_SUBST(BDJ_BOOTCLASSPATH) +dnl udf support (using git submodule) +AS_IF([test "x$enable_udf" = "xyes"], [ + if test ! -f "${srcdir}/contrib/libudfread/src/udfread.h"; then + AC_MSG_ERROR("libudfread source tree not found") + fi + AC_CHECK_HEADERS([unistd.h fcntl.h]) + AS_IF([test "${SYS}" != "mingw32"], [ + AC_CHECK_FUNC([pread],, [AC_MSG_ERROR("Function pread not found. Try with --disable-udf.")]) + ]) + + AC_DEFINE([ENABLE_UDF], [1], [Define to 1 if libudfread is to be used for disc image access]) + UDF_CFLAGS='-I${srcdir}/contrib/libudfread/src/' + AC_SUBST(UDF_CFLAGS) + ], + [enable_udf=no]) + +AM_CONDITIONAL([ENABLE_UDF], [test $enable_udf = "yes" ]) + dnl generate documentation DX_INIT_DOXYGEN(libbluray, doc/doxygen-config, [doc/doxygen]) @@ -227,7 +279,7 @@ dnl generate output files AC_SUBST(BDJAVA_CFLAGS) -AC_CONFIG_FILES([Makefile src/Makefile src/libbluray.pc src/libbluray/bluray-version.h]) +AC_CONFIG_FILES([Makefile src/libbluray.pc src/libbluray/bluray-version.h]) AC_OUTPUT @@ -245,6 +297,16 @@ fi fi echo " Font support (freetype2): $with_freetype" +if [[ $with_freetype = "yes" ]]; then +if [[ $use_bdjava = "yes" ]]; then +if test "${SYS}" != "mingw32"; then +echo " Use system fonts (fontconfig): $with_fontconfig" +else +echo " Use system fonts: yes" +fi +fi +fi echo " Metadata support (libxml2): $with_libxml2" +echo " UDF filesystem support: $enable_udf" echo " Build examples: $use_examples" diff -Nru libbluray-0.5.0/contrib/libudfread/src/blockinput.h libbluray-0.8.1/contrib/libudfread/src/blockinput.h --- libbluray-0.5.0/contrib/libudfread/src/blockinput.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/blockinput.h 2015-02-18 09:40:47.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#ifndef UDFREAD_BLOCKINPUT_H_ +#define UDFREAD_BLOCKINPUT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * @file udfread/blockinput.h + * external API header + */ + +#ifndef UDF_BLOCK_SIZE +# define UDF_BLOCK_SIZE 2048 +#endif + +typedef struct udfread_block_input udfread_block_input; + +struct udfread_block_input { + int (*close) (udfread_block_input *); + int (*read) (udfread_block_input *, uint32_t lba, void *buf, uint32_t nblocks, int flags); + uint32_t (*size) (udfread_block_input *); /* size in blocks */ +}; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* UDFREAD_BLOCKINPUT_H_ */ diff -Nru libbluray-0.5.0/contrib/libudfread/src/default_blockinput.c libbluray-0.8.1/contrib/libudfread/src/default_blockinput.c --- libbluray-0.5.0/contrib/libudfread/src/default_blockinput.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/default_blockinput.c 2015-04-06 16:44:35.000000000 +0000 @@ -0,0 +1,153 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "default_blockinput.h" +#include "blockinput.h" + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif + +#ifdef _WIN32 +#include +#include +#endif + + +#ifdef _WIN32 +static ssize_t pread(int fd, void *buf, size_t count, off_t offset) +{ + OVERLAPPED ov; + DWORD got; + HANDLE handle; + + handle = (HANDLE)(intptr_t)_get_osfhandle(fd); + if (handle == INVALID_HANDLE_VALUE) { + return -1; + } + + ov.Offset = offset; + ov.OffsetHigh = (offset >> 32); + if (!ReadFile(handle, buf, count, &got, &ov)) { + return -1; + } + return got; +} +#endif + + +typedef struct default_block_input { + udfread_block_input input; + int fd; +} default_block_input; + + +static int _def_close(udfread_block_input *p_gen) +{ + default_block_input *p = (default_block_input *)p_gen; + int result = -1; + + if (p) { + if (p->fd >= 0) { + result = close(p->fd); + } + free(p); + } + + return result; +} + +static uint32_t _def_size(udfread_block_input *p_gen) +{ + default_block_input *p = (default_block_input *)p_gen; + off_t pos; + + pos = lseek(p->fd, 0, SEEK_END); + if (pos < 0) { + return 0; + } + + return (uint32_t)(pos / UDF_BLOCK_SIZE); +} + +static int _def_read(udfread_block_input *p_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags) +{ + (void)flags; + default_block_input *p = (default_block_input *)p_gen; + + size_t bytes, got; + off_t pos; + + bytes = (size_t)nblocks * UDF_BLOCK_SIZE; + got = 0; + pos = (off_t)lba * UDF_BLOCK_SIZE; + + while (got < bytes) { + ssize_t ret = pread(p->fd, ((char*)buf) + got, bytes - got, pos + got); + + if (ret <= 0) { + if (ret < 0 && errno == EINTR) { + continue; + } + if (got < UDF_BLOCK_SIZE) { + return ret; + } + break; + } + got += ret; + } + + return got / UDF_BLOCK_SIZE; +} + +udfread_block_input *block_input_new(const char *path) +{ + default_block_input *p = (default_block_input*)calloc(1, sizeof(default_block_input)); + if (!p) { + return NULL; + } + +#ifdef _WIN32 + p->fd = open(path, O_RDONLY | O_BINARY); +#else + p->fd = open(path, O_RDONLY); +#endif + if(p->fd < 0) { + free(p); + return NULL; + } + + p->input.close = _def_close; + p->input.read = _def_read; + p->input.size = _def_size; + + return &p->input; +} diff -Nru libbluray-0.5.0/contrib/libudfread/src/default_blockinput.h libbluray-0.8.1/contrib/libudfread/src/default_blockinput.h --- libbluray-0.5.0/contrib/libudfread/src/default_blockinput.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/default_blockinput.h 2015-02-12 09:58:48.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#ifndef UDFREAD_DEFAULT_BLOCKINPUT_H_ +#define UDFREAD_DEFAULT_BLOCKINPUT_H_ + +#include "blockinput.h" + + +udfread_block_input *block_input_new(const char *path); + +#endif /* UDFREAD_DEFAULT_BLOCKINPUT_H_ */ diff -Nru libbluray-0.5.0/contrib/libudfread/src/ecma167.c libbluray-0.8.1/contrib/libudfread/src/ecma167.c --- libbluray-0.5.0/contrib/libudfread/src/ecma167.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/ecma167.c 2015-02-28 19:15:40.000000000 +0000 @@ -0,0 +1,323 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#include "ecma167.h" + +#include +#include +#include + +#include +#define ecma_error(...) fprintf(stderr, "ecma: " __VA_ARGS__) + +/* + * Part 1: General + */ + +/* fixed-length dstring, ECMA 1/7.2.12 */ +static int _decode_dstring(const uint8_t *p, int field_length, uint8_t *str) +{ + int length = _get_u8(p + field_length - 1); + if (length > field_length - 1) { + length = field_length - 1; + } + memcpy(str, p, length); + return length; +} + +/* Extent Descriptor (ECMA 167, 3/7.1) */ +static void _decode_extent_ad(const uint8_t *p, struct extent_ad *ad) +{ + ad->length = _get_u32(p + 0); + ad->lba = _get_u32(p + 4); +} + +/* Entity Identifier (ECMA 167, 1/7.4) */ +void decode_entity_id(const uint8_t *p, struct entity_id *eid) +{ + memcpy(eid->identifier, p + 1, 23); + memcpy(eid->identifier_suffix, p + 24, 8); +} + +/* + * Part 3: Volume Structure + */ + +#define AD_LENGTH_MASK 0x3fffffff + +/* Descriptor Tag (ECMA 167, 3/7.2) */ +enum tag_identifier decode_descriptor_tag(const uint8_t *buf) +{ + uint16_t id; + uint8_t checksum = 0; + int i; + + id = _get_u16(buf + 0); + + /* descriptor tag is 16 bytes */ + + /* calculate tag checksum */ + for (i = 0; i < 4; i++) { + checksum += buf[i]; + } + for (i = 5; i < 16; i++) { + checksum += buf[i]; + } + + if (checksum != buf[4]) { + return ECMA_TAG_NONE; + } + + return (enum tag_identifier)id; +} + +/* Primary Volume Descriptor (ECMA 167, 3/10.1) */ +void decode_primary_volume(const uint8_t *p, struct primary_volume_descriptor *pvd) +{ + pvd->volume_identifier_length = _decode_dstring(p + 24, 32, pvd->volume_identifier); + + memcpy(pvd->volume_set_identifier, p + 72, 128); +} + +/* Anchor Volume Description Pointer (ECMA 167 3/10.2) */ +void decode_avdp(const uint8_t *p, struct anchor_volume_descriptor *avdp) +{ + /* Main volume descriptor sequence extent */ + _decode_extent_ad(p + 16, &avdp->mvds); + + /* Reserve (backup) volume descriptor sequence extent */ + _decode_extent_ad(p + 24, &avdp->rvds); +} + +/* Partition Descriptor (ECMA 167 3/10.5) */ +void decode_partition(const uint8_t *p, struct partition_descriptor *pd) +{ + pd->number = _get_u16(p + 22); + pd->start_block = _get_u32(p + 188); + pd->num_blocks = _get_u32(p + 192); +} + +/* Logical Volume Descriptor (ECMA 167 3/10.6) */ +void decode_logical_volume(const uint8_t *p, struct logical_volume_descriptor *lvd) +{ + lvd->block_size = _get_u32(p + 212); + + decode_entity_id(p + 216, &lvd->domain_id); + + memcpy(lvd->contents_use, p + 248, 16); + + lvd->partition_map_lable_length = _get_u32(p + 264); + lvd->num_partition_maps = _get_u32(p + 268); + + /* XXX cut long maps */ + uint32_t map_size = lvd->partition_map_lable_length; + if (map_size > sizeof(lvd->partition_map_table)) { + map_size = sizeof(lvd->partition_map_table); + } + + memcpy(lvd->partition_map_table, p + 440, map_size); +} + +/* + * Part 4: File Structure + */ + +/* File Set Descriptor (ECMA 167 4/14.1) */ +void decode_file_set_descriptor(const uint8_t *p, struct file_set_descriptor *fsd) +{ + decode_long_ad(p + 400, &fsd->root_icb); +} + +/* File Identifier (ECMA 167 4/14.4) */ +size_t decode_file_identifier(const uint8_t *p, struct file_identifier *fi) +{ + uint16_t l_iu; /* length of implementation use field */ + + fi->characteristic = _get_u8(p + 18); + fi->filename_len = _get_u8(p + 19); + decode_long_ad(p + 20, &fi->icb); + + l_iu = _get_u16(p + 36); + + if (fi->filename_len) { + memcpy(fi->filename, p + 38 + l_iu, fi->filename_len); + } + fi->filename[fi->filename_len] = 0; + + /* ECMA 167, 4/14.4 + * padding size 4 * ip((L_FI+L_IU+38+3)/4) - (L_FI+L_IU+38) + * => padded to dwords + */ + return 4 * ((38 + fi->filename_len + l_iu + 3) / 4); +} + +/* ICB Tag (ECMA 167 4/14.6) */ + +struct icb_tag { + uint8_t file_type; + uint16_t strategy_type; + uint16_t flags; +}; + +static void _decode_icb_tag(const uint8_t *p, struct icb_tag *tag) +{ + tag->strategy_type = _get_u16(p + 4); + tag->file_type = _get_u8 (p + 11); + tag->flags = _get_u16(p + 18); +} + +/* Short Allocation Descriptor (ECMA 167, 4/14.14.1) */ +static void _decode_short_ad(const uint8_t *buf, uint16_t partition, struct long_ad *ad) +{ + ad->length = _get_u32(buf + 0) & AD_LENGTH_MASK; + ad->lba = _get_u32(buf + 4); + ad->partition = partition; +} + +/* Long Allocation Descriptor (ECMA 167, 4/14.14.2) */ +void decode_long_ad(const uint8_t *buf, struct long_ad *ad) +{ + ad->length = _get_u32(buf + 0) & AD_LENGTH_MASK; + ad->lba = _get_u32(buf + 4); + ad->partition = _get_u16(buf + 8); +} + +/* Exrtended Allocation Descriptor (ECMA 167, 4/14.14.3) */ +static void _decode_extended_ad(const uint8_t *buf, struct long_ad *ad) +{ + ad->length = _get_u32(buf + 0) & AD_LENGTH_MASK; + ad->lba = _get_u32(buf + 12); + ad->partition = _get_u16(buf + 16); +} + +/* File Entry */ + +static void _decode_file_ads(const uint8_t *p, int flags, uint16_t partition, struct file_entry *fe) +{ + uint32_t i; + + flags &= 7; + for (i = 0; i < fe->num_ad; i++) { + switch (flags) { + case 0: + _decode_short_ad(p, partition, &fe->data.ad[i]); + p += 8; + break; + case 1: + decode_long_ad(p, &fe->data.ad[i]); + p += 16; + break; + case 2: + _decode_extended_ad(p, &fe->data.ad[i]); + p += 20; + break; + } + } +} + +static struct file_entry *_decode_file_entry(const uint8_t *p, size_t size, + uint16_t partition, uint32_t l_ad, uint32_t p_ad) +{ + struct file_entry *fe; + struct icb_tag tag; + int num_ad; + int content_inline = 0; + + if (p_ad + l_ad > size) { + ecma_error("not enough data in file entry\n"); + return NULL; + } + + _decode_icb_tag(p + 16, &tag); + if (tag.strategy_type != 4) { + /* UDF (2.): only ICB strategy types 4 and 4096 shall be recorded */ + ecma_error("unsupported icb strategy type %d\n", tag.strategy_type); + return NULL; + } + + switch (tag.flags & 7) { + case 0: num_ad = l_ad / 8; break; + case 1: num_ad = l_ad / 16; break; + case 2: num_ad = l_ad / 20; break; + case 3: + num_ad = 0; + content_inline = 1; + break; + default: + ecma_error("unsupported icb flags: 0x%x\n", tag.flags); + return NULL; + } + + if (content_inline) { + fe = (struct file_entry *)calloc(1, sizeof(struct file_entry) + l_ad); + } else { + fe = (struct file_entry *)calloc(1, sizeof(struct file_entry) + sizeof(struct long_ad) * (num_ad - 1)); + } + + if (!fe) { + return NULL; + } + + fe->file_type = tag.file_type; + fe->length = _get_u64(p + 56); + fe->num_ad = num_ad; + + if (content_inline) { + /* data of small files can be embedded in file entry */ + /* copy embedded file data */ + fe->content_inline = 1; + memcpy(fe->data.content, p + p_ad, l_ad); + } else { + _decode_file_ads(p + p_ad, tag.flags, partition, fe); + } + + return fe; +} + +/* File Entry (ECMA 167, 4/14.9) */ +struct file_entry *decode_file_entry(const uint8_t *p, size_t size, uint16_t partition) +{ + uint32_t l_ea, l_ad; + + l_ea = _get_u32(p + 168); + l_ad = _get_u32(p + 172); + + return _decode_file_entry(p, size, partition, l_ad, 176 + l_ea); +} + +/* Extended File Entry (ECMA 167, 4/14.17) */ +struct file_entry *decode_ext_file_entry(const uint8_t *p, size_t size, uint16_t partition) +{ + uint32_t l_ea, l_ad; + + l_ea = _get_u32(p + 208); + l_ad = _get_u32(p + 212); + + return _decode_file_entry(p, size, partition, l_ad, 216 + l_ea); +} + +void free_file_entry(struct file_entry **p_fe) +{ + if (p_fe) { + free(*p_fe); + *p_fe = NULL; + } +} diff -Nru libbluray-0.5.0/contrib/libudfread/src/ecma167.h libbluray-0.8.1/contrib/libudfread/src/ecma167.h --- libbluray-0.5.0/contrib/libudfread/src/ecma167.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/ecma167.h 2015-02-12 09:58:48.000000000 +0000 @@ -0,0 +1,218 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#ifndef UDFREAD_ECMA167_H_ +#define UDFREAD_ECMA167_H_ + +#include /* *int_t */ +#include /* size_t */ + +/* + * Minimal implementation of ECMA-167: + * Volume and File Structure for Write-Once and Rewritable + * Media using Non-Sequential Recording for Information Interchange + * + * Based on 3rd Edition, June 1997 + * http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-167.pdf + * + */ + +/* + * Part 1: General + */ + +/* Numerical Values (ECMA 167, 1/7.1) */ + +static inline uint32_t _get_u8(const uint8_t *p) +{ + return (uint32_t)p[0]; +} + +static inline uint32_t _get_u16(const uint8_t *p) +{ + return _get_u8(p) | (_get_u8(p + 1) << 8); +} + +static inline uint32_t _get_u32(const uint8_t *p) +{ + return _get_u16(p) | (_get_u16(p + 2) << 16); +} + +static inline uint64_t _get_u64(const uint8_t *p) +{ + return (uint64_t)_get_u32(p) | ((uint64_t)_get_u32(p + 4) << 32); +} + +/* Entity Identifier (ECMA 167, 1/7.4) */ + +struct entity_id { + uint8_t identifier[23]; + uint8_t identifier_suffix[8]; +}; + +void decode_entity_id(const uint8_t *p, struct entity_id *eid); + +/* + * Part 3: Volume Structure + */ + +/* Extent Descriptor (ECMA 167, 3/7.1) */ + +struct extent_ad { + uint32_t lba; + uint32_t length; /* in bytes */ +}; + +/* Descriptor Tag (ECMA 167, 3/7.2) */ + +enum tag_identifier { + /* ECMA 167, 3/7.2.1) */ + ECMA_PrimaryVolumeDescriptor = 1, + ECMA_AnchorVolumeDescriptorPointer = 2, + ECMA_PartitionDescriptor = 5, + ECMA_LogicalVolumeDescriptor = 6, + ECMA_TerminatingDescriptor = 8, + + /* ECMA 167, 4/7.2.1 */ + ECMA_FileSetDescriptor = 256, + ECMA_FileIdentifierDescriptor = 257, + ECMA_FileEntry = 261, + ECMA_ExtendedFileEntry = 266, + + ECMA_TAG_NONE = -1, +}; + +enum tag_identifier decode_descriptor_tag(const uint8_t *buf); + +/* Primary Volume Descriptor (ECMA 167, 3/10.1) */ + +struct primary_volume_descriptor { + uint8_t volume_identifier[31]; + uint8_t volume_identifier_length; + uint8_t volume_set_identifier[128]; +}; + +void decode_primary_volume(const uint8_t *p, struct primary_volume_descriptor *pvd); + +/* Anchor Volume Descriptor (ECMA 167, 3/10.2) */ + +struct anchor_volume_descriptor { + struct extent_ad mvds; /* Main Volume Descriptor Sequence extent */ + struct extent_ad rvds; /* Reserve Volume Descriptor Sequence extent */ +}; + +void decode_avdp(const uint8_t *p, struct anchor_volume_descriptor *avdp); + +/* Partition Descriptor (ECMA 167, 3/10.5) */ + +struct partition_descriptor { + uint16_t number; + uint32_t start_block; + uint32_t num_blocks; +}; + +void decode_partition(const uint8_t *p, struct partition_descriptor *pd); + +/* Logical Volume Descriptor (ECMA 167, 3/10.6) */ + +struct logical_volume_descriptor { + uint32_t block_size; + struct entity_id domain_id; + uint8_t contents_use[16]; + + uint32_t num_partition_maps; + uint32_t partition_map_lable_length; + uint8_t partition_map_table[2048]; +}; + +void decode_logical_volume(const uint8_t *p, struct logical_volume_descriptor *lvd); + +/* + * Part 4: File Structure + */ + +/* Short/Long/Extended Allocation Descriptor (ECMA 167, 4/14.14.[1,2,3]) */ + +struct long_ad { + uint32_t lba; /* start block, relative to partition start */ + uint32_t length; /* in bytes */ + uint16_t partition; +}; + +void decode_long_ad(const uint8_t *p, struct long_ad *ad); + +/* File Set Descriptor (ECMA 167 4/14.1) */ + +struct file_set_descriptor { + struct long_ad root_icb; +}; + +void decode_file_set_descriptor(const uint8_t *p, struct file_set_descriptor *fsd); + +/* File Identifier (ECMA 167 4/14.4) */ + +enum { + CHAR_FLAG_HIDDEN = 0x01, + CHAR_FLAG_DIR = 0x02, + CHAR_FLAG_DELETED = 0x04, + CHAR_FLAG_PARENT = 0x08, +}; + +struct file_identifier { + struct long_ad icb; + uint8_t characteristic; /* CHAR_FLAG_* */ + uint8_t filename_len; + uint8_t filename[256]; +}; + +size_t decode_file_identifier(const uint8_t *p, struct file_identifier *fi); + +/* File Entry (ECMA 167, 4/14.9) */ +/* Extended File Entry (ECMA 167, 4/14.17) */ + +enum { + /* ECMA 167, 14.6.6 File Type */ + ECMA_FT_UNSPECIFIED = 0, + ECMA_FT_INDIRECT = 3, + ECMA_FT_DIR = 4, + ECMA_FT_BYTESTREAM = 5, /* random-access byte stream - regular file - udf 2.60, 2.3.5.2 */ + ECMA_FT_TERMINAL_ENTRY = 11, + ECMA_FT_SYMLINK = 12, +}; + +struct file_entry { + uint64_t length; /* in bytes */ + uint8_t file_type; /* ECMA_FT_* */ + uint8_t content_inline; /* 1 if file data is embedded in file entry */ + + uint32_t num_ad; + union { + struct long_ad ad[1]; /* Most files have only single extent, files in 3D BDs can have 100+. */ + uint8_t content[1]; /* content of small files is embedded here */ + } data; +}; + +struct file_entry *decode_file_entry (const uint8_t *p, size_t size, uint16_t partition); +struct file_entry *decode_ext_file_entry(const uint8_t *p, size_t size, uint16_t partition); +void free_file_entry (struct file_entry **p_fe); + + +#endif /* UDFREAD_ECMA167_H_ */ diff -Nru libbluray-0.5.0/contrib/libudfread/src/udfread.c libbluray-0.8.1/contrib/libudfread/src/udfread.c --- libbluray-0.5.0/contrib/libudfread/src/udfread.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/udfread.c 2015-05-15 09:37:59.000000000 +0000 @@ -0,0 +1,1519 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "udfread.h" + +#include "blockinput.h" +#include "default_blockinput.h" +#include "ecma167.h" + +#include +#include +#include + +#ifdef _WIN32 +#define strtok_r strtok_s +#endif + + +/* + * Logging + */ + +#include + +static int enable_log = 0; +static int enable_trace = 0; + +#define udf_error(...) do { fprintf(stderr, "udfread ERROR: " __VA_ARGS__); } while (0) +#define udf_log(...) do { if (enable_log) fprintf(stderr, "udfread LOG : " __VA_ARGS__); } while (0) +#define udf_trace(...) do { if (enable_trace) fprintf(stderr, "udfread TRACE: " __VA_ARGS__); } while (0) + + +/* + * atomic operations + */ + +#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || (defined (__clang__) && (defined (__x86_64__) || defined (__i386__))) + +# define atomic_pointer_compare_and_exchange(atomic, oldval, newval) \ + __sync_bool_compare_and_swap((atomic), (oldval), (newval)) + +#elif defined(_WIN32) + +#include + +static int atomic_pointer_compare_and_exchange(void *atomic, void *oldval, void *newval) +{ + static int init = 0; + static CRITICAL_SECTION cs = {0}; + if (!init) { + init = 1; + InitializeCriticalSection(&cs); + } + int result; + EnterCriticalSection(&cs); + result = *(void**)atomic == oldval; + if (result) { + *(void**)atomic = newval; + } + LeaveCriticalSection(&cs); + return result; +} + +#elif defined(HAVE_PTHREAD_H) + +#include + +static int atomic_pointer_compare_and_exchange(void *atomic, void *oldval, void *newval) +{ + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + int result; + pthread_mutex_lock(&lock); + result = *(void**)atomic == oldval; + if (result) { + *(void**)atomic = newval; + } + pthread_mutex_unlock(&lock); + return result; +} + +#else +# error no atomic operation support +#endif + + +/* + * utils + */ + +static char *_str_dup(const char *s) +{ + size_t len = strlen(s); + char *p = (char *)malloc(len + 1); + if (p) { + memcpy(p, s, len + 1); + } else { + udf_error("out of memory\n"); + } + return p; +} + +static void *_safe_realloc(void *p, size_t s) +{ + void *result = realloc(p, s); + if (!result) { + udf_error("out of memory\n"); + free(p); + } + return result; +} + + +/* + * Decoding + */ + +#define utf16lo_to_utf8(out, out_pos, out_size, ch) \ + do { \ + if (ch < 0x80) { \ + out[out_pos++] = ch; \ + } else { \ + out_size++; \ + out = (uint8_t *)_safe_realloc(out, out_size);\ + if (!out) return NULL; \ + \ + out[out_pos++] = 0xc0 | (ch >> 6); \ + out[out_pos++] = 0x80 | (ch & 0x3f); \ + } \ + } while (0) + +#define utf16_to_utf8(out, out_pos, out_size, ch) \ + do { \ + if (ch < 0x7ff) { \ + utf16lo_to_utf8(out, out_pos, out_size, ch); \ + } else { \ + out_size += 2; \ + out = (uint8_t *)_safe_realloc(out, out_size); \ + if (!out) return NULL; \ + \ + out[out_pos++] = 0xe0 | (ch >> 12); \ + out[out_pos++] = 0x80 | ((ch >> 6) & 0x3f); \ + out[out_pos++] = 0x80 | (ch & 0x3f); \ + \ + } \ + } while (0) + +/* Strings, CS0 (UDF 2.1.1) */ +static char *_cs0_to_utf8(const uint8_t *cs0, size_t size) +{ + size_t out_pos = 0; + size_t out_size = size; + size_t i; + uint8_t *out = (uint8_t *)malloc(size); + + if (!out) { + udf_error("out of memory\n"); + return NULL; + } + + switch (cs0[0]) { + case 8: + /*udf_trace("string in utf-8\n");*/ + for (i = 1; i < size; i++) { + utf16lo_to_utf8(out, out_pos, out_size, cs0[i]); + } + break; + case 16: + for (i = 1; i < size; i+=2) { + uint16_t ch = cs0[i + 1] | (cs0[i] << 8); + utf16_to_utf8(out, out_pos, out_size, ch); + } + break; + default: + udf_error("unregonized string encoding %u\n", cs0[0]); + free(out); + return NULL; + } + + out[out_pos] = 0; + return (char*)out; +} + + +/* Domain Identifiers, UDF 2.1.5.2 */ + +static const char lvd_domain_id[] = "*OSTA UDF Compliant"; +static const char meta_domain_id[] = "*UDF Metadata Partition"; + +static int _check_domain_identifier(const struct entity_id *eid, const char *value) +{ + return (!memcmp(value, eid->identifier, strlen(value))) ? 0 : -1; +} + +/* Additional File Types (UDF 2.60, 2.3.5.2) */ + +enum udf_file_type { + UDF_FT_METADATA = 250, + UDF_FT_METADATA_MIRROR = 251, +}; + + +/* + * Block access + * + * read block(s) from absolute lba + */ + +static uint32_t _read_blocks(udfread_block_input *input, + uint32_t lba, void *buf, uint32_t nblocks, + int flags) +{ + int result; + + if (!input || (int)nblocks < 1) { + return 0; + } + + result = input->read(input, lba, buf, nblocks, flags); + + return result < 0 ? 0 : result; +} + +static int _read_descriptor_block(udfread_block_input *input, uint32_t lba, uint8_t *buf) +{ + if (_read_blocks(input, lba, buf, 1, 0) == 1) { + return decode_descriptor_tag(buf); + } + + return -1; +} + + +/* + * Disc probing + */ + +static int _probe_volume(udfread_block_input *input) +{ + /* Volume Recognition (ECMA 167 2/8, UDF 2.60 2.1.7) */ + + static const char bea[] = {'\0', 'B', 'E', 'A', '0', '1', '\1'}; + static const char nsr_02[] = {'\0', 'N', 'S', 'R', '0', '2', '\1'}; + static const char nsr_03[] = {'\0', 'N', 'S', 'R', '0', '3', '\1'}; + static const char tea[] = {'\0', 'T', 'E', 'A', '0', '1', '\1'}; + static const char nul[] = {'\0', '\0', '\0', '\0', '\0', '\0', '\0'}; + + uint8_t buf[UDF_BLOCK_SIZE]; + uint32_t lba; + int bea_seen = 0; + + for (lba = 16; lba < 256; lba++) { + if (_read_blocks(input, lba, buf, 1, 0) == 1) { + + /* Terminating Extended Area Descriptor */ + if (!memcmp(buf, tea, sizeof(tea))) { + udf_error("ECMA 167 Volume Recognition failed (no NSR descriptor)\n"); + return -1; + } + if (!memcmp(buf, nul, sizeof(nul))) { + break; + } + if (!memcmp(buf, bea, sizeof(bea))) { + udf_trace("ECMA 167 Volume, BEA01\n"); + bea_seen++; + } + + if (bea_seen) { + if (!memcmp(buf, nsr_02, sizeof(nsr_02))) { + udf_trace("ECMA 167 Volume, NSR02\n"); + return 0; + } + if (!memcmp(buf, nsr_03, sizeof(nsr_03))) { + udf_trace("ECMA 167 Volume, NSR03\n"); + return 0; + } + } + } + } + + udf_error("ECMA 167 Volume Recognition failed\n"); + return -1; +} + +static int _read_avdp(udfread_block_input *input, struct anchor_volume_descriptor *avdp) +{ + uint8_t buf[UDF_BLOCK_SIZE]; + int tag_id; + uint32_t lba = 256; + + /* + * Find Anchor Volume Descriptor Pointer. + * It is in block 256, last block or (last block - 256) + * (UDF 2.60, 2.2.3) + */ + + /* try block 256 */ + tag_id = _read_descriptor_block(input, lba, buf); + if (tag_id != ECMA_AnchorVolumeDescriptorPointer) { + + /* try last block */ + if (!input->size) { + udf_error("Can't find Anchor Volume Descriptor Pointer\n"); + return -1; + } + + lba = input->size(input) - 1; + tag_id = _read_descriptor_block(input, lba, buf); + if (tag_id != ECMA_AnchorVolumeDescriptorPointer) { + + /* try last block - 256 */ + lba -= 256; + tag_id = _read_descriptor_block(input, lba, buf); + if (tag_id != ECMA_AnchorVolumeDescriptorPointer) { + udf_error("Can't find Anchor Volume Descriptor Pointer\n"); + return -1; + } + } + } + udf_log("Found Anchor Volume Descriptor Pointer from lba %u\n", lba); + + decode_avdp(buf, avdp); + + return 1; +} + + +/* + * Volume structure + */ + +/* Logical Partitions from Logical Volume Descriptor */ +struct udf_partitions { + uint32_t num_partition; + struct { + uint16_t number; + uint32_t lba; + uint32_t mirror_lba; + } p[2]; +}; + +struct volume_descriptor_set { + struct partition_descriptor pd; + struct primary_volume_descriptor pvd; + struct logical_volume_descriptor lvd; +}; + +static int _search_vds(udfread_block_input *input, int part_number, + const struct extent_ad *loc, + struct volume_descriptor_set *vds) + +{ + uint8_t buf[UDF_BLOCK_SIZE]; + int tag_id; + uint32_t lba; + uint32_t end_lba = loc->lba + loc->length / UDF_BLOCK_SIZE; + int have_part = 0, have_lvd = 0, have_pvd = 0; + + udf_trace("reading Volume Descriptor Sequence at lba %u, len %u bytes\n", loc->lba, loc->length); + + /* parse Volume Descriptor Sequence */ + for (lba = loc->lba; lba < end_lba; lba++) { + + tag_id = _read_descriptor_block(input, lba, buf); + + switch (tag_id) { + + case ECMA_PrimaryVolumeDescriptor: + udf_log("Primary Volume Descriptor in lba %u\n", lba); + decode_primary_volume(buf, &vds->pvd); + have_pvd = 1; + break; + + case ECMA_LogicalVolumeDescriptor: + udf_log("Logical volume descriptor in lba %u\n", lba); + decode_logical_volume(buf, &vds->lvd); + have_lvd = 1; + break; + + case ECMA_PartitionDescriptor: + udf_log("Partition Descriptor in lba %u\n", lba); + if (!have_part) { + decode_partition(buf, &vds->pd); + have_part = (part_number < 0 || part_number == vds->pd.number); + udf_log(" partition %u at lba %u, %u blocks\n", vds->pd.number, vds->pd.start_block, vds->pd.num_blocks); + } + break; + + case ECMA_TerminatingDescriptor: + udf_trace("Terminating Descriptor in lba %u\n", lba); + return (have_part && have_lvd) ? 0 : -1; + } + + if (have_part && have_lvd && have_pvd) { + /* got everything interesting, skip rest blocks */ + return 0; + } + } + + return (have_part && have_lvd) ? 0 : -1; +} + +static int _read_vds(udfread_block_input *input, int part_number, + struct volume_descriptor_set *vds) +{ + struct anchor_volume_descriptor avdp; + + /* Find Anchor Volume Descriptor */ + if (_read_avdp(input, &avdp) < 0) { + return -1; + } + + // XXX we could read part of descriptors from main area and rest from backup if both are partially corrupted ... + + /* try to read Main Volume Descriptor Sequence */ + if (!_search_vds(input, part_number, &avdp.mvds, vds)) { + return 0; + } + + /* try to read Backup Volume Descriptor */ + if (!_search_vds(input, part_number, &avdp.rvds, vds)) { + return 0; + } + + udf_error("failed reading Volume Descriptor Sequence\n"); + return -1; +} + +static int _validate_logical_volume(const struct logical_volume_descriptor *lvd, struct long_ad *fsd_loc) +{ + if (lvd->block_size != UDF_BLOCK_SIZE) { + udf_error("incompatible block size %u\n", lvd->block_size); + return -1; + } + + /* UDF 2.60 2.1.5.2 */ + if (_check_domain_identifier(&lvd->domain_id, lvd_domain_id) < 0) { + udf_error("unknown Domain ID in Logical Volume Descriptor: %1.22s\n", lvd->domain_id.identifier); + + } else { + + /* UDF 2.60 2.1.5.3 */ + uint16_t rev = _get_u16(lvd->domain_id.identifier_suffix); + udf_log("Found UDF %x.%02x Logical Volume\n", rev >> 8, rev & 0xff); + + /* UDF 2.60 2.2.4.4 */ + + /* location of File Set Descriptors */ + decode_long_ad(lvd->contents_use, fsd_loc); + + udf_log("File Set Descriptor location: partition %u lba %u (len %u)\n", + fsd_loc->partition, fsd_loc->lba, fsd_loc->length); + } + + return 0; +} + +static int _map_metadata_partition(udfread_block_input *input, + struct udf_partitions *part, + uint32_t lba, uint32_t mirror_lba, + const struct partition_descriptor *pd) +{ + struct file_entry *fe; + uint8_t buf[UDF_BLOCK_SIZE]; + int tag_id; + unsigned int i; + + /* resolve metadata partition location (it is virtual partition inside another partition) */ + udf_trace("Reading metadata file entry: lba %u, mirror lba %u\n", lba, mirror_lba); + + for (i = 0; i < 2; i++) { + + if (i == 0) { + tag_id = _read_descriptor_block(input, pd->start_block + lba, buf); + } else { + tag_id = _read_descriptor_block(input, pd->start_block + mirror_lba, buf); + } + + if (tag_id != ECMA_ExtendedFileEntry) { + udf_error("read metadata file %u: unexpected tag %d\n", i, tag_id); + continue; + } + + fe = decode_ext_file_entry(buf, UDF_BLOCK_SIZE, pd->number); + if (!fe) { + udf_error("parsing metadata file entry %u failed\n", i); + continue; + } + + if (fe->file_type == UDF_FT_METADATA) { + part->p[1].lba = pd->start_block + fe->data.ad[0].lba; + udf_log("metadata file at lba %u\n", part->p[1].lba); + } else if (fe->file_type == UDF_FT_METADATA_MIRROR) { + part->p[1].mirror_lba = pd->start_block + fe->data.ad[0].lba; + udf_log("metadata mirror file at lba %u\n", part->p[1].mirror_lba); + } else { + udf_error("unknown metadata file type %u\n", fe->file_type); + } + + free_file_entry(&fe); + } + + if (!part->p[1].lba && part->p[1].mirror_lba) { + /* failed reading primary location, must use mirror */ + part->p[1].lba = part->p[1].mirror_lba; + part->p[1].mirror_lba = 0; + } + + return part->p[1].lba ? 0 : -1; +} + +static int _parse_udf_partition_maps(udfread_block_input *input, + struct udf_partitions *part, + const struct volume_descriptor_set *vds) +{ + /* parse partition maps + * There should be one type1 partition. + * There may be separate metadata partition. + * metadata partition is virtual partition that is mapped to metadata file. + */ + + const uint8_t *map = vds->lvd.partition_map_table; + const uint8_t *end = map + vds->lvd.partition_map_lable_length; + unsigned int i; + int num_type1_partition = 0; + + udf_log("Partition map count: %u\n", vds->lvd.num_partition_maps); + if (vds->lvd.partition_map_lable_length > sizeof(vds->lvd.partition_map_table)) { + udf_error("partition map table too big !\n"); + end -= vds->lvd.partition_map_lable_length - sizeof(vds->lvd.partition_map_table); + } + + for (i = 0; i < vds->lvd.num_partition_maps && map + 2 < end; i++) { + + /* Partition map, ECMA 167 3/10.7 */ + uint8_t type = _get_u8(map + 0); + uint8_t len = _get_u8(map + 1); + uint16_t ref; + + udf_trace("map %u: type %u\n", i, type); + if (map + len > end) { + udf_error("partition map table too short !\n"); + break; + } + + if (type == 1) { + + /* ECMA 167 Type 1 partition map */ + + ref = _get_u16(map + 4); + udf_log("partition map: %u: type 1 partition, ref %u\n", i, ref); + + if (num_type1_partition) { + udf_error("more than one type1 partitions not supported\n"); + } else if (ref != vds->pd.number) { + udf_error("Logical partition %u refers to another physical partition %u (expected %u)\n", i, ref, vds->pd.number); + } else { + part->num_partition = 1; + part->p[0].number = i; + part->p[0].lba = vds->pd.start_block; + part->p[0].mirror_lba = 0; /* no mirror for data partition */ + + num_type1_partition++; + } + + } else if (type == 2) { + + /* Type 2 partition map, UDF 2.60 2.2.18 */ + + struct entity_id type_id; + decode_entity_id(map + 4, &type_id); + if (!_check_domain_identifier(&type_id, meta_domain_id)) { + + /* Metadata Partition, UDF 2.60 2.2.10 */ + + uint32_t lba, mirror_lba; + + ref = _get_u16(map + 38); + lba = _get_u32(map + 40); + mirror_lba = _get_u32(map + 44); + if (ref != vds->pd.number) { + udf_error("metadata file partition %u != %u\n", ref, vds->pd.number); + } + + if (!_map_metadata_partition(input, part, lba, mirror_lba, &vds->pd)) { + part->num_partition = 2; + part->p[1].number = i; + udf_log("partition map: %u: metadata partition, ref %u. lba %u, mirror %u\n", i, ref, part->p[1].lba, part->p[1].mirror_lba); + } + + } else { + udf_log("%u: unsupported type 2 partition\n", i); + } + } + map += len; + } + + return num_type1_partition ? 0 : -1; +} + + +/* + * Cached directory data + */ + +struct udf_file_identifier { + char *filename; + struct long_ad icb; + uint8_t characteristic; /* CHAR_FLAG_* */ +}; + +struct udf_dir { + uint32_t num_entries; + struct udf_file_identifier *files; + struct udf_dir **subdirs; +}; + +static void _free_dir(struct udf_dir **pp) +{ + if (pp && *pp) { + struct udf_dir *p = *pp; + uint32_t i; + + if (p->subdirs) { + for (i = 0; i < p->num_entries; i++) { + _free_dir(&(p->subdirs[i])); + } + free(p->subdirs); + } + + if (p->files) { + for (i = 0; i < p->num_entries; i++) { + free(p->files[i].filename); + } + free(p->files); + } + + free(p); + + *pp = NULL; + } +} + + +/* + * + */ + +struct udfread { + + udfread_block_input *input; + + /* Volume partitions */ + struct udf_partitions part; + + /* cached directory tree */ + struct udf_dir *root_dir; + + char *volume_identifier; + char volume_set_identifier[128]; + +}; + +udfread *udfread_init(void) +{ + /* set up logging */ + if (getenv("UDFREAD_LOG")) { + enable_log = 1; + } + if (getenv("UDFREAD_TRACE")) { + enable_trace = 1; + enable_log = 1; + } + + return (udfread *)calloc(1, sizeof(udfread)); +} + +/* + * Metadata + */ + +static int _partition_index(udfread *udf, uint16_t partition_number) +{ + if (partition_number == udf->part.p[0].number) { + return 0; + } else if (udf->part.num_partition > 1 && partition_number == udf->part.p[1].number) { + return 1; + } + + udf_error("unknown partition %u\n", partition_number); + return -1; +} + +/* read metadata blocks. If read fails, try from mirror (if available). */ +static int _read_metadata_blocks(udfread *udf, uint8_t *buf, + const struct long_ad *loc) +{ + int tag_id; + uint32_t lba, i, got; + int part_idx; + + udf_trace("reading metadata from part %u lba %u\n", loc->partition, loc->lba); + + part_idx = _partition_index(udf, loc->partition); + if (part_idx < 0) { + return -1; + } + + /* read first block. Parse and check tag. */ + + lba = udf->part.p[part_idx].lba + loc->lba; + tag_id = _read_descriptor_block(udf->input, lba, buf); + + if (tag_id < 0) { + + /* try mirror */ + if (udf->part.p[part_idx].mirror_lba) { + udf_log("read metadata from lba %u failed, trying mirror\n", lba); + lba = udf->part.p[part_idx].mirror_lba + loc->lba; + tag_id = _read_descriptor_block(udf->input, lba, buf); + } + + if (tag_id < 0) { + udf_error("read metadata from lba %u failed\n", lba); + return -1; + } + } + + /* read following blocks without tag parsing and checksum validation */ + + for (i = 1; i <= (loc->length - 1) / UDF_BLOCK_SIZE; i++) { + + lba = udf->part.p[part_idx].lba + loc->lba + i; + buf += UDF_BLOCK_SIZE; + + got = _read_blocks(udf->input, lba, buf, 1, 0); + if (got != 1) { + if (udf->part.p[part_idx].mirror_lba) { + udf_log("read metadata from lba %u failed, trying mirror\n", lba); + lba = udf->part.p[part_idx].mirror_lba + loc->lba + i; + got = _read_blocks(udf->input, lba, buf, 1, 0); + } + if (got != 1) { + udf_error("read metadata from lba %u failed\n", lba); + return -1; + } + } + } + + return tag_id; +} + +static struct file_entry *_read_file_entry(udfread *udf, + const struct long_ad *icb) +{ + struct file_entry *fe = NULL; + uint32_t num_blocks = (icb->length + UDF_BLOCK_SIZE - 1) / UDF_BLOCK_SIZE; + uint8_t *buf; + int tag_id; + + udf_trace("file entry size %u bytes\n", icb->length); + if (num_blocks < 1) { + return NULL; + } + + buf = (uint8_t *)malloc(num_blocks * UDF_BLOCK_SIZE); + if (!buf) { + udf_error("out of memory\n"); + return NULL; + } + + tag_id = _read_metadata_blocks(udf, buf, icb); + if (tag_id < 0) { + udf_error("reading file entry failed\n"); + free(buf); + return NULL; + } + + switch (tag_id) { + case ECMA_FileEntry: + fe = decode_file_entry(buf, UDF_BLOCK_SIZE, icb->partition); + break; + case ECMA_ExtendedFileEntry: + fe = decode_ext_file_entry(buf, UDF_BLOCK_SIZE, icb->partition); + break; + default: + udf_error("_read_file_entry: unknown tag %d\n", tag_id); + break; + } + + free(buf); + return fe; +} + +static int _parse_dir(const uint8_t *data, uint32_t length, struct udf_dir *dir) +{ + struct file_identifier fid; + const uint8_t *p = data; + const uint8_t *end = data + length; + int tag_id; + + while (p < end) { + + tag_id = decode_descriptor_tag(p); + if (tag_id != ECMA_FileIdentifierDescriptor) { + udf_error("unexpected tag %d in directory file\n", tag_id); + return -1; + } + + dir->files = (struct udf_file_identifier *)_safe_realloc(dir->files, sizeof(dir->files[0]) * (dir->num_entries + 1)); + if (!dir->files) { + return -1; + } + + p += decode_file_identifier(p, &fid); + + if (fid.characteristic & CHAR_FLAG_PARENT) { + continue; + } + if (fid.filename_len < 1) { + continue; + } + + dir->files[dir->num_entries].characteristic = fid.characteristic; + dir->files[dir->num_entries].icb = fid.icb; + dir->files[dir->num_entries].filename = _cs0_to_utf8(fid.filename, fid.filename_len); + + if (dir->files[dir->num_entries].filename) { + dir->num_entries++; + } + + } + + return 0; +} + +static struct udf_dir *_read_dir_file(udfread *udf, const struct long_ad *loc) +{ + uint32_t num_blocks = (loc->length + UDF_BLOCK_SIZE - 1) / UDF_BLOCK_SIZE; + uint8_t *data; + struct udf_dir *dir = NULL; + + if (num_blocks < 1) { + return NULL; + } + + data = (uint8_t *)malloc(num_blocks * UDF_BLOCK_SIZE); + if (!data) { + udf_error("out of memory\n"); + return NULL; + } + + if (_read_metadata_blocks(udf, data, loc) < 0) { + udf_error("reading directory file failed\n"); + free(data); + return NULL; + } + + udf_trace("directory size %u bytes\n", loc->length); + + dir = (struct udf_dir *)calloc(1, sizeof(struct udf_dir)); + if (dir) { + if (_parse_dir(data, loc->length, dir) < 0) { + _free_dir(&dir); + } + } + + free(data); + return dir; +} + +static struct udf_dir *_read_dir(udfread *udf, const struct long_ad *icb) +{ + struct file_entry *fe; + struct udf_dir *dir = NULL; + + fe = _read_file_entry(udf, icb); + if (!fe) { + udf_error("error reading directory file entry\n"); + return NULL; + } + + if (fe->file_type != ECMA_FT_DIR) { + udf_error("directory file type is not directory\n"); + free_file_entry(&fe); + return NULL; + } + + if (fe->content_inline) { + dir = (struct udf_dir *)calloc(1, sizeof(struct udf_dir)); + if (dir) { + if (_parse_dir(&fe->data.content[0], fe->length, dir) < 0) { + udf_error("failed parsing inline directory file\n"); + _free_dir(&dir); + } + } + + } else if (fe->num_ad == 0) { + udf_error("empty directory file"); + } else { + dir = _read_dir_file(udf, &fe->data.ad[0]); + } + + free_file_entry(&fe); + return dir; +} + +static int _read_root_dir(udfread *udf, const struct long_ad *fsd_loc) +{ + struct file_set_descriptor fsd; + uint8_t buf[UDF_BLOCK_SIZE]; + int tag_id = -1; + struct long_ad loc = *fsd_loc; + + udf_trace("reading root directory fsd from part %u lba %u\n", fsd_loc->partition, fsd_loc->lba); + + /* search for File Set Descriptor from the area described by fsd_loc */ + + loc.length = UDF_BLOCK_SIZE; + for (; loc.lba <= fsd_loc->lba + (fsd_loc->length - 1) / UDF_BLOCK_SIZE; loc.lba++) { + + tag_id = _read_metadata_blocks(udf, buf, &loc); + if (tag_id == ECMA_FileSetDescriptor) { + break; + } + if (tag_id == ECMA_TerminatingDescriptor) { + break; + } + udf_error("unhandled tag %d in File Set Descriptor area\n", tag_id); + } + if (tag_id != ECMA_FileSetDescriptor) { + udf_error("didn't find File Set Descriptor\n"); + return -1; + } + + decode_file_set_descriptor(buf, &fsd); + udf_log("root directory in part %u lba %u\n", fsd.root_icb.partition, fsd.root_icb.lba); + + /* read root directory from location given in File Set Descriptor */ + + udf->root_dir = _read_dir(udf, &fsd.root_icb); + if (!udf->root_dir) { + udf_error("error reading root directory\n"); + return -1; + } + + return 0; +} + +static struct udf_dir *_read_subdir(udfread *udf, struct udf_dir *dir, uint32_t index) +{ + if (!(dir->files[index].characteristic & CHAR_FLAG_DIR)) { + return NULL; + } + + if (!dir->subdirs) { + struct udf_dir **subdirs = (struct udf_dir **)calloc(sizeof(struct udf_dir *), dir->num_entries); + if (!subdirs) { + udf_error("out of memory\n"); + return NULL; + } + if (!atomic_pointer_compare_and_exchange(&dir->subdirs, NULL, subdirs)) { + free(subdirs); + } + } + + if (!dir->subdirs[index]) { + struct udf_dir *subdir = _read_dir(udf, &dir->files[index].icb); + if (!subdir) { + return NULL; + } + if (!atomic_pointer_compare_and_exchange(&dir->subdirs[index], NULL, subdir)) { + _free_dir(&subdir); + } + } + + return dir->subdirs[index]; +} + +static int _scan_dir(const struct udf_dir *dir, const char *filename) +{ + uint32_t i; + + for (i = 0; i < dir->num_entries; i++) { + if (!strcmp(filename, dir->files[i].filename)) { + return i; + } + } + + udf_log("file %s not found\n", filename); + return -1; +} + +static int _find_file(udfread *udf, const char *path, + const struct udf_dir **p_dir, + const struct udf_file_identifier **p_fid) +{ + const struct udf_file_identifier *fid = NULL; + struct udf_dir *current_dir; + char *tmp_path, *save_ptr, *token; + + current_dir = udf->root_dir; + if (!current_dir) { + return -1; + } + + tmp_path = _str_dup(path); + if (!tmp_path) { + return -1; + } + + token = strtok_r(tmp_path, "/\\", &save_ptr); + if (token == NULL) { + udf_trace("_find_file: requested root dir\n"); + } + + while (token) { + + int index = _scan_dir(current_dir, token); + if (index < 0) { + udf_log("_find_file: entry %s not found\n", token); + goto error; + } + fid = ¤t_dir->files[index]; + + token = strtok_r(NULL, "/\\", &save_ptr); + + if (fid->characteristic & CHAR_FLAG_DIR) { + current_dir = _read_subdir(udf, current_dir, index); + if (!current_dir) { + goto error; + } + } else if (token) { + udf_log("_find_file: entry %s not found (parent is file, not directory)\n", token); + goto error; + } else { + // found a file, make sure we won't return directory data + current_dir = NULL; + } + } + + if (p_fid) { + if (!fid) { + udf_log("no file identifier found for %s\n", path); + goto error; + } + *p_fid = fid; + } + if (p_dir) { + *p_dir = current_dir; + } + + free(tmp_path); + return 0; + +error: + free(tmp_path); + return -1; +} + + +/* + * Volume access API + */ + +int udfread_open_input(udfread *udf, udfread_block_input *input/*, int partition*/) +{ + struct volume_descriptor_set vds; + struct long_ad fsd_location; + + if (!udf || !input) { + return -1; + } + + if (_probe_volume(input) < 0) { + return -1; + } + + /* read Volume Descriptor Sequence */ + if (_read_vds(input, 0, &vds) < 0) { + return -1; + } + + /* validate logical volume structure */ + if (_validate_logical_volume(&vds.lvd, &fsd_location) < 0) { + return -1; + } + + /* Volume Identifier. CS0, UDF 2.1.1 */ + udf->volume_identifier = _cs0_to_utf8(vds.pvd.volume_identifier, vds.pvd.volume_identifier_length); + + memcpy(udf->volume_set_identifier, vds.pvd.volume_set_identifier, 128); + udf_log("Volume Identifier: %s\n", udf->volume_identifier); + + /* map partitions */ + if (_parse_udf_partition_maps(input, &udf->part, &vds) < 0) { + return -1; + } + + /* Read root directory */ + udf->input = input; + if (_read_root_dir(udf, &fsd_location) < 0) { + udf->input = NULL; + return -1; + } + + return 0; +} + +int udfread_open(udfread *udf, const char *path) +{ + udfread_block_input *input; + int result; + + input = block_input_new(path); + if (!input) { + return -1; + } + + result = udfread_open_input(udf, input); + if (result < 0) { + input->close(input); + } + + return result; +} + +void udfread_close(udfread *udf) +{ + if (udf) { + if (udf->input) { + udf->input->close(udf->input); + udf->input = NULL; + } + + _free_dir(&udf->root_dir); + free(udf->volume_identifier); + free(udf); + } +} + +const char *udfread_get_volume_id(udfread *udf) +{ + if (udf) { + return udf->volume_identifier; + } + return NULL; +} + +size_t udfread_get_volume_set_id (udfread *udf, void *buffer, size_t size) +{ + if (udf) { + if (size > sizeof(udf->volume_set_identifier)) { + size = sizeof(udf->volume_set_identifier); + } + memcpy(buffer, udf->volume_set_identifier, size); + return sizeof(udf->volume_set_identifier); + } + return 0; +} + +/* + * Directory access API + */ + +struct udfread_dir { + const struct udf_dir *dir; + uint32_t current_file; +}; + +UDFDIR *udfread_opendir(udfread *udf, const char *path) +{ + const struct udf_dir *dir = NULL; + UDFDIR *result; + + if (!udf || !udf->input || !path) { + return NULL; + } + + if (_find_file(udf, path, &dir, NULL) < 0) { + return NULL; + } + + if (!dir) { + return NULL; + } + + result = (UDFDIR *)calloc(1, sizeof(UDFDIR)); + if (result) { + result->dir = dir; + } + + return result; +} + +struct udfread_dirent *udfread_readdir(UDFDIR *p, struct udfread_dirent *entry) +{ + const struct udf_file_identifier *fe; + + if (!p || !entry || !p->dir) { + return NULL; + } + + if (p->current_file >= p->dir->num_entries) { + return NULL; + } + + fe = &p->dir->files[p->current_file]; + + entry->d_name = fe->filename; + + if (fe->characteristic & CHAR_FLAG_PARENT) { + entry->d_type = UDF_DT_DIR; + entry->d_name = ".."; + } else if (fe->characteristic & CHAR_FLAG_DIR) { + entry->d_type = UDF_DT_DIR; + } else { + entry->d_type = UDF_DT_REG; + } + + p->current_file++; + + return entry; +} + +void udfread_rewinddir(UDFDIR *p) +{ + if (p) { + p->current_file = 0; + } +} + +void udfread_closedir(UDFDIR *p) +{ + free(p); +} + + +/* + * File access API + */ + +struct udfread_file { + udfread *udf; + struct file_entry *fe; + + /* byte stream access */ + int64_t pos; + uint8_t *block; + int block_valid; + + void *block_mem; +}; + +UDFFILE *udfread_file_open(udfread *udf, const char *path) +{ + const struct udf_file_identifier *fi = NULL; + struct file_entry *fe; + UDFFILE *result; + + if (!udf || !udf->input || !path) { + return NULL; + } + + if (_find_file(udf, path, NULL, &fi) < 0) { + return NULL; + } + + if (fi->characteristic & CHAR_FLAG_DIR) { + udf_log("error opening file %s (is directory)\n", path); + return NULL; + } + + fe = _read_file_entry(udf, &fi->icb); + if (!fe) { + udf_error("error reading file entry for %s\n", path); + return NULL; + } + + result = (UDFFILE *)calloc(1, sizeof(UDFFILE)); + if (!result) { + free_file_entry(&fe); + return NULL; + } + + result->udf = udf; + result->fe = fe; + + return result; +} + +int64_t udfread_file_size(UDFFILE *p) +{ + if (p && p->fe) { + return p->fe->length; + } + return -1; +} + +void udfread_file_close(UDFFILE *p) +{ + if (p) { + free_file_entry(&p->fe); + free(p->block_mem); + free(p); + } +} + +/* + * block access + */ + +uint32_t udfread_file_lba(UDFFILE *p, uint32_t file_block) +{ + const struct file_entry *fe; + unsigned int i; + uint32_t ad_size; + + if (!p) { + return 0; + } + + fe = p->fe; + if (fe->content_inline) { + udf_error("can't map lba for inline file\n"); + return 0; + } + + for (i = 0; i < fe->num_ad; i++) { + const struct long_ad *ad = &fe->data.ad[0]; + ad_size = (ad[i].length + UDF_BLOCK_SIZE - 1) / UDF_BLOCK_SIZE; + if (file_block < ad_size) { + if (!ad[i].lba) { + /* empty file / no allocated space */ + return 0; + } + + if (ad[i].partition != p->udf->part.p[0].number) { + udf_error("file partition %u != %u\n", ad[i].partition, p->udf->part.p[0].number); + } + return p->udf->part.p[0].lba + ad[i].lba + file_block; + } + + file_block -= ad_size; + } + + return 0; +} + +uint32_t udfread_read_blocks(UDFFILE *p, void *buf, uint32_t file_block, uint32_t num_blocks, int flags) +{ + uint32_t i; + + if (!p || !num_blocks || !buf) { + return 0; + } + + for (i = 0; i < num_blocks; i++) { + uint32_t lba = udfread_file_lba(p, file_block + i); + uint8_t *block = (uint8_t *)buf + UDF_BLOCK_SIZE * i; + udf_trace("map block %u to lba %u\n", file_block + i, lba); + if (!lba) { + break; + } + if (_read_blocks(p->udf->input, lba, block, 1, flags) != 1) { + break; + } + } + return i; +} + +/* + * byte stream + */ + +static ssize_t _read(UDFFILE *p, void *buf, size_t bytes) +{ + /* start from middle of block ? */ + int64_t pos_off = p->pos % UDF_BLOCK_SIZE; + if (pos_off) { + int64_t chunk_size = UDF_BLOCK_SIZE - pos_off; + if (!p->block_valid) { + if (udfread_read_blocks(p, p->block, p->pos / UDF_BLOCK_SIZE, 1, 0) != 1) { + return -1; + } + p->block_valid = 1; + } + if (chunk_size > (int64_t)bytes) { + chunk_size = bytes; + } + memcpy(buf, p->block + pos_off, chunk_size); + p->pos += chunk_size; + return chunk_size; + } + + /* read full block(s) ? */ + if (bytes >= UDF_BLOCK_SIZE) { + uint32_t num_blocks = bytes / UDF_BLOCK_SIZE; + num_blocks = udfread_read_blocks(p, buf, p->pos / UDF_BLOCK_SIZE, num_blocks, 0); + if (num_blocks < 1) { + return -1; + } + p->pos += num_blocks * UDF_BLOCK_SIZE; + return num_blocks * UDF_BLOCK_SIZE; + } + + /* read beginning of a block */ + if (udfread_read_blocks(p, p->block, p->pos / UDF_BLOCK_SIZE, 1, 0) != 1) { + return -1; + } + p->block_valid = 1; + memcpy(buf, p->block, bytes); + p->pos += bytes; + return bytes; +} + +#define ALIGN(p, align) \ + (uint8_t *)( ((uintptr_t)(p) + ((align)-1)) & ~((uintptr_t)((align)-1))) + +ssize_t udfread_file_read(UDFFILE *p, void *buf, size_t bytes) +{ + uint8_t *bufpt = (uint8_t *)buf; + + /* sanity checks */ + if (!p || !buf || p->pos < 0) { + return -1; + } + if ((ssize_t)bytes < 0 || (int64_t)bytes < 0) { + return -1; + } + + /* limit range to file size */ + if ((uint64_t)p->pos + bytes > (uint64_t)udfread_file_size(p)) { + bytes = udfread_file_size(p) - p->pos; + } + + /* small files may be stored inline in file entry */ + if (p->fe->content_inline) { + memcpy(buf, &p->fe->data.content + p->pos, bytes); + p->pos += bytes; + return bytes; + } + + /* allocate temp storage for input block */ + if (!p->block) { + p->block_mem = malloc(2 * UDF_BLOCK_SIZE); + p->block = ALIGN(p->block_mem, UDF_BLOCK_SIZE); + } + + /* read chunks */ + while (bytes > 0) { + int64_t r = _read(p, bufpt, bytes); + if (r < 0) { + if (bufpt != buf) { + /* got some bytes */ + break; + } + /* got nothing */ + return -1; + } + bufpt += r; + bytes -= r; + } + + return (intptr_t)bufpt - (intptr_t)buf; +} + +int64_t udfread_file_tell(UDFFILE *p) +{ + if (p) { + return p->pos; + } + return -1; +} + +int64_t udfread_file_seek(UDFFILE *p, int64_t pos, int whence) +{ + if (p) { + switch (whence) { + case UDF_SEEK_CUR: + pos += p->pos; + break; + case UDF_SEEK_END: + pos = udfread_file_size(p) - pos; + break; + case UDF_SEEK_SET: + default: + break; + } + if (pos >= 0 && pos <= udfread_file_size(p)) { + p->pos = pos; + p->block_valid = 0; + return p->pos; + } + } + + return -1; +} diff -Nru libbluray-0.5.0/contrib/libudfread/src/udfread.h libbluray-0.8.1/contrib/libudfread/src/udfread.h --- libbluray-0.5.0/contrib/libudfread/src/udfread.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/contrib/libudfread/src/udfread.h 2015-02-18 09:40:47.000000000 +0000 @@ -0,0 +1,278 @@ +/* + * This file is part of libudfread + * Copyright (C) 2014-2015 VLC authors and VideoLAN + * + * Authors: Petri Hintukainen + * + * 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 + * . + */ + +#ifndef UDFREAD_H_ +#define UDFREAD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include /* *int_t */ +#include /* *size_t */ + +/** + * @file udfread/udfread.h + * external API header + */ + + +/* + * UDF volume access + */ + +/* opaque handle for UDF volume */ +typedef struct udfread udfread; + +struct udfread_block_input; + +/** + * Initialize UDF reader + * + * @return allocated udfread object, NULL if error + */ +udfread *udfread_init (void); + +/** + * Open UDF image + * + * @param p udfread object + * @param input UDF image access functions + * @return 0 on success, < 0 on error + */ +int udfread_open_input (udfread *, struct udfread_block_input *input); + +/** + * Open UDF image + * + * @param p udfread object + * @param path path to device or image file + * @return 0 on success, < 0 on error + */ +int udfread_open (udfread *, const char *path); + +/** + * Close UDF image + * + * @param p udfread object + */ +void udfread_close (udfread *); + +/** + * Get UDF Volume Identifier + * + * @param p udfread object + * @return Volume ID as null-terminated UTF-8 string, NULL if error + */ +const char *udfread_get_volume_id (udfread *); + +/** + * Get UDF Volume Set Identifier + * + * @param p udfread object + * @param buffer buffer to receive volume set id + * @param size buffer size + * @return Volume set id size, 0 if error + */ +size_t udfread_get_volume_set_id (udfread *, void *buffer, size_t size); + + +/* + * Directory access + */ + +/* File types for d_type */ +enum { + UDF_DT_UNKNOWN = 0, + UDF_DT_DIR, + UDF_DT_REG, +}; + +/* Directory stream entry */ +struct udfread_dirent { + unsigned int d_type; /* UDF_DT_* */ + const char *d_name; /* UTF-8 */ +}; + +/* opaque handle for directory stream */ +typedef struct udfread_dir UDFDIR; + +/** + * Open directory stream + * + * @param p udfread object + * @param path path to the directory + * @return directory stream on the directory, or NULL if it could not be opened. + */ +UDFDIR *udfread_opendir (udfread *, const char *path); + +/** + * Read directory stream + * + * Read a directory entry from directory stream. Return a pointer to + * udfread_dirent struct describing the entry, or NULL for EOF or error. + * + * @param p directory stream + * @param entry storege space for directory entry + * @return next directory stream entry, or NULL if EOF or error. + */ +struct udfread_dirent *udfread_readdir (UDFDIR *, struct udfread_dirent *entry); + +/** + * Rewind directory stream + * + * Rewind directory stream to the beginning of the directory. + * + * @param p directory stream + */ +void udfread_rewinddir (UDFDIR *); + +/** + * Close directory stream + * + * @param p directory stream + */ +void udfread_closedir (UDFDIR *); + + +/* + * File access + */ + +/** + * The length of one Logical Block + */ + +#ifndef UDF_BLOCK_SIZE +# define UDF_BLOCK_SIZE 2048 +#endif + +/* opaque handle for open file */ +typedef struct udfread_file UDFFILE; + +/** + * Open a file + * + * Allowed separator chars are \ and /. + * Path to the file is always absolute (relative to disc image root). + * Path may begin with single separator char. + * Path may not contain "." or ".." directory components. + * + * @param p udfread object + * @param path path to the file + * @return file object, or NULL if it could not be opened. + */ +UDFFILE *udfread_file_open (udfread *, const char *path); + +/** + * Close file object + * + * @param p file object + */ +void udfread_file_close (UDFFILE *); + +/** + * Get file size + * + * @param p file object + * @return file size, -1 on error + */ +int64_t udfread_file_size (UDFFILE *); + +/* + * Block access + */ + +/** + * Get file block address + * + * Convert file block number to absolute block address. + * + * @param p file object + * @param file_block file block number + * @return absolute block address, 0 on error + */ +uint32_t udfread_file_lba (UDFFILE *, uint32_t file_block); + +/** + * Read blocks from a file + * + * @param p file object + * @param buf buffer for data + * @param file_block file block number + * @param num_blocks number of blocks to read + * @return number of blocks read, 0 on error + */ +uint32_t udfread_read_blocks (UDFFILE *, void *buf, uint32_t file_block, uint32_t num_blocks, int flags); + + +/* + * Byte streams + */ + +enum { + UDF_SEEK_SET = 0, + UDF_SEEK_CUR = 1, + UDF_SEEK_END = 2, +}; + +/** + * Read bytes from a file + * + * Reads the given number of bytes from the file and increment the + * current read position by number of bytes read. + * + * @param p file object + * @param buf buffer for data + * @param bytes number of bytes to read + * @return number of bytes read, 0 on EOF, -1 on error + */ +ssize_t udfread_file_read (UDFFILE *, void *buf, size_t bytes); + +/** + * Get current read position of a file + * + * @param p file object + * @return current read position of the file, -1 on error + */ +int64_t udfread_file_tell (UDFFILE *); + +/** + * Set read position of a file + * + * New read position is calculated from offset according to the directive whence as follows: + * UDF_SEEK_SET The offset is set to offset bytes. + * UDF_SEEK_CUR The offset is set to its current location plus offset bytes. + * UDF_SEEK_END The offset is set to the size of the file plus offset bytes. + * + * @param p file object + * @param pos byte offset + * @param whence directive + * @return current read position of the file, -1 on error + */ +int64_t udfread_file_seek (UDFFILE *, int64_t pos, int whence); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* UDFREAD_H_ */ diff -Nru libbluray-0.5.0/debian/changelog libbluray-0.8.1/debian/changelog --- libbluray-0.5.0/debian/changelog 2014-02-09 01:10:54.000000000 +0000 +++ libbluray-0.8.1/debian/changelog 2016-02-20 22:24:38.000000000 +0000 @@ -1,3 +1,15 @@ +libbluray (1:0.8.1-1yavdr0~trusty) trusty; urgency=medium + + * rebuild for yaVDR + + -- Alexander Grothe Sat, 20 Feb 2016 23:24:12 +0100 + +libbluray (1:0.8.1-1~trusty) trusty; urgency=medium + + * new upstream release + + -- wsnipex Wed, 02 Sep 2015 10:14:00 +0200 + libbluray (1:0.5.0-1) unstable; urgency=low [ Rico Tzschichholz ] diff -Nru libbluray-0.5.0/debian/control libbluray-0.8.1/debian/control --- libbluray-0.5.0/debian/control 2014-02-09 00:00:07.000000000 +0000 +++ libbluray-0.8.1/debian/control 2015-09-02 11:11:06.000000000 +0000 @@ -13,6 +13,7 @@ javahelper [linux-any], default-jdk [linux-any], ant [linux-any], + libfontconfig1-dev, libfreetype6-dev, libxml2-dev Build-Depends-Indep: doxygen, diff -Nru libbluray-0.5.0/debian/libbluray-bdj.install libbluray-0.8.1/debian/libbluray-bdj.install --- libbluray-0.5.0/debian/libbluray-bdj.install 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/debian/libbluray-bdj.install 2015-09-02 09:29:55.000000000 +0000 @@ -0,0 +1 @@ +usr/share/java/libbluray-j2se-*.jar diff -Nru libbluray-0.5.0/debian/libbluray-bdj.jlibs libbluray-0.8.1/debian/libbluray-bdj.jlibs --- libbluray-0.5.0/debian/libbluray-bdj.jlibs 2014-02-05 14:13:34.000000000 +0000 +++ libbluray-0.8.1/debian/libbluray-bdj.jlibs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -src/.libs/libbluray.jar diff -Nru libbluray-0.5.0/debian/libbluray-bdj.jlibs.dis libbluray-0.8.1/debian/libbluray-bdj.jlibs.dis --- libbluray-0.5.0/debian/libbluray-bdj.jlibs.dis 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/debian/libbluray-bdj.jlibs.dis 2015-09-02 10:46:41.000000000 +0000 @@ -0,0 +1 @@ +.libs/libbluray-*.jar diff -Nru libbluray-0.5.0/debian/libbluray-bdj.links libbluray-0.8.1/debian/libbluray-bdj.links --- libbluray-0.5.0/debian/libbluray-bdj.links 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/debian/libbluray-bdj.links 2015-09-02 10:53:18.000000000 +0000 @@ -0,0 +1 @@ +usr/share/java/libbluray-j2se-0.8.1.jar usr/share/java/libbluray.jar diff -Nru libbluray-0.5.0/debian/patches/series libbluray-0.8.1/debian/patches/series --- libbluray-0.5.0/debian/patches/series 2014-02-09 01:09:38.000000000 +0000 +++ libbluray-0.8.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -01_java-compat.patch -02_online-image.patch diff -Nru libbluray-0.5.0/debian/patches/series.dis libbluray-0.8.1/debian/patches/series.dis --- libbluray-0.5.0/debian/patches/series.dis 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/debian/patches/series.dis 2015-09-02 08:11:04.000000000 +0000 @@ -0,0 +1,2 @@ +01_java-compat.patch +02_online-image.patch diff -Nru libbluray-0.5.0/debian/rules libbluray-0.8.1/debian/rules --- libbluray-0.5.0/debian/rules 2014-02-09 00:18:07.000000000 +0000 +++ libbluray-0.8.1/debian/rules 2015-09-02 08:50:35.000000000 +0000 @@ -42,8 +42,8 @@ override_dh_installdocs: dh_installdocs --exclude=jquery.js -override_dh_install: - dh_install -X.la -Xlibbluray.jar --fail-missing +#override_dh_install: +# dh_install -X.la -Xlibbluray-j2se-*.jar --fail-missing override_dh_clean: dh_clean diff -Nru libbluray-0.5.0/debian/source/format libbluray-0.8.1/debian/source/format --- libbluray-0.5.0/debian/source/format 2014-02-05 14:13:34.000000000 +0000 +++ libbluray-0.8.1/debian/source/format 2015-09-02 08:21:15.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru libbluray-0.5.0/doc/doxygen-config libbluray-0.8.1/doc/doxygen-config --- libbluray-0.5.0/doc/doxygen-config 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/doc/doxygen-config 2015-02-13 11:44:44.000000000 +0000 @@ -838,7 +838,7 @@ # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = NO # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to diff -Nru libbluray-0.5.0/doc/INSTALL libbluray-0.8.1/doc/INSTALL --- libbluray-0.5.0/doc/INSTALL 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/doc/INSTALL 2015-01-26 08:01:57.000000000 +0000 @@ -2,7 +2,7 @@ LIBBLURAY INSTALLATION INSTRUCTIONS =================================== -1. Build the source code (dependancies - full OpenSSL): +1. Build the source code: make diff -Nru libbluray-0.5.0/jni/darwin/jni_md.h libbluray-0.8.1/jni/darwin/jni_md.h --- libbluray-0.5.0/jni/darwin/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/jni/darwin/jni_md.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT __attribute__((visibility("default"))) +#define JNIIMPORT +#define JNICALL + +typedef int jint; +typedef long long jlong; +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/jni/jni.h libbluray-0.8.1/jni/jni.h --- libbluray-0.5.0/jni/jni.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/jni/jni.h 2015-02-18 09:52:41.000000000 +0000 @@ -0,0 +1,1973 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef JNI_H +#define JNI_H + +#include +#include + +/* jni_md.h contains the machine-dependent typedefs for jbyte, jint + and jlong */ + +#include "jni_md.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * JNI Types + */ + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +#if 0 /*ifdef __cplusplus*/ + +class _jobject {}; +class _jclass : public _jobject {}; +class _jthrowable : public _jobject {}; +class _jstring : public _jobject {}; +class _jarray : public _jobject {}; +class _jbooleanArray : public _jarray {}; +class _jbyteArray : public _jarray {}; +class _jcharArray : public _jarray {}; +class _jshortArray : public _jarray {}; +class _jintArray : public _jarray {}; +class _jlongArray : public _jarray {}; +class _jfloatArray : public _jarray {}; +class _jdoubleArray : public _jarray {}; +class _jobjectArray : public _jarray {}; + +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef _jthrowable *jthrowable; +typedef _jstring *jstring; +typedef _jarray *jarray; +typedef _jbooleanArray *jbooleanArray; +typedef _jbyteArray *jbyteArray; +typedef _jcharArray *jcharArray; +typedef _jshortArray *jshortArray; +typedef _jintArray *jintArray; +typedef _jlongArray *jlongArray; +typedef _jfloatArray *jfloatArray; +typedef _jdoubleArray *jdoubleArray; +typedef _jobjectArray *jobjectArray; + +#else + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; + +#endif + +typedef jobject jweak; + +#if 0 /* moved to jri_md.h */ +typedef jobject jref; /* For transition---not meant to be part of public + API anymore.*/ +#endif + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 + +/* + * used in RegisterNatives to describe native method name, signature, + * and function pointer. + */ + +typedef struct { + char *name; + char *signature; + void *fnPtr; +} JNINativeMethod; + +/* + * JNI Native Method Interface. + */ + +struct JNINativeInterface_; + +struct JNIEnv_; + +#if 0 /*ifdef __cplusplus*/ +typedef JNIEnv_ JNIEnv; +#else +typedef const struct JNINativeInterface_ *JNIEnv; +#endif + +/* + * JNI Invocation Interface. + */ + +struct JNIInvokeInterface_; + +struct JavaVM_; + +#if 0 /*ifdef __cplusplus*/ +typedef JavaVM_ JavaVM; +#else +typedef const struct JNIInvokeInterface_ *JavaVM; +#endif + +struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + void *reserved3; + jint (JNICALL *GetVersion)(JNIEnv *env); + + jclass (JNICALL *DefineClass) + (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, + jsize len); + jclass (JNICALL *FindClass) + (JNIEnv *env, const char *name); + + jmethodID (JNICALL *FromReflectedMethod) + (JNIEnv *env, jobject method); + jfieldID (JNICALL *FromReflectedField) + (JNIEnv *env, jobject field); + + jobject (JNICALL *ToReflectedMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (JNICALL *GetSuperclass) + (JNIEnv *env, jclass sub); + jboolean (JNICALL *IsAssignableFrom) + (JNIEnv *env, jclass sub, jclass sup); + + jobject (JNICALL *ToReflectedField) + (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (JNICALL *Throw) + (JNIEnv *env, jthrowable obj); + jint (JNICALL *ThrowNew) + (JNIEnv *env, jclass clazz, const char *msg); + jthrowable (JNICALL *ExceptionOccurred) + (JNIEnv *env); + void (JNICALL *ExceptionDescribe) + (JNIEnv *env); + void (JNICALL *ExceptionClear) + (JNIEnv *env); + void (JNICALL *FatalError) + (JNIEnv *env, const char *msg); + + jint (JNICALL *PushLocalFrame) + (JNIEnv *env, jint capacity); + jobject (JNICALL *PopLocalFrame) + (JNIEnv *env, jobject result); + + jobject (JNICALL *NewGlobalRef) + (JNIEnv *env, jobject lobj); + void (JNICALL *DeleteGlobalRef) + (JNIEnv *env, jobject gref); + void (JNICALL *DeleteLocalRef) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsSameObject) + (JNIEnv *env, jobject obj1, jobject obj2); + jobject (JNICALL *NewLocalRef) + (JNIEnv *env, jobject ref); + jint (JNICALL *EnsureLocalCapacity) + (JNIEnv *env, jint capacity); + + jobject (JNICALL *AllocObject) + (JNIEnv *env, jclass clazz); + jobject (JNICALL *NewObject) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *NewObjectV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *NewObjectA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jclass (JNICALL *GetObjectClass) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsInstanceOf) + (JNIEnv *env, jobject obj, jclass clazz); + + jmethodID (JNICALL *GetMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallObjectMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jobject (JNICALL *CallObjectMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jobject (JNICALL *CallObjectMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jboolean (JNICALL *CallBooleanMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jboolean (JNICALL *CallBooleanMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jboolean (JNICALL *CallBooleanMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jbyte (JNICALL *CallByteMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jbyte (JNICALL *CallByteMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jbyte (JNICALL *CallByteMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jchar (JNICALL *CallCharMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jchar (JNICALL *CallCharMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jchar (JNICALL *CallCharMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jshort (JNICALL *CallShortMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jshort (JNICALL *CallShortMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jshort (JNICALL *CallShortMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jint (JNICALL *CallIntMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jint (JNICALL *CallIntMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jint (JNICALL *CallIntMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jlong (JNICALL *CallLongMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jlong (JNICALL *CallLongMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jlong (JNICALL *CallLongMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jfloat (JNICALL *CallFloatMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jfloat (JNICALL *CallFloatMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jfloat (JNICALL *CallFloatMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + jdouble (JNICALL *CallDoubleMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jdouble (JNICALL *CallDoubleMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jdouble (JNICALL *CallDoubleMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args); + + void (JNICALL *CallVoidMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + void (JNICALL *CallVoidMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + void (JNICALL *CallVoidMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args); + + jobject (JNICALL *CallNonvirtualObjectMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallNonvirtualObjectMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jobject (JNICALL *CallNonvirtualObjectMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jboolean (JNICALL *CallNonvirtualBooleanMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallNonvirtualBooleanMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jboolean (JNICALL *CallNonvirtualBooleanMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jbyte (JNICALL *CallNonvirtualByteMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallNonvirtualByteMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jbyte (JNICALL *CallNonvirtualByteMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jchar (JNICALL *CallNonvirtualCharMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallNonvirtualCharMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jchar (JNICALL *CallNonvirtualCharMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jshort (JNICALL *CallNonvirtualShortMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallNonvirtualShortMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jshort (JNICALL *CallNonvirtualShortMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jint (JNICALL *CallNonvirtualIntMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallNonvirtualIntMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jint (JNICALL *CallNonvirtualIntMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jlong (JNICALL *CallNonvirtualLongMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallNonvirtualLongMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jlong (JNICALL *CallNonvirtualLongMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jfloat (JNICALL *CallNonvirtualFloatMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallNonvirtualFloatMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jfloat (JNICALL *CallNonvirtualFloatMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + jdouble (JNICALL *CallNonvirtualDoubleMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallNonvirtualDoubleMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jdouble (JNICALL *CallNonvirtualDoubleMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue *args); + + void (JNICALL *CallNonvirtualVoidMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (JNICALL *CallNonvirtualVoidMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + void (JNICALL *CallNonvirtualVoidMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + jvalue * args); + + jfieldID (JNICALL *GetFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *GetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jboolean (JNICALL *GetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jbyte (JNICALL *GetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jchar (JNICALL *GetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jshort (JNICALL *GetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jint (JNICALL *GetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jlong (JNICALL *GetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jfloat (JNICALL *GetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jdouble (JNICALL *GetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + + void (JNICALL *SetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); + void (JNICALL *SetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); + void (JNICALL *SetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); + void (JNICALL *SetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); + void (JNICALL *SetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); + void (JNICALL *SetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); + void (JNICALL *SetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); + void (JNICALL *SetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); + void (JNICALL *SetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (JNICALL *GetStaticMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallStaticObjectMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallStaticObjectMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *CallStaticObjectMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jboolean (JNICALL *CallStaticBooleanMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallStaticBooleanMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jboolean (JNICALL *CallStaticBooleanMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jbyte (JNICALL *CallStaticByteMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallStaticByteMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jbyte (JNICALL *CallStaticByteMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jchar (JNICALL *CallStaticCharMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallStaticCharMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jchar (JNICALL *CallStaticCharMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jshort (JNICALL *CallStaticShortMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallStaticShortMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jshort (JNICALL *CallStaticShortMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jint (JNICALL *CallStaticIntMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallStaticIntMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jint (JNICALL *CallStaticIntMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jlong (JNICALL *CallStaticLongMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallStaticLongMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jlong (JNICALL *CallStaticLongMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jfloat (JNICALL *CallStaticFloatMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallStaticFloatMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jfloat (JNICALL *CallStaticFloatMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + jdouble (JNICALL *CallStaticDoubleMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallStaticDoubleMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jdouble (JNICALL *CallStaticDoubleMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args); + + void (JNICALL *CallStaticVoidMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, ...); + void (JNICALL *CallStaticVoidMethodV) + (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); + void (JNICALL *CallStaticVoidMethodA) + (JNIEnv *env, jclass cls, jmethodID methodID, jvalue * args); + + jfieldID (JNICALL *GetStaticFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + jobject (JNICALL *GetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jboolean (JNICALL *GetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jbyte (JNICALL *GetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jchar (JNICALL *GetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jshort (JNICALL *GetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jint (JNICALL *GetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jlong (JNICALL *GetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jfloat (JNICALL *GetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jdouble (JNICALL *GetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + + void (JNICALL *SetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); + void (JNICALL *SetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); + void (JNICALL *SetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); + void (JNICALL *SetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); + void (JNICALL *SetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); + void (JNICALL *SetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); + void (JNICALL *SetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); + void (JNICALL *SetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); + void (JNICALL *SetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (JNICALL *NewString) + (JNIEnv *env, const jchar *unicode, jsize len); + jsize (JNICALL *GetStringLength) + (JNIEnv *env, jstring str); + const jchar *(JNICALL *GetStringChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringChars) + (JNIEnv *env, jstring str, const jchar *chars); + + jstring (JNICALL *NewStringUTF) + (JNIEnv *env, const char *utf); + jsize (JNICALL *GetStringUTFLength) + (JNIEnv *env, jstring str); + const char* (JNICALL *GetStringUTFChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringUTFChars) + (JNIEnv *env, jstring str, const char* chars); + + + jsize (JNICALL *GetArrayLength) + (JNIEnv *env, jarray array); + + jobjectArray (JNICALL *NewObjectArray) + (JNIEnv *env, jsize len, jclass clazz, jobject init); + jobject (JNICALL *GetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index); + void (JNICALL *SetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (JNICALL *NewBooleanArray) + (JNIEnv *env, jsize len); + jbyteArray (JNICALL *NewByteArray) + (JNIEnv *env, jsize len); + jcharArray (JNICALL *NewCharArray) + (JNIEnv *env, jsize len); + jshortArray (JNICALL *NewShortArray) + (JNIEnv *env, jsize len); + jintArray (JNICALL *NewIntArray) + (JNIEnv *env, jsize len); + jlongArray (JNICALL *NewLongArray) + (JNIEnv *env, jsize len); + jfloatArray (JNICALL *NewFloatArray) + (JNIEnv *env, jsize len); + jdoubleArray (JNICALL *NewDoubleArray) + (JNIEnv *env, jsize len); + + jboolean * (JNICALL *GetBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *isCopy); + jbyte * (JNICALL *GetByteArrayElements) + (JNIEnv *env, jbyteArray array, jboolean *isCopy); + jchar * (JNICALL *GetCharArrayElements) + (JNIEnv *env, jcharArray array, jboolean *isCopy); + jshort * (JNICALL *GetShortArrayElements) + (JNIEnv *env, jshortArray array, jboolean *isCopy); + jint * (JNICALL *GetIntArrayElements) + (JNIEnv *env, jintArray array, jboolean *isCopy); + jlong * (JNICALL *GetLongArrayElements) + (JNIEnv *env, jlongArray array, jboolean *isCopy); + jfloat * (JNICALL *GetFloatArrayElements) + (JNIEnv *env, jfloatArray array, jboolean *isCopy); + jdouble * (JNICALL *GetDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jboolean *isCopy); + + void (JNICALL *ReleaseBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); + void (JNICALL *ReleaseByteArrayElements) + (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); + void (JNICALL *ReleaseCharArrayElements) + (JNIEnv *env, jcharArray array, jchar *elems, jint mode); + void (JNICALL *ReleaseShortArrayElements) + (JNIEnv *env, jshortArray array, jshort *elems, jint mode); + void (JNICALL *ReleaseIntArrayElements) + (JNIEnv *env, jintArray array, jint *elems, jint mode); + void (JNICALL *ReleaseLongArrayElements) + (JNIEnv *env, jlongArray array, jlong *elems, jint mode); + void (JNICALL *ReleaseFloatArrayElements) + (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); + void (JNICALL *ReleaseDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); + + void (JNICALL *GetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); + void (JNICALL *GetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); + void (JNICALL *GetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); + void (JNICALL *GetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); + void (JNICALL *GetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); + void (JNICALL *GetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); + void (JNICALL *GetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); + void (JNICALL *GetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); + + void (JNICALL *SetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); + void (JNICALL *SetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); + void (JNICALL *SetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); + void (JNICALL *SetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); + void (JNICALL *SetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); + void (JNICALL *SetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); + void (JNICALL *SetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); + void (JNICALL *SetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); + + jint (JNICALL *RegisterNatives) + (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, + jint nMethods); + jint (JNICALL *UnregisterNatives) + (JNIEnv *env, jclass clazz); + + jint (JNICALL *MonitorEnter) + (JNIEnv *env, jobject obj); + jint (JNICALL *MonitorExit) + (JNIEnv *env, jobject obj); + + jint (JNICALL *GetJavaVM) + (JNIEnv *env, JavaVM **vm); + + void (JNICALL *GetStringRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); + void (JNICALL *GetStringUTFRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); + + void * (JNICALL *GetPrimitiveArrayCritical) + (JNIEnv *env, jarray array, jboolean *isCopy); + void (JNICALL *ReleasePrimitiveArrayCritical) + (JNIEnv *env, jarray array, void *carray, jint mode); + + const jchar * (JNICALL *GetStringCritical) + (JNIEnv *env, jstring string, jboolean *isCopy); + void (JNICALL *ReleaseStringCritical) + (JNIEnv *env, jstring string, const jchar *cstring); + + jweak (JNICALL *NewWeakGlobalRef) + (JNIEnv *env, jobject obj); + void (JNICALL *DeleteWeakGlobalRef) + (JNIEnv *env, jweak ref); + + jboolean (JNICALL *ExceptionCheck) + (JNIEnv *env); + + jobject (JNICALL *NewDirectByteBuffer) + (JNIEnv* env, void* address, jlong capacity); + void* (JNICALL *GetDirectBufferAddress) + (JNIEnv* env, jobject buf); + jlong (JNICALL *GetDirectBufferCapacity) + (JNIEnv* env, jobject buf); +}; + +/* + * We use inlined functions for C++ so that programmers can write: + * + * env->FindClass("java/lang/String") + * + * in C++ rather than: + * + * (*env)->FindClass(env, "java/lang/String") + * + * in C. + */ + +struct JNIEnv_ { + const struct JNINativeInterface_ *functions; +#if 0/*ifdef __cplusplus*/ + + jint GetVersion() { + return functions->GetVersion(this); + } + jclass DefineClass(const char *name, jobject loader, const jbyte *buf, + jsize len) { + return functions->DefineClass(this, name, loader, buf, len); + } + jclass FindClass(const char *name) { + return functions->FindClass(this, name); + } + jmethodID FromReflectedMethod(jobject method) { + return functions->FromReflectedMethod(this,method); + } + jfieldID FromReflectedField(jobject field) { + return functions->FromReflectedField(this,field); + } + + jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { + return functions->ToReflectedMethod(this, cls, methodID, isStatic); + } + + jclass GetSuperclass(jclass sub) { + return functions->GetSuperclass(this, sub); + } + jboolean IsAssignableFrom(jclass sub, jclass sup) { + return functions->IsAssignableFrom(this, sub, sup); + } + + jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { + return functions->ToReflectedField(this,cls,fieldID,isStatic); + } + + jint Throw(jthrowable obj) { + return functions->Throw(this, obj); + } + jint ThrowNew(jclass clazz, const char *msg) { + return functions->ThrowNew(this, clazz, msg); + } + jthrowable ExceptionOccurred() { + return functions->ExceptionOccurred(this); + } + void ExceptionDescribe() { + functions->ExceptionDescribe(this); + } + void ExceptionClear() { + functions->ExceptionClear(this); + } + void FatalError(const char *msg) { + functions->FatalError(this, msg); + } + + jint PushLocalFrame(jint capacity) { + return functions->PushLocalFrame(this,capacity); + } + jobject PopLocalFrame(jobject result) { + return functions->PopLocalFrame(this,result); + } + + jobject NewGlobalRef(jobject lobj) { + return functions->NewGlobalRef(this,lobj); + } + void DeleteGlobalRef(jobject gref) { + functions->DeleteGlobalRef(this,gref); + } + void DeleteLocalRef(jobject obj) { + functions->DeleteLocalRef(this, obj); + } + + jboolean IsSameObject(jobject obj1, jobject obj2) { + return functions->IsSameObject(this,obj1,obj2); + } + + jobject NewLocalRef(jobject ref) { + return functions->NewLocalRef(this,ref); + } + jint EnsureLocalCapacity(jint capacity) { + return functions->EnsureLocalCapacity(this,capacity); + } + + jobject AllocObject(jclass clazz) { + return functions->AllocObject(this,clazz); + } + jobject NewObject(jclass clazz, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args, methodID); + result = functions->NewObjectV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject NewObjectV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->NewObjectV(this,clazz,methodID,args); + } + jobject NewObjectA(jclass clazz, jmethodID methodID, + jvalue *args) { + return functions->NewObjectA(this,clazz,methodID,args); + } + + jclass GetObjectClass(jobject obj) { + return functions->GetObjectClass(this,obj); + } + jboolean IsInstanceOf(jobject obj, jclass clazz) { + return functions->IsInstanceOf(this,obj,clazz); + } + + jmethodID GetMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetMethodID(this,clazz,name,sig); + } + + jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallObjectMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jobject CallObjectMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallObjectMethodV(this,obj,methodID,args); + } + jobject CallObjectMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallObjectMethodA(this,obj,methodID,args); + } + + jboolean CallBooleanMethod(jobject obj, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallBooleanMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallBooleanMethodV(this,obj,methodID,args); + } + jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallBooleanMethodA(this,obj,methodID, args); + } + + jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallByteMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jbyte CallByteMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallByteMethodV(this,obj,methodID,args); + } + jbyte CallByteMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallByteMethodA(this,obj,methodID,args); + } + + jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallCharMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jchar CallCharMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallCharMethodV(this,obj,methodID,args); + } + jchar CallCharMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallCharMethodA(this,obj,methodID,args); + } + + jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallShortMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jshort CallShortMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallShortMethodV(this,obj,methodID,args); + } + jshort CallShortMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallShortMethodA(this,obj,methodID,args); + } + + jint CallIntMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallIntMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jint CallIntMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallIntMethodV(this,obj,methodID,args); + } + jint CallIntMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallIntMethodA(this,obj,methodID,args); + } + + jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallLongMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jlong CallLongMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallLongMethodV(this,obj,methodID,args); + } + jlong CallLongMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallLongMethodA(this,obj,methodID,args); + } + + jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallFloatMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jfloat CallFloatMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallFloatMethodV(this,obj,methodID,args); + } + jfloat CallFloatMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallFloatMethodA(this,obj,methodID,args); + } + + jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallDoubleMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallDoubleMethodV(this,obj,methodID,args); + } + jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + return functions->CallDoubleMethodA(this,obj,methodID,args); + } + + void CallVoidMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallVoidMethodV(this,obj,methodID,args); + va_end(args); + } + void CallVoidMethodV(jobject obj, jmethodID methodID, + va_list args) { + functions->CallVoidMethodV(this,obj,methodID,args); + } + void CallVoidMethodA(jobject obj, jmethodID methodID, + jvalue * args) { + functions->CallVoidMethodA(this,obj,methodID,args); + } + + jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + } + jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualObjectMethodA(this,obj,clazz, + methodID,args); + } + + jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + } + jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, + methodID, args); + } + + jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + } + jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualByteMethodA(this,obj,clazz, + methodID,args); + } + + jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + } + jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualCharMethodA(this,obj,clazz, + methodID,args); + } + + jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + } + jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualShortMethodA(this,obj,clazz, + methodID,args); + } + + jint CallNonvirtualIntMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + } + jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualIntMethodA(this,obj,clazz, + methodID,args); + } + + jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + } + jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, + jmethodID methodID, jvalue * args) { + return functions->CallNonvirtualLongMethodA(this,obj,clazz, + methodID,args); + } + + jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + } + jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + return functions->CallNonvirtualFloatMethodA(this,obj,clazz, + methodID,args); + } + + jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + } + jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, + methodID,args); + } + + void CallNonvirtualVoidMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + va_end(args); + } + void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + } + void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, + jmethodID methodID, + jvalue * args) { + functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); + } + + jfieldID GetFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetFieldID(this,clazz,name,sig); + } + + jobject GetObjectField(jobject obj, jfieldID fieldID) { + return functions->GetObjectField(this,obj,fieldID); + } + jboolean GetBooleanField(jobject obj, jfieldID fieldID) { + return functions->GetBooleanField(this,obj,fieldID); + } + jbyte GetByteField(jobject obj, jfieldID fieldID) { + return functions->GetByteField(this,obj,fieldID); + } + jchar GetCharField(jobject obj, jfieldID fieldID) { + return functions->GetCharField(this,obj,fieldID); + } + jshort GetShortField(jobject obj, jfieldID fieldID) { + return functions->GetShortField(this,obj,fieldID); + } + jint GetIntField(jobject obj, jfieldID fieldID) { + return functions->GetIntField(this,obj,fieldID); + } + jlong GetLongField(jobject obj, jfieldID fieldID) { + return functions->GetLongField(this,obj,fieldID); + } + jfloat GetFloatField(jobject obj, jfieldID fieldID) { + return functions->GetFloatField(this,obj,fieldID); + } + jdouble GetDoubleField(jobject obj, jfieldID fieldID) { + return functions->GetDoubleField(this,obj,fieldID); + } + + void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { + functions->SetObjectField(this,obj,fieldID,val); + } + void SetBooleanField(jobject obj, jfieldID fieldID, + jboolean val) { + functions->SetBooleanField(this,obj,fieldID,val); + } + void SetByteField(jobject obj, jfieldID fieldID, + jbyte val) { + functions->SetByteField(this,obj,fieldID,val); + } + void SetCharField(jobject obj, jfieldID fieldID, + jchar val) { + functions->SetCharField(this,obj,fieldID,val); + } + void SetShortField(jobject obj, jfieldID fieldID, + jshort val) { + functions->SetShortField(this,obj,fieldID,val); + } + void SetIntField(jobject obj, jfieldID fieldID, + jint val) { + functions->SetIntField(this,obj,fieldID,val); + } + void SetLongField(jobject obj, jfieldID fieldID, + jlong val) { + functions->SetLongField(this,obj,fieldID,val); + } + void SetFloatField(jobject obj, jfieldID fieldID, + jfloat val) { + functions->SetFloatField(this,obj,fieldID,val); + } + void SetDoubleField(jobject obj, jfieldID fieldID, + jdouble val) { + functions->SetDoubleField(this,obj,fieldID,val); + } + + jmethodID GetStaticMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticMethodID(this,clazz,name,sig); + } + + jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, + ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->CallStaticObjectMethodV(this,clazz,methodID,args); + } + jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, + jvalue *args) { + return functions->CallStaticObjectMethodA(this,clazz,methodID,args); + } + + jboolean CallStaticBooleanMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jboolean CallStaticBooleanMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + } + jboolean CallStaticBooleanMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); + } + + jbyte CallStaticByteMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallStaticByteMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jbyte CallStaticByteMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticByteMethodV(this,clazz,methodID,args); + } + jbyte CallStaticByteMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticByteMethodA(this,clazz,methodID,args); + } + + jchar CallStaticCharMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallStaticCharMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jchar CallStaticCharMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticCharMethodV(this,clazz,methodID,args); + } + jchar CallStaticCharMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticCharMethodA(this,clazz,methodID,args); + } + + jshort CallStaticShortMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallStaticShortMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jshort CallStaticShortMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticShortMethodV(this,clazz,methodID,args); + } + jshort CallStaticShortMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticShortMethodA(this,clazz,methodID,args); + } + + jint CallStaticIntMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallStaticIntMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jint CallStaticIntMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticIntMethodV(this,clazz,methodID,args); + } + jint CallStaticIntMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticIntMethodA(this,clazz,methodID,args); + } + + jlong CallStaticLongMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallStaticLongMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jlong CallStaticLongMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticLongMethodV(this,clazz,methodID,args); + } + jlong CallStaticLongMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticLongMethodA(this,clazz,methodID,args); + } + + jfloat CallStaticFloatMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jfloat CallStaticFloatMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticFloatMethodV(this,clazz,methodID,args); + } + jfloat CallStaticFloatMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticFloatMethodA(this,clazz,methodID,args); + } + + jdouble CallStaticDoubleMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jdouble CallStaticDoubleMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + } + jdouble CallStaticDoubleMethodA(jclass clazz, + jmethodID methodID, jvalue *args) { + return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); + } + + void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallStaticVoidMethodV(this,cls,methodID,args); + va_end(args); + } + void CallStaticVoidMethodV(jclass cls, jmethodID methodID, + va_list args) { + functions->CallStaticVoidMethodV(this,cls,methodID,args); + } + void CallStaticVoidMethodA(jclass cls, jmethodID methodID, + jvalue * args) { + functions->CallStaticVoidMethodA(this,cls,methodID,args); + } + + jfieldID GetStaticFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticFieldID(this,clazz,name,sig); + } + jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticObjectField(this,clazz,fieldID); + } + jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticBooleanField(this,clazz,fieldID); + } + jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticByteField(this,clazz,fieldID); + } + jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticCharField(this,clazz,fieldID); + } + jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticShortField(this,clazz,fieldID); + } + jint GetStaticIntField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticIntField(this,clazz,fieldID); + } + jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticLongField(this,clazz,fieldID); + } + jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticFloatField(this,clazz,fieldID); + } + jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticDoubleField(this,clazz,fieldID); + } + + void SetStaticObjectField(jclass clazz, jfieldID fieldID, + jobject value) { + functions->SetStaticObjectField(this,clazz,fieldID,value); + } + void SetStaticBooleanField(jclass clazz, jfieldID fieldID, + jboolean value) { + functions->SetStaticBooleanField(this,clazz,fieldID,value); + } + void SetStaticByteField(jclass clazz, jfieldID fieldID, + jbyte value) { + functions->SetStaticByteField(this,clazz,fieldID,value); + } + void SetStaticCharField(jclass clazz, jfieldID fieldID, + jchar value) { + functions->SetStaticCharField(this,clazz,fieldID,value); + } + void SetStaticShortField(jclass clazz, jfieldID fieldID, + jshort value) { + functions->SetStaticShortField(this,clazz,fieldID,value); + } + void SetStaticIntField(jclass clazz, jfieldID fieldID, + jint value) { + functions->SetStaticIntField(this,clazz,fieldID,value); + } + void SetStaticLongField(jclass clazz, jfieldID fieldID, + jlong value) { + functions->SetStaticLongField(this,clazz,fieldID,value); + } + void SetStaticFloatField(jclass clazz, jfieldID fieldID, + jfloat value) { + functions->SetStaticFloatField(this,clazz,fieldID,value); + } + void SetStaticDoubleField(jclass clazz, jfieldID fieldID, + jdouble value) { + functions->SetStaticDoubleField(this,clazz,fieldID,value); + } + + jstring NewString(const jchar *unicode, jsize len) { + return functions->NewString(this,unicode,len); + } + jsize GetStringLength(jstring str) { + return functions->GetStringLength(this,str); + } + const jchar *GetStringChars(jstring str, jboolean *isCopy) { + return functions->GetStringChars(this,str,isCopy); + } + void ReleaseStringChars(jstring str, const jchar *chars) { + functions->ReleaseStringChars(this,str,chars); + } + + jstring NewStringUTF(const char *utf) { + return functions->NewStringUTF(this,utf); + } + jsize GetStringUTFLength(jstring str) { + return functions->GetStringUTFLength(this,str); + } + const char* GetStringUTFChars(jstring str, jboolean *isCopy) { + return functions->GetStringUTFChars(this,str,isCopy); + } + void ReleaseStringUTFChars(jstring str, const char* chars) { + functions->ReleaseStringUTFChars(this,str,chars); + } + + jsize GetArrayLength(jarray array) { + return functions->GetArrayLength(this,array); + } + + jobjectArray NewObjectArray(jsize len, jclass clazz, + jobject init) { + return functions->NewObjectArray(this,len,clazz,init); + } + jobject GetObjectArrayElement(jobjectArray array, jsize index) { + return functions->GetObjectArrayElement(this,array,index); + } + void SetObjectArrayElement(jobjectArray array, jsize index, + jobject val) { + functions->SetObjectArrayElement(this,array,index,val); + } + + jbooleanArray NewBooleanArray(jsize len) { + return functions->NewBooleanArray(this,len); + } + jbyteArray NewByteArray(jsize len) { + return functions->NewByteArray(this,len); + } + jcharArray NewCharArray(jsize len) { + return functions->NewCharArray(this,len); + } + jshortArray NewShortArray(jsize len) { + return functions->NewShortArray(this,len); + } + jintArray NewIntArray(jsize len) { + return functions->NewIntArray(this,len); + } + jlongArray NewLongArray(jsize len) { + return functions->NewLongArray(this,len); + } + jfloatArray NewFloatArray(jsize len) { + return functions->NewFloatArray(this,len); + } + jdoubleArray NewDoubleArray(jsize len) { + return functions->NewDoubleArray(this,len); + } + + jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { + return functions->GetBooleanArrayElements(this,array,isCopy); + } + jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { + return functions->GetByteArrayElements(this,array,isCopy); + } + jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { + return functions->GetCharArrayElements(this,array,isCopy); + } + jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { + return functions->GetShortArrayElements(this,array,isCopy); + } + jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { + return functions->GetIntArrayElements(this,array,isCopy); + } + jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { + return functions->GetLongArrayElements(this,array,isCopy); + } + jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { + return functions->GetFloatArrayElements(this,array,isCopy); + } + jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { + return functions->GetDoubleArrayElements(this,array,isCopy); + } + + void ReleaseBooleanArrayElements(jbooleanArray array, + jboolean *elems, + jint mode) { + functions->ReleaseBooleanArrayElements(this,array,elems,mode); + } + void ReleaseByteArrayElements(jbyteArray array, + jbyte *elems, + jint mode) { + functions->ReleaseByteArrayElements(this,array,elems,mode); + } + void ReleaseCharArrayElements(jcharArray array, + jchar *elems, + jint mode) { + functions->ReleaseCharArrayElements(this,array,elems,mode); + } + void ReleaseShortArrayElements(jshortArray array, + jshort *elems, + jint mode) { + functions->ReleaseShortArrayElements(this,array,elems,mode); + } + void ReleaseIntArrayElements(jintArray array, + jint *elems, + jint mode) { + functions->ReleaseIntArrayElements(this,array,elems,mode); + } + void ReleaseLongArrayElements(jlongArray array, + jlong *elems, + jint mode) { + functions->ReleaseLongArrayElements(this,array,elems,mode); + } + void ReleaseFloatArrayElements(jfloatArray array, + jfloat *elems, + jint mode) { + functions->ReleaseFloatArrayElements(this,array,elems,mode); + } + void ReleaseDoubleArrayElements(jdoubleArray array, + jdouble *elems, + jint mode) { + functions->ReleaseDoubleArrayElements(this,array,elems,mode); + } + + void GetBooleanArrayRegion(jbooleanArray array, + jsize start, jsize len, jboolean *buf) { + functions->GetBooleanArrayRegion(this,array,start,len,buf); + } + void GetByteArrayRegion(jbyteArray array, + jsize start, jsize len, jbyte *buf) { + functions->GetByteArrayRegion(this,array,start,len,buf); + } + void GetCharArrayRegion(jcharArray array, + jsize start, jsize len, jchar *buf) { + functions->GetCharArrayRegion(this,array,start,len,buf); + } + void GetShortArrayRegion(jshortArray array, + jsize start, jsize len, jshort *buf) { + functions->GetShortArrayRegion(this,array,start,len,buf); + } + void GetIntArrayRegion(jintArray array, + jsize start, jsize len, jint *buf) { + functions->GetIntArrayRegion(this,array,start,len,buf); + } + void GetLongArrayRegion(jlongArray array, + jsize start, jsize len, jlong *buf) { + functions->GetLongArrayRegion(this,array,start,len,buf); + } + void GetFloatArrayRegion(jfloatArray array, + jsize start, jsize len, jfloat *buf) { + functions->GetFloatArrayRegion(this,array,start,len,buf); + } + void GetDoubleArrayRegion(jdoubleArray array, + jsize start, jsize len, jdouble *buf) { + functions->GetDoubleArrayRegion(this,array,start,len,buf); + } + + void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, + jboolean *buf) { + functions->SetBooleanArrayRegion(this,array,start,len,buf); + } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, + jbyte *buf) { + functions->SetByteArrayRegion(this,array,start,len,buf); + } + void SetCharArrayRegion(jcharArray array, jsize start, jsize len, + jchar *buf) { + functions->SetCharArrayRegion(this,array,start,len,buf); + } + void SetShortArrayRegion(jshortArray array, jsize start, jsize len, + jshort *buf) { + functions->SetShortArrayRegion(this,array,start,len,buf); + } + void SetIntArrayRegion(jintArray array, jsize start, jsize len, + jint *buf) { + functions->SetIntArrayRegion(this,array,start,len,buf); + } + void SetLongArrayRegion(jlongArray array, jsize start, jsize len, + jlong *buf) { + functions->SetLongArrayRegion(this,array,start,len,buf); + } + void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, + jfloat *buf) { + functions->SetFloatArrayRegion(this,array,start,len,buf); + } + void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, + jdouble *buf) { + functions->SetDoubleArrayRegion(this,array,start,len,buf); + } + + jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, + jint nMethods) { + return functions->RegisterNatives(this,clazz,methods,nMethods); + } + jint UnregisterNatives(jclass clazz) { + return functions->UnregisterNatives(this,clazz); + } + + jint MonitorEnter(jobject obj) { + return functions->MonitorEnter(this,obj); + } + jint MonitorExit(jobject obj) { + return functions->MonitorExit(this,obj); + } + + jint GetJavaVM(JavaVM **vm) { + return functions->GetJavaVM(this,vm); + } + + void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { + functions->GetStringRegion(this,str,start,len,buf); + } + void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { + functions->GetStringUTFRegion(this,str,start,len,buf); + } + + void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { + return functions->GetPrimitiveArrayCritical(this,array,isCopy); + } + void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { + functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); + } + + const jchar * GetStringCritical(jstring string, jboolean *isCopy) { + return functions->GetStringCritical(this,string,isCopy); + } + void ReleaseStringCritical(jstring string, const jchar *cstring) { + functions->ReleaseStringCritical(this,string,cstring); + } + + jweak NewWeakGlobalRef(jobject obj) { + return functions->NewWeakGlobalRef(this,obj); + } + void DeleteWeakGlobalRef(jweak ref) { + functions->DeleteWeakGlobalRef(this,ref); + } + + jboolean ExceptionCheck() { + return functions->ExceptionCheck(this); + } + + jobject NewDirectByteBuffer(void* address, jlong capacity) { + return functions->NewDirectByteBuffer(this, address, capacity); + } + void* GetDirectBufferAddress(jobject buf) { + return functions->GetDirectBufferAddress(this, buf); + } + jlong GetDirectBufferCapacity(jobject buf) { + return functions->GetDirectBufferCapacity(this, buf); + } + +#endif /* __cplusplus */ +}; + +typedef struct JavaVMOption { + char *optionString; + void *extraInfo; +} JavaVMOption; + +typedef struct JavaVMInitArgs { + jint version; + + jint nOptions; + JavaVMOption *options; + jboolean ignoreUnrecognized; +} JavaVMInitArgs; + +typedef struct JavaVMAttachArgs { + jint version; + + char *name; + jobject group; +} JavaVMAttachArgs; + +/* These structures will be VM-specific. */ + +typedef struct JDK1_1InitArgs { + jint version; + + char **properties; + jint checkSource; + jint nativeStackSize; + jint javaStackSize; + jint minHeapSize; + jint maxHeapSize; + jint verifyMode; + char *classpath; + + jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args); + void (JNICALL *exit)(jint code); + void (JNICALL *abort)(void); + + jint enableClassGC; + jint enableVerboseGC; + jint disableAsyncGC; + jint verbose; + jboolean debugging; + jint debugPort; +} JDK1_1InitArgs; + +typedef struct JDK1_1AttachArgs { + void * __padding; /* C compilers don't allow empty structures. */ +} JDK1_1AttachArgs; + +#define JDK1_2 +#define JDK1_4 + +/* End VM-specific. */ + +struct JNIInvokeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM)(JavaVM *vm); + + jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); + + jint (JNICALL *DetachCurrentThread)(JavaVM *vm); + + jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); + + jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); +}; + +struct JavaVM_ { + const struct JNIInvokeInterface_ *functions; +#if 0/*ifdef __cplusplus*/ + + jint DestroyJavaVM() { + return functions->DestroyJavaVM(this); + } + jint AttachCurrentThread(void **penv, void *args) { + return functions->AttachCurrentThread(this, penv, args); + } + jint DetachCurrentThread() { + return functions->DetachCurrentThread(this); + } + + jint GetEnv(void **penv, jint version) { + return functions->GetEnv(this, penv, version); + } + jint AttachCurrentThreadAsDaemon(void **penv, void *args) { + return functions->AttachCurrentThreadAsDaemon(this, penv, args); + } +#endif +}; + +#ifdef _JNI_IMPLEMENTATION_ +#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT +#else +#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT +#endif +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetDefaultJavaVMInitArgs(void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + +/* Defined by native libraries. */ +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved); + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved); + +#define JNI_VERSION_1_1 0x00010001 +#define JNI_VERSION_1_2 0x00010002 +#define JNI_VERSION_1_4 0x00010004 + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* JNI_H */ + + diff -Nru libbluray-0.5.0/jni/linux/jni_md.h libbluray-0.8.1/jni/linux/jni_md.h --- libbluray-0.5.0/jni/linux/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/jni/linux/jni_md.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,54 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT +#define JNIIMPORT +#define JNICALL + +typedef int jint; +#ifdef __LP64__ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/jni/win32/jni_md.h libbluray-0.8.1/jni/win32/jni_md.h --- libbluray-0.5.0/jni/win32/jni_md.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/jni/win32/jni_md.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Java Runtime Interface. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation and Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 1993-1996 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jean-Baptiste Kempf + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef _JNI_MD_H_ +#define _JNI_MD_H_ + +#define JNIEXPORT __declspec(dllexport) +#define JNIIMPORT __declspec(dllimport) +#define JNICALL __stdcall + +typedef long jint; +typedef signed __int64 jlong; +typedef signed char jbyte; + +#endif /* !_JNI_MD_H_ */ diff -Nru libbluray-0.5.0/m4/libtool.m4 libbluray-0.8.1/m4/libtool.m4 --- libbluray-0.5.0/m4/libtool.m4 2013-12-21 08:35:37.000000000 +0000 +++ libbluray-0.8.1/m4/libtool.m4 2015-09-02 11:11:16.000000000 +0000 @@ -1312,7 +1312,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1333,7 +1333,10 @@ ;; esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1352,7 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) diff -Nru libbluray-0.5.0/Makefile.am libbluray-0.8.1/Makefile.am --- libbluray-0.5.0/Makefile.am 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/Makefile.am 2015-03-20 10:50:37.000000000 +0000 @@ -1,11 +1,308 @@ include $(top_srcdir)/doxygen-include.am -SUBDIRS = src +ACLOCAL_AMFLAGS = -I m4 +DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava --enable-udf -ACLOCAL_AMFLAGS=-I m4 +MOSTLYCLEANFILES = $(DX_CLEANFILES) -EXTRA_DIST=bootstrap doc COPYING player_wrappers README.txt ChangeLog +if ENABLE_UDF +POSIX_C_SOURCE=200809L +else +POSIX_C_SOURCE=200112L +endif -MOSTLYCLEANFILES = $(DX_CLEANFILES) +SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=$(POSIX_C_SOURCE) -D_REENTRANT +SET_INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/libbluray -I$(top_builddir)/src/libbluray $(BDJAVA_CFLAGS) + +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(UDF_CFLAGS) + +EXTRA_DIST = \ + bootstrap \ + ChangeLog \ + COPYING \ + doc \ + player_wrappers \ + README.txt \ + src/libbluray/bdj/build.xml \ + src/libbluray/bdj/java \ + src/libbluray/bdj/java-j2me \ + src/libbluray/bdj/java-j2se + +lib_LTLIBRARIES=libbluray.la +libbluray_la_SOURCES = \ + src/file/dirs.h \ + src/file/dl.h \ + src/file/file.h \ + src/file/file.c \ + src/file/filesystem.h \ + src/file/filesystem.c \ + src/file/mount.h \ + src/libbluray/bluray.h \ + src/libbluray/bluray.c \ + src/libbluray/bluray_internal.h \ + src/libbluray/bluray-version.h \ + src/libbluray/keys.h \ + src/libbluray/player_settings.h \ + src/libbluray/register.h \ + src/libbluray/register.c \ + src/libbluray/bdnav/bdid_parse.h \ + src/libbluray/bdnav/bdid_parse.c \ + src/libbluray/bdnav/bdparse.h \ + src/libbluray/bdnav/clpi_parse.c \ + src/libbluray/bdnav/clpi_parse.h \ + src/libbluray/bdnav/extdata_parse.h \ + src/libbluray/bdnav/extdata_parse.c \ + src/libbluray/bdnav/index_parse.h \ + src/libbluray/bdnav/index_parse.c \ + src/libbluray/bdnav/meta_data.h \ + src/libbluray/bdnav/meta_parse.h \ + src/libbluray/bdnav/meta_parse.c \ + src/libbluray/bdnav/mpls_parse.h \ + src/libbluray/bdnav/mpls_parse.c \ + src/libbluray/bdnav/navigation.h \ + src/libbluray/bdnav/navigation.c \ + src/libbluray/bdnav/sound_parse.h \ + src/libbluray/bdnav/sound_parse.c \ + src/libbluray/bdnav/uo_mask_table.h \ + src/libbluray/decoders/graphics_controller.h \ + src/libbluray/decoders/graphics_controller.c \ + src/libbluray/decoders/graphics_processor.h \ + src/libbluray/decoders/graphics_processor.c \ + src/libbluray/decoders/hdmv_pids.h \ + src/libbluray/decoders/ig.h \ + src/libbluray/decoders/ig_decode.h \ + src/libbluray/decoders/ig_decode.c \ + src/libbluray/decoders/m2ts_demux.h \ + src/libbluray/decoders/m2ts_demux.c \ + src/libbluray/decoders/m2ts_filter.h \ + src/libbluray/decoders/m2ts_filter.c \ + src/libbluray/decoders/overlay.h \ + src/libbluray/decoders/pg.h \ + src/libbluray/decoders/pg_decode.h \ + src/libbluray/decoders/pg_decode.c \ + src/libbluray/decoders/pes_buffer.h \ + src/libbluray/decoders/pes_buffer.c \ + src/libbluray/decoders/rle.h \ + src/libbluray/decoders/rle.c \ + src/libbluray/decoders/textst.h \ + src/libbluray/decoders/textst_decode.h \ + src/libbluray/decoders/textst_decode.c \ + src/libbluray/decoders/textst_render.h \ + src/libbluray/decoders/textst_render.c \ + src/libbluray/disc/aacs.h \ + src/libbluray/disc/aacs.c \ + src/libbluray/disc/bdplus.h \ + src/libbluray/disc/bdplus.c \ + src/libbluray/disc/dec.h \ + src/libbluray/disc/dec.c \ + src/libbluray/disc/disc.h \ + src/libbluray/disc/disc.c \ + src/libbluray/disc/enc_info.h \ + src/libbluray/hdmv/hdmv_insn.h \ + src/libbluray/hdmv/hdmv_vm.h \ + src/libbluray/hdmv/hdmv_vm.c \ + src/libbluray/hdmv/mobj_data.h \ + src/libbluray/hdmv/mobj_parse.h \ + src/libbluray/hdmv/mobj_parse.c \ + src/libbluray/hdmv/mobj_print.h \ + src/libbluray/hdmv/mobj_print.c \ + src/util/array.h \ + src/util/array.c \ + src/util/attributes.h \ + src/util/bits.h \ + src/util/bits.c \ + src/util/logging.h \ + src/util/logging.c \ + src/util/log_control.h \ + src/util/macro.h \ + src/util/mutex.h \ + src/util/mutex.c \ + src/util/refcnt.h \ + src/util/refcnt.c \ + src/util/strutl.h \ + src/util/strutl.c \ + src/util/time.h \ + src/util/time.c + +if HAVE_DARWIN +libbluray_la_SOURCES+= \ + src/file/dir_posix.c \ + src/file/dirs_darwin.c \ + src/file/dl_posix.c \ + src/file/file_posix.c \ + src/file/mount_darwin.c +else +if HAVE_WIN32 +libbluray_la_SOURCES+= \ + src/file/dir_win32.c \ + src/file/dirs_win32.c \ + src/file/dl_win32.c \ + src/file/file_win32.c \ + src/file/mount.c +else +libbluray_la_SOURCES+= \ + src/file/dir_posix.c \ + src/file/dirs_xdg.c \ + src/file/dl_posix.c \ + src/file/file_posix.c \ + src/file/mount.c +endif +endif + +libbluray_la_LDFLAGS= -version-info $(LT_VERSION_INFO) -export-symbols-regex "^bd_" +libbluray_la_LIBADD= $(LIBXML2_LIBS) $(FT2_LIBS) $(FONTCONFIG_LIBS) + +noinst_HEADERS = \ + jni/jni.h \ + jni/linux/jni_md.h \ + jni/win32/jni_md.h \ + jni/darwin/jni_md.h + +pkginclude_HEADERS = \ + src/file/filesystem.h \ + src/libbluray/bluray.h \ + src/libbluray/bluray-version.h \ + src/libbluray/keys.h \ + src/libbluray/player_settings.h \ + src/libbluray/bdnav/clpi_data.h \ + src/libbluray/bdnav/meta_data.h \ + src/libbluray/decoders/overlay.h \ + src/util/log_control.h + +if ENABLE_UDF +libbluray_la_SOURCES += \ + src/libbluray/disc/udf_fs.h \ + src/libbluray/disc/udf_fs.c\ + \ + contrib/libudfread/src/blockinput.h \ + contrib/libudfread/src/default_blockinput.h \ + contrib/libudfread/src/default_blockinput.c \ + contrib/libudfread/src/ecma167.h \ + contrib/libudfread/src/ecma167.c \ + contrib/libudfread/src/udfread.h \ + contrib/libudfread/src/udfread.c +endif + + +if USING_BDJAVA +jardir=$(datadir)/java/ +jar_DATA=$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar + +$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local + +libbluray_la_SOURCES += \ + src/libbluray/bdj/bdj.h \ + src/libbluray/bdj/bdj.c \ + src/libbluray/bdj/bdjo_data.h \ + src/libbluray/bdj/bdjo_parse.h \ + src/libbluray/bdj/bdjo_parse.c \ + src/libbluray/bdj/native/bdjo.h \ + src/libbluray/bdj/native/bdjo.c \ + src/libbluray/bdj/native/java_awt_BDFontMetrics.h \ + src/libbluray/bdj/native/java_awt_BDFontMetrics.c \ + src/libbluray/bdj/native/java_awt_BDGraphics.h \ + src/libbluray/bdj/native/java_awt_BDGraphics.c \ + src/libbluray/bdj/native/org_videolan_Libbluray.h \ + src/libbluray/bdj/native/org_videolan_Libbluray.c \ + src/libbluray/bdj/native/org_videolan_Logger.h \ + src/libbluray/bdj/native/org_videolan_Logger.c \ + src/libbluray/bdj/native/register_native.h \ + src/libbluray/bdj/native/register_native.c \ + src/libbluray/bdj/native/util.h \ + src/libbluray/bdj/native/util.c + +AM_CFLAGS += $(BDJAVA_CFLAGS) + +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) \ + -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \ + -Dversion='$(BDJ_TYPE)-$(VERSION)' + +clean-local: + ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ + -Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \ + -Ddist='$(abs_builddir)/.libs' \ + -Dversion='$(BDJ_TYPE)-$(VERSION)' \ + clean +endif + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = src/libbluray.pc + + +# +# examples +# + +if USING_EXAMPLES + +noinst_PROGRAMS = \ + bdjo_dump \ + bdsplice \ + clpi_dump \ + hdmv_test \ + index_dump \ + libbluray_test \ + list_titles \ + mobj_dump \ + mpls_dump \ + sound_dump + +if USING_BDJAVA +noinst_PROGRAMS += \ + bdj_test +endif + +bin_PROGRAMS = \ + bd_info + +bd_info_SOURCES = src/examples/bd_info.c +bd_info_LDADD = libbluray.la + +bdsplice_SOURCES = src/examples/bdsplice.c +bdsplice_LDADD = libbluray.la + +bdj_test_SOURCES = src/examples/bdj_test.c +bdj_test_LDADD = libbluray.la + +bdjo_dump_SOURCES = src/examples/bdjo_dump.c +bdjo_dump_LDADD = libbluray.la + +clpi_dump_CFLAGS = $(AM_CFLAGS) +clpi_dump_SOURCES = \ + src/examples/clpi_dump.c \ + src/examples/util.c \ + src/examples/util.h +clpi_dump_LDADD = libbluray.la + +hdmv_test_SOURCES = src/examples/hdmv_test.c +hdmv_test_LDADD = libbluray.la + +index_dump_SOURCES = src/examples/index_dump.c +index_dump_LDADD = libbluray.la + +libbluray_test_SOURCES = src/examples/libbluray_test.c +libbluray_test_LDADD = libbluray.la + +list_titles_SOURCES = src/examples/list_titles.c +list_titles_LDADD = libbluray.la + +mobj_dump_CFLAGS = $(AM_CFLAGS) +mobj_dump_SOURCES = src/examples/mobj_dump.c \ + src/libbluray/hdmv/mobj_print.c +mobj_dump_LDADD = libbluray.la + +mpls_dump_CFLAGS = $(AM_CFLAGS) +mpls_dump_SOURCES = \ + src/examples/mpls_dump.c \ + src/examples/util.c \ + src/examples/util.h +mpls_dump_LDADD = libbluray.la + +sound_dump_SOURCES = src/examples/sound_dump.c +sound_dump_LDADD = libbluray.la -DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava +endif diff -Nru libbluray-0.5.0/Makefile.in libbluray-0.8.1/Makefile.in --- libbluray-0.5.0/Makefile.in 2013-12-21 08:36:05.000000000 +0000 +++ libbluray-0.8.1/Makefile.in 2015-09-02 11:11:20.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -56,24 +55,56 @@ # DX_CLEANFILES = everything to clean. # # Then add this variable to MOSTLYCLEANFILES. + + + + VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -92,13 +123,87 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure $(top_srcdir)/doxygen-include.am \ - $(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 +DIST_COMMON = $(top_srcdir)/doxygen-include.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(srcdir)/config.h.in \ + $(top_srcdir)/src/libbluray.pc.in \ + $(top_srcdir)/src/libbluray/bluray-version.h.in \ + $(top_srcdir)/build-aux/depcomp $(noinst_HEADERS) \ + $(pkginclude_HEADERS) COPYING ChangeLog build-aux/compile \ + build-aux/config.guess build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/missing build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing +@HAVE_DARWIN_TRUE@am__append_1 = \ +@HAVE_DARWIN_TRUE@ src/file/dir_posix.c \ +@HAVE_DARWIN_TRUE@ src/file/dirs_darwin.c \ +@HAVE_DARWIN_TRUE@ src/file/dl_posix.c \ +@HAVE_DARWIN_TRUE@ src/file/file_posix.c \ +@HAVE_DARWIN_TRUE@ src/file/mount_darwin.c + +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dir_win32.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dirs_win32.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dl_win32.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/file_win32.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/mount.c + +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__append_3 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dir_posix.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dirs_xdg.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dl_posix.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/file_posix.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/mount.c + +@ENABLE_UDF_TRUE@am__append_4 = \ +@ENABLE_UDF_TRUE@ src/libbluray/disc/udf_fs.h \ +@ENABLE_UDF_TRUE@ src/libbluray/disc/udf_fs.c\ +@ENABLE_UDF_TRUE@ \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/blockinput.h \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/default_blockinput.h \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/default_blockinput.c \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/ecma167.h \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/ecma167.c \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/udfread.h \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/udfread.c + +@USING_BDJAVA_TRUE@am__append_5 = \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdj.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdj.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdjo_data.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdjo_parse.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdjo_parse.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/bdjo.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/bdjo.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDFontMetrics.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDFontMetrics.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDGraphics.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDGraphics.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Libbluray.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Libbluray.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Logger.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Logger.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/register_native.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/register_native.c \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/util.h \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/util.c + +@USING_BDJAVA_TRUE@am__append_6 = $(BDJAVA_CFLAGS) +@USING_EXAMPLES_TRUE@noinst_PROGRAMS = bdjo_dump$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ bdsplice$(EXEEXT) clpi_dump$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ hdmv_test$(EXEEXT) index_dump$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ libbluray_test$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ list_titles$(EXEEXT) mobj_dump$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ mpls_dump$(EXEEXT) sound_dump$(EXEEXT) \ +@USING_EXAMPLES_TRUE@ $(am__EXEEXT_1) +@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@am__append_7 = \ +@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@ bdj_test + +@USING_EXAMPLES_TRUE@bin_PROGRAMS = bd_info$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ @@ -113,30 +218,350 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = src/libbluray/bluray-version.h +CONFIG_CLEAN_FILES = src/libbluray.pc src/libbluray/bluray-version.h CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libbluray_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__libbluray_la_SOURCES_DIST = src/file/dirs.h src/file/dl.h \ + src/file/file.h src/file/file.c src/file/filesystem.h \ + src/file/filesystem.c src/file/mount.h src/libbluray/bluray.h \ + src/libbluray/bluray.c src/libbluray/bluray_internal.h \ + src/libbluray/bluray-version.h src/libbluray/keys.h \ + src/libbluray/player_settings.h src/libbluray/register.h \ + src/libbluray/register.c src/libbluray/bdnav/bdid_parse.h \ + src/libbluray/bdnav/bdid_parse.c src/libbluray/bdnav/bdparse.h \ + src/libbluray/bdnav/clpi_parse.c \ + src/libbluray/bdnav/clpi_parse.h \ + src/libbluray/bdnav/extdata_parse.h \ + src/libbluray/bdnav/extdata_parse.c \ + src/libbluray/bdnav/index_parse.h \ + src/libbluray/bdnav/index_parse.c \ + src/libbluray/bdnav/meta_data.h \ + src/libbluray/bdnav/meta_parse.h \ + src/libbluray/bdnav/meta_parse.c \ + src/libbluray/bdnav/mpls_parse.h \ + src/libbluray/bdnav/mpls_parse.c \ + src/libbluray/bdnav/navigation.h \ + src/libbluray/bdnav/navigation.c \ + src/libbluray/bdnav/sound_parse.h \ + src/libbluray/bdnav/sound_parse.c \ + src/libbluray/bdnav/uo_mask_table.h \ + src/libbluray/decoders/graphics_controller.h \ + src/libbluray/decoders/graphics_controller.c \ + src/libbluray/decoders/graphics_processor.h \ + src/libbluray/decoders/graphics_processor.c \ + src/libbluray/decoders/hdmv_pids.h src/libbluray/decoders/ig.h \ + src/libbluray/decoders/ig_decode.h \ + src/libbluray/decoders/ig_decode.c \ + src/libbluray/decoders/m2ts_demux.h \ + src/libbluray/decoders/m2ts_demux.c \ + src/libbluray/decoders/m2ts_filter.h \ + src/libbluray/decoders/m2ts_filter.c \ + src/libbluray/decoders/overlay.h src/libbluray/decoders/pg.h \ + src/libbluray/decoders/pg_decode.h \ + src/libbluray/decoders/pg_decode.c \ + src/libbluray/decoders/pes_buffer.h \ + src/libbluray/decoders/pes_buffer.c \ + src/libbluray/decoders/rle.h src/libbluray/decoders/rle.c \ + src/libbluray/decoders/textst.h \ + src/libbluray/decoders/textst_decode.h \ + src/libbluray/decoders/textst_decode.c \ + src/libbluray/decoders/textst_render.h \ + src/libbluray/decoders/textst_render.c \ + src/libbluray/disc/aacs.h src/libbluray/disc/aacs.c \ + src/libbluray/disc/bdplus.h src/libbluray/disc/bdplus.c \ + src/libbluray/disc/dec.h src/libbluray/disc/dec.c \ + src/libbluray/disc/disc.h src/libbluray/disc/disc.c \ + src/libbluray/disc/enc_info.h src/libbluray/hdmv/hdmv_insn.h \ + src/libbluray/hdmv/hdmv_vm.h src/libbluray/hdmv/hdmv_vm.c \ + src/libbluray/hdmv/mobj_data.h src/libbluray/hdmv/mobj_parse.h \ + src/libbluray/hdmv/mobj_parse.c \ + src/libbluray/hdmv/mobj_print.h \ + src/libbluray/hdmv/mobj_print.c src/util/array.h \ + src/util/array.c src/util/attributes.h src/util/bits.h \ + src/util/bits.c src/util/logging.h src/util/logging.c \ + src/util/log_control.h src/util/macro.h src/util/mutex.h \ + src/util/mutex.c src/util/refcnt.h src/util/refcnt.c \ + src/util/strutl.h src/util/strutl.c src/util/time.h \ + src/util/time.c src/file/dir_posix.c src/file/dirs_darwin.c \ + src/file/dl_posix.c src/file/file_posix.c \ + src/file/mount_darwin.c src/file/dir_win32.c \ + src/file/dirs_win32.c src/file/dl_win32.c \ + src/file/file_win32.c src/file/mount.c src/file/dirs_xdg.c \ + src/libbluray/disc/udf_fs.h src/libbluray/disc/udf_fs.c \ + contrib/libudfread/src/blockinput.h \ + contrib/libudfread/src/default_blockinput.h \ + contrib/libudfread/src/default_blockinput.c \ + contrib/libudfread/src/ecma167.h \ + contrib/libudfread/src/ecma167.c \ + contrib/libudfread/src/udfread.h \ + contrib/libudfread/src/udfread.c src/libbluray/bdj/bdj.h \ + src/libbluray/bdj/bdj.c src/libbluray/bdj/bdjo_data.h \ + src/libbluray/bdj/bdjo_parse.h src/libbluray/bdj/bdjo_parse.c \ + src/libbluray/bdj/native/bdjo.h \ + src/libbluray/bdj/native/bdjo.c \ + src/libbluray/bdj/native/java_awt_BDFontMetrics.h \ + src/libbluray/bdj/native/java_awt_BDFontMetrics.c \ + src/libbluray/bdj/native/java_awt_BDGraphics.h \ + src/libbluray/bdj/native/java_awt_BDGraphics.c \ + src/libbluray/bdj/native/org_videolan_Libbluray.h \ + src/libbluray/bdj/native/org_videolan_Libbluray.c \ + src/libbluray/bdj/native/org_videolan_Logger.h \ + src/libbluray/bdj/native/org_videolan_Logger.c \ + src/libbluray/bdj/native/register_native.h \ + src/libbluray/bdj/native/register_native.c \ + src/libbluray/bdj/native/util.h \ + src/libbluray/bdj/native/util.c +am__dirstamp = $(am__leading_dot)dirstamp +@HAVE_DARWIN_TRUE@am__objects_1 = src/file/dir_posix.lo \ +@HAVE_DARWIN_TRUE@ src/file/dirs_darwin.lo src/file/dl_posix.lo \ +@HAVE_DARWIN_TRUE@ src/file/file_posix.lo \ +@HAVE_DARWIN_TRUE@ src/file/mount_darwin.lo +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dir_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dirs_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dl_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/file_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/mount.lo +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dir_posix.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dirs_xdg.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dl_posix.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/file_posix.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/mount.lo +@ENABLE_UDF_TRUE@am__objects_4 = src/libbluray/disc/udf_fs.lo \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/default_blockinput.lo \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/ecma167.lo \ +@ENABLE_UDF_TRUE@ contrib/libudfread/src/udfread.lo +@USING_BDJAVA_TRUE@am__objects_5 = src/libbluray/bdj/bdj.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/bdjo_parse.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/bdjo.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDFontMetrics.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/java_awt_BDGraphics.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Libbluray.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/org_videolan_Logger.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/register_native.lo \ +@USING_BDJAVA_TRUE@ src/libbluray/bdj/native/util.lo +am_libbluray_la_OBJECTS = src/file/file.lo src/file/filesystem.lo \ + src/libbluray/bluray.lo src/libbluray/register.lo \ + src/libbluray/bdnav/bdid_parse.lo \ + src/libbluray/bdnav/clpi_parse.lo \ + src/libbluray/bdnav/extdata_parse.lo \ + src/libbluray/bdnav/index_parse.lo \ + src/libbluray/bdnav/meta_parse.lo \ + src/libbluray/bdnav/mpls_parse.lo \ + src/libbluray/bdnav/navigation.lo \ + src/libbluray/bdnav/sound_parse.lo \ + src/libbluray/decoders/graphics_controller.lo \ + src/libbluray/decoders/graphics_processor.lo \ + src/libbluray/decoders/ig_decode.lo \ + src/libbluray/decoders/m2ts_demux.lo \ + src/libbluray/decoders/m2ts_filter.lo \ + src/libbluray/decoders/pg_decode.lo \ + src/libbluray/decoders/pes_buffer.lo \ + src/libbluray/decoders/rle.lo \ + src/libbluray/decoders/textst_decode.lo \ + src/libbluray/decoders/textst_render.lo \ + src/libbluray/disc/aacs.lo src/libbluray/disc/bdplus.lo \ + src/libbluray/disc/dec.lo src/libbluray/disc/disc.lo \ + src/libbluray/hdmv/hdmv_vm.lo src/libbluray/hdmv/mobj_parse.lo \ + src/libbluray/hdmv/mobj_print.lo src/util/array.lo \ + src/util/bits.lo src/util/logging.lo src/util/mutex.lo \ + src/util/refcnt.lo src/util/strutl.lo src/util/time.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) +libbluray_la_OBJECTS = $(am_libbluray_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +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 $@ +@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@am__EXEEXT_1 = \ +@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@ bdj_test$(EXEEXT) +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) +bd_info_OBJECTS = $(am_bd_info_OBJECTS) +@USING_EXAMPLES_TRUE@bd_info_DEPENDENCIES = libbluray.la +am__bdj_test_SOURCES_DIST = src/examples/bdj_test.c +@USING_EXAMPLES_TRUE@am_bdj_test_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/bdj_test.$(OBJEXT) +bdj_test_OBJECTS = $(am_bdj_test_OBJECTS) +@USING_EXAMPLES_TRUE@bdj_test_DEPENDENCIES = libbluray.la +am__bdjo_dump_SOURCES_DIST = src/examples/bdjo_dump.c +@USING_EXAMPLES_TRUE@am_bdjo_dump_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/bdjo_dump.$(OBJEXT) +bdjo_dump_OBJECTS = $(am_bdjo_dump_OBJECTS) +@USING_EXAMPLES_TRUE@bdjo_dump_DEPENDENCIES = libbluray.la +am__bdsplice_SOURCES_DIST = src/examples/bdsplice.c +@USING_EXAMPLES_TRUE@am_bdsplice_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/bdsplice.$(OBJEXT) +bdsplice_OBJECTS = $(am_bdsplice_OBJECTS) +@USING_EXAMPLES_TRUE@bdsplice_DEPENDENCIES = libbluray.la +am__clpi_dump_SOURCES_DIST = src/examples/clpi_dump.c \ + src/examples/util.c src/examples/util.h +@USING_EXAMPLES_TRUE@am_clpi_dump_OBJECTS = src/examples/clpi_dump-clpi_dump.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ src/examples/clpi_dump-util.$(OBJEXT) +clpi_dump_OBJECTS = $(am_clpi_dump_OBJECTS) +@USING_EXAMPLES_TRUE@clpi_dump_DEPENDENCIES = libbluray.la +clpi_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(clpi_dump_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am__hdmv_test_SOURCES_DIST = src/examples/hdmv_test.c +@USING_EXAMPLES_TRUE@am_hdmv_test_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/hdmv_test.$(OBJEXT) +hdmv_test_OBJECTS = $(am_hdmv_test_OBJECTS) +@USING_EXAMPLES_TRUE@hdmv_test_DEPENDENCIES = libbluray.la +am__index_dump_SOURCES_DIST = src/examples/index_dump.c +@USING_EXAMPLES_TRUE@am_index_dump_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/index_dump.$(OBJEXT) +index_dump_OBJECTS = $(am_index_dump_OBJECTS) +@USING_EXAMPLES_TRUE@index_dump_DEPENDENCIES = libbluray.la +am__libbluray_test_SOURCES_DIST = src/examples/libbluray_test.c +@USING_EXAMPLES_TRUE@am_libbluray_test_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/libbluray_test.$(OBJEXT) +libbluray_test_OBJECTS = $(am_libbluray_test_OBJECTS) +@USING_EXAMPLES_TRUE@libbluray_test_DEPENDENCIES = libbluray.la +am__list_titles_SOURCES_DIST = src/examples/list_titles.c +@USING_EXAMPLES_TRUE@am_list_titles_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/list_titles.$(OBJEXT) +list_titles_OBJECTS = $(am_list_titles_OBJECTS) +@USING_EXAMPLES_TRUE@list_titles_DEPENDENCIES = libbluray.la +am__mobj_dump_SOURCES_DIST = src/examples/mobj_dump.c \ + src/libbluray/hdmv/mobj_print.c +@USING_EXAMPLES_TRUE@am_mobj_dump_OBJECTS = src/examples/mobj_dump-mobj_dump.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ src/libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT) +mobj_dump_OBJECTS = $(am_mobj_dump_OBJECTS) +@USING_EXAMPLES_TRUE@mobj_dump_DEPENDENCIES = libbluray.la +mobj_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mobj_dump_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am__mpls_dump_SOURCES_DIST = src/examples/mpls_dump.c \ + src/examples/util.c src/examples/util.h +@USING_EXAMPLES_TRUE@am_mpls_dump_OBJECTS = src/examples/mpls_dump-mpls_dump.$(OBJEXT) \ +@USING_EXAMPLES_TRUE@ src/examples/mpls_dump-util.$(OBJEXT) +mpls_dump_OBJECTS = $(am_mpls_dump_OBJECTS) +@USING_EXAMPLES_TRUE@mpls_dump_DEPENDENCIES = libbluray.la +mpls_dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mpls_dump_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am__sound_dump_SOURCES_DIST = src/examples/sound_dump.c +@USING_EXAMPLES_TRUE@am_sound_dump_OBJECTS = \ +@USING_EXAMPLES_TRUE@ src/examples/sound_dump.$(OBJEXT) +sound_dump_OBJECTS = $(am_sound_dump_OBJECTS) +@USING_EXAMPLES_TRUE@sound_dump_DEPENDENCIES = libbluray.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +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__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libbluray_la_SOURCES) $(bd_info_SOURCES) \ + $(bdj_test_SOURCES) $(bdjo_dump_SOURCES) $(bdsplice_SOURCES) \ + $(clpi_dump_SOURCES) $(hdmv_test_SOURCES) \ + $(index_dump_SOURCES) $(libbluray_test_SOURCES) \ + $(list_titles_SOURCES) $(mobj_dump_SOURCES) \ + $(mpls_dump_SOURCES) $(sound_dump_SOURCES) +DIST_SOURCES = $(am__libbluray_la_SOURCES_DIST) \ + $(am__bd_info_SOURCES_DIST) $(am__bdj_test_SOURCES_DIST) \ + $(am__bdjo_dump_SOURCES_DIST) $(am__bdsplice_SOURCES_DIST) \ + $(am__clpi_dump_SOURCES_DIST) $(am__hdmv_test_SOURCES_DIST) \ + $(am__index_dump_SOURCES_DIST) \ + $(am__libbluray_test_SOURCES_DIST) \ + $(am__list_titles_SOURCES_DIST) $(am__mobj_dump_SOURCES_DIST) \ + $(am__mpls_dump_SOURCES_DIST) $(am__sound_dump_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +DATA = $(jar_DATA) $(pkgconfig_DATA) +HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -146,39 +571,17 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" +am__post_remove_distdir = $(am__remove_distdir) GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.bz2 +DIST_TARGETS = dist-bzip2 distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -232,9 +635,12 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_LIBS = @FT2_LIBS@ GREP = @GREP@ +HAVE_ANT = @HAVE_ANT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -277,6 +683,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +UDF_CFLAGS = @UDF_CFLAGS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -345,15 +752,157 @@ @DX_COND_doc_TRUE@ -r \ @DX_COND_doc_TRUE@ @DX_DOCDIR@ -SUBDIRS = src ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = bootstrap doc COPYING player_wrappers README.txt ChangeLog +DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava --enable-udf MOSTLYCLEANFILES = $(DX_CLEANFILES) -DISTCHECK_CONFIGURE_FLAGS = --enable-bdjava +@ENABLE_UDF_FALSE@POSIX_C_SOURCE = 200112L +@ENABLE_UDF_TRUE@POSIX_C_SOURCE = 200809L +SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=$(POSIX_C_SOURCE) -D_REENTRANT +SET_INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/libbluray -I$(top_builddir)/src/libbluray $(BDJAVA_CFLAGS) +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) \ + $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(UDF_CFLAGS) \ + $(am__append_6) +EXTRA_DIST = \ + bootstrap \ + ChangeLog \ + COPYING \ + doc \ + player_wrappers \ + README.txt \ + src/libbluray/bdj/build.xml \ + src/libbluray/bdj/java \ + src/libbluray/bdj/java-j2me \ + src/libbluray/bdj/java-j2se + +lib_LTLIBRARIES = libbluray.la +libbluray_la_SOURCES = src/file/dirs.h src/file/dl.h src/file/file.h \ + src/file/file.c src/file/filesystem.h src/file/filesystem.c \ + src/file/mount.h src/libbluray/bluray.h src/libbluray/bluray.c \ + src/libbluray/bluray_internal.h src/libbluray/bluray-version.h \ + src/libbluray/keys.h src/libbluray/player_settings.h \ + src/libbluray/register.h src/libbluray/register.c \ + src/libbluray/bdnav/bdid_parse.h \ + src/libbluray/bdnav/bdid_parse.c src/libbluray/bdnav/bdparse.h \ + src/libbluray/bdnav/clpi_parse.c \ + src/libbluray/bdnav/clpi_parse.h \ + src/libbluray/bdnav/extdata_parse.h \ + src/libbluray/bdnav/extdata_parse.c \ + src/libbluray/bdnav/index_parse.h \ + src/libbluray/bdnav/index_parse.c \ + src/libbluray/bdnav/meta_data.h \ + src/libbluray/bdnav/meta_parse.h \ + src/libbluray/bdnav/meta_parse.c \ + src/libbluray/bdnav/mpls_parse.h \ + src/libbluray/bdnav/mpls_parse.c \ + src/libbluray/bdnav/navigation.h \ + src/libbluray/bdnav/navigation.c \ + src/libbluray/bdnav/sound_parse.h \ + src/libbluray/bdnav/sound_parse.c \ + src/libbluray/bdnav/uo_mask_table.h \ + src/libbluray/decoders/graphics_controller.h \ + src/libbluray/decoders/graphics_controller.c \ + src/libbluray/decoders/graphics_processor.h \ + src/libbluray/decoders/graphics_processor.c \ + src/libbluray/decoders/hdmv_pids.h src/libbluray/decoders/ig.h \ + src/libbluray/decoders/ig_decode.h \ + src/libbluray/decoders/ig_decode.c \ + src/libbluray/decoders/m2ts_demux.h \ + src/libbluray/decoders/m2ts_demux.c \ + src/libbluray/decoders/m2ts_filter.h \ + src/libbluray/decoders/m2ts_filter.c \ + src/libbluray/decoders/overlay.h src/libbluray/decoders/pg.h \ + src/libbluray/decoders/pg_decode.h \ + src/libbluray/decoders/pg_decode.c \ + src/libbluray/decoders/pes_buffer.h \ + src/libbluray/decoders/pes_buffer.c \ + src/libbluray/decoders/rle.h src/libbluray/decoders/rle.c \ + src/libbluray/decoders/textst.h \ + src/libbluray/decoders/textst_decode.h \ + src/libbluray/decoders/textst_decode.c \ + src/libbluray/decoders/textst_render.h \ + src/libbluray/decoders/textst_render.c \ + src/libbluray/disc/aacs.h src/libbluray/disc/aacs.c \ + src/libbluray/disc/bdplus.h src/libbluray/disc/bdplus.c \ + src/libbluray/disc/dec.h src/libbluray/disc/dec.c \ + src/libbluray/disc/disc.h src/libbluray/disc/disc.c \ + src/libbluray/disc/enc_info.h src/libbluray/hdmv/hdmv_insn.h \ + src/libbluray/hdmv/hdmv_vm.h src/libbluray/hdmv/hdmv_vm.c \ + src/libbluray/hdmv/mobj_data.h src/libbluray/hdmv/mobj_parse.h \ + src/libbluray/hdmv/mobj_parse.c \ + src/libbluray/hdmv/mobj_print.h \ + src/libbluray/hdmv/mobj_print.c src/util/array.h \ + src/util/array.c src/util/attributes.h src/util/bits.h \ + src/util/bits.c src/util/logging.h src/util/logging.c \ + src/util/log_control.h src/util/macro.h src/util/mutex.h \ + src/util/mutex.c src/util/refcnt.h src/util/refcnt.c \ + src/util/strutl.h src/util/strutl.c src/util/time.h \ + src/util/time.c $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) +libbluray_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -export-symbols-regex "^bd_" +libbluray_la_LIBADD = $(LIBXML2_LIBS) $(FT2_LIBS) $(FONTCONFIG_LIBS) +noinst_HEADERS = \ + jni/jni.h \ + jni/linux/jni_md.h \ + jni/win32/jni_md.h \ + jni/darwin/jni_md.h + +pkginclude_HEADERS = \ + src/file/filesystem.h \ + src/libbluray/bluray.h \ + src/libbluray/bluray-version.h \ + src/libbluray/keys.h \ + src/libbluray/player_settings.h \ + src/libbluray/bdnav/clpi_data.h \ + src/libbluray/bdnav/meta_data.h \ + src/libbluray/decoders/overlay.h \ + src/util/log_control.h + +@USING_BDJAVA_TRUE@jardir = $(datadir)/java/ +@USING_BDJAVA_TRUE@jar_DATA = $(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = src/libbluray.pc +@USING_EXAMPLES_TRUE@bd_info_SOURCES = src/examples/bd_info.c +@USING_EXAMPLES_TRUE@bd_info_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@bdsplice_SOURCES = src/examples/bdsplice.c +@USING_EXAMPLES_TRUE@bdsplice_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@bdj_test_SOURCES = src/examples/bdj_test.c +@USING_EXAMPLES_TRUE@bdj_test_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@bdjo_dump_SOURCES = src/examples/bdjo_dump.c +@USING_EXAMPLES_TRUE@bdjo_dump_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@clpi_dump_CFLAGS = $(AM_CFLAGS) +@USING_EXAMPLES_TRUE@clpi_dump_SOURCES = \ +@USING_EXAMPLES_TRUE@ src/examples/clpi_dump.c \ +@USING_EXAMPLES_TRUE@ src/examples/util.c \ +@USING_EXAMPLES_TRUE@ src/examples/util.h + +@USING_EXAMPLES_TRUE@clpi_dump_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@hdmv_test_SOURCES = src/examples/hdmv_test.c +@USING_EXAMPLES_TRUE@hdmv_test_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@index_dump_SOURCES = src/examples/index_dump.c +@USING_EXAMPLES_TRUE@index_dump_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@libbluray_test_SOURCES = src/examples/libbluray_test.c +@USING_EXAMPLES_TRUE@libbluray_test_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@list_titles_SOURCES = src/examples/list_titles.c +@USING_EXAMPLES_TRUE@list_titles_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@mobj_dump_CFLAGS = $(AM_CFLAGS) +@USING_EXAMPLES_TRUE@mobj_dump_SOURCES = src/examples/mobj_dump.c \ +@USING_EXAMPLES_TRUE@ src/libbluray/hdmv/mobj_print.c + +@USING_EXAMPLES_TRUE@mobj_dump_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@mpls_dump_CFLAGS = $(AM_CFLAGS) +@USING_EXAMPLES_TRUE@mpls_dump_SOURCES = \ +@USING_EXAMPLES_TRUE@ src/examples/mpls_dump.c \ +@USING_EXAMPLES_TRUE@ src/examples/util.c \ +@USING_EXAMPLES_TRUE@ src/examples/util.h + +@USING_EXAMPLES_TRUE@mpls_dump_LDADD = libbluray.la +@USING_EXAMPLES_TRUE@sound_dump_SOURCES = src/examples/sound_dump.c +@USING_EXAMPLES_TRUE@sound_dump_LDADD = libbluray.la all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: +.SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/doxygen-include.am $(am__configure_deps) @@ -391,8 +940,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -404,121 +953,704 @@ distclean-hdr: -rm -f config.h stamp-h1 +src/libbluray.pc: $(top_builddir)/config.status $(top_srcdir)/src/libbluray.pc.in + 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-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +src/file/$(am__dirstamp): + @$(MKDIR_P) src/file + @: > src/file/$(am__dirstamp) +src/file/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/file/$(DEPDIR) + @: > src/file/$(DEPDIR)/$(am__dirstamp) +src/file/file.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/filesystem.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/libbluray/$(am__dirstamp): + @$(MKDIR_P) src/libbluray + @: > src/libbluray/$(am__dirstamp) +src/libbluray/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/$(DEPDIR) + @: > src/libbluray/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bluray.lo: src/libbluray/$(am__dirstamp) \ + src/libbluray/$(DEPDIR)/$(am__dirstamp) +src/libbluray/register.lo: src/libbluray/$(am__dirstamp) \ + src/libbluray/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdnav + @: > src/libbluray/bdnav/$(am__dirstamp) +src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdnav/$(DEPDIR) + @: > src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/bdid_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/clpi_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/extdata_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/index_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/meta_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/mpls_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/navigation.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdnav/sound_parse.lo: \ + src/libbluray/bdnav/$(am__dirstamp) \ + src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/decoders + @: > src/libbluray/decoders/$(am__dirstamp) +src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/decoders/$(DEPDIR) + @: > src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/graphics_controller.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/graphics_processor.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/ig_decode.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/m2ts_demux.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/m2ts_filter.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/pg_decode.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/pes_buffer.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/rle.lo: src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/textst_decode.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/decoders/textst_render.lo: \ + src/libbluray/decoders/$(am__dirstamp) \ + src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/disc + @: > src/libbluray/disc/$(am__dirstamp) +src/libbluray/disc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/disc/$(DEPDIR) + @: > src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/aacs.lo: src/libbluray/disc/$(am__dirstamp) \ + src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/bdplus.lo: src/libbluray/disc/$(am__dirstamp) \ + src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/dec.lo: src/libbluray/disc/$(am__dirstamp) \ + src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/disc.lo: src/libbluray/disc/$(am__dirstamp) \ + src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +src/libbluray/hdmv/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/hdmv + @: > src/libbluray/hdmv/$(am__dirstamp) +src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/hdmv/$(DEPDIR) + @: > src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) +src/libbluray/hdmv/hdmv_vm.lo: src/libbluray/hdmv/$(am__dirstamp) \ + src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) +src/libbluray/hdmv/mobj_parse.lo: src/libbluray/hdmv/$(am__dirstamp) \ + src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) +src/libbluray/hdmv/mobj_print.lo: src/libbluray/hdmv/$(am__dirstamp) \ + src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) +src/util/$(am__dirstamp): + @$(MKDIR_P) src/util + @: > src/util/$(am__dirstamp) +src/util/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/util/$(DEPDIR) + @: > src/util/$(DEPDIR)/$(am__dirstamp) +src/util/array.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/bits.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/logging.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/mutex.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/refcnt.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/strutl.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/time.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/file/dir_posix.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_darwin.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dl_posix.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/file_posix.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/mount_darwin.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dir_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dl_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/file_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/mount.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_xdg.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/libbluray/disc/udf_fs.lo: src/libbluray/disc/$(am__dirstamp) \ + src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) +contrib/libudfread/src/$(am__dirstamp): + @$(MKDIR_P) contrib/libudfread/src + @: > contrib/libudfread/src/$(am__dirstamp) +contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) contrib/libudfread/src/$(DEPDIR) + @: > contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp) +contrib/libudfread/src/default_blockinput.lo: \ + contrib/libudfread/src/$(am__dirstamp) \ + contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp) +contrib/libudfread/src/ecma167.lo: \ + contrib/libudfread/src/$(am__dirstamp) \ + contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp) +contrib/libudfread/src/udfread.lo: \ + contrib/libudfread/src/$(am__dirstamp) \ + contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdj + @: > src/libbluray/bdj/$(am__dirstamp) +src/libbluray/bdj/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdj/$(DEPDIR) + @: > src/libbluray/bdj/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/bdj.lo: src/libbluray/bdj/$(am__dirstamp) \ + src/libbluray/bdj/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/bdjo_parse.lo: src/libbluray/bdj/$(am__dirstamp) \ + src/libbluray/bdj/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdj/native + @: > src/libbluray/bdj/native/$(am__dirstamp) +src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libbluray/bdj/native/$(DEPDIR) + @: > src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/bdjo.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/java_awt_BDFontMetrics.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/java_awt_BDGraphics.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/org_videolan_Libbluray.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/org_videolan_Logger.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/register_native.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) +src/libbluray/bdj/native/util.lo: \ + src/libbluray/bdj/native/$(am__dirstamp) \ + src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) + +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) +src/examples/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/examples/$(DEPDIR) + @: > src/examples/$(DEPDIR)/$(am__dirstamp) +src/examples/bd_info.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +bd_info$(EXEEXT): $(bd_info_OBJECTS) $(bd_info_DEPENDENCIES) $(EXTRA_bd_info_DEPENDENCIES) + @rm -f bd_info$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bd_info_OBJECTS) $(bd_info_LDADD) $(LIBS) +src/examples/bdj_test.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +bdj_test$(EXEEXT): $(bdj_test_OBJECTS) $(bdj_test_DEPENDENCIES) $(EXTRA_bdj_test_DEPENDENCIES) + @rm -f bdj_test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bdj_test_OBJECTS) $(bdj_test_LDADD) $(LIBS) +src/examples/bdjo_dump.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +bdjo_dump$(EXEEXT): $(bdjo_dump_OBJECTS) $(bdjo_dump_DEPENDENCIES) $(EXTRA_bdjo_dump_DEPENDENCIES) + @rm -f bdjo_dump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bdjo_dump_OBJECTS) $(bdjo_dump_LDADD) $(LIBS) +src/examples/bdsplice.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +bdsplice$(EXEEXT): $(bdsplice_OBJECTS) $(bdsplice_DEPENDENCIES) $(EXTRA_bdsplice_DEPENDENCIES) + @rm -f bdsplice$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bdsplice_OBJECTS) $(bdsplice_LDADD) $(LIBS) +src/examples/clpi_dump-clpi_dump.$(OBJEXT): \ + src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) +src/examples/clpi_dump-util.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +clpi_dump$(EXEEXT): $(clpi_dump_OBJECTS) $(clpi_dump_DEPENDENCIES) $(EXTRA_clpi_dump_DEPENDENCIES) + @rm -f clpi_dump$(EXEEXT) + $(AM_V_CCLD)$(clpi_dump_LINK) $(clpi_dump_OBJECTS) $(clpi_dump_LDADD) $(LIBS) +src/examples/hdmv_test.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +hdmv_test$(EXEEXT): $(hdmv_test_OBJECTS) $(hdmv_test_DEPENDENCIES) $(EXTRA_hdmv_test_DEPENDENCIES) + @rm -f hdmv_test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hdmv_test_OBJECTS) $(hdmv_test_LDADD) $(LIBS) +src/examples/index_dump.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +index_dump$(EXEEXT): $(index_dump_OBJECTS) $(index_dump_DEPENDENCIES) $(EXTRA_index_dump_DEPENDENCIES) + @rm -f index_dump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(index_dump_OBJECTS) $(index_dump_LDADD) $(LIBS) +src/examples/libbluray_test.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +libbluray_test$(EXEEXT): $(libbluray_test_OBJECTS) $(libbluray_test_DEPENDENCIES) $(EXTRA_libbluray_test_DEPENDENCIES) + @rm -f libbluray_test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(libbluray_test_OBJECTS) $(libbluray_test_LDADD) $(LIBS) +src/examples/list_titles.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +list_titles$(EXEEXT): $(list_titles_OBJECTS) $(list_titles_DEPENDENCIES) $(EXTRA_list_titles_DEPENDENCIES) + @rm -f list_titles$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(list_titles_OBJECTS) $(list_titles_LDADD) $(LIBS) +src/examples/mobj_dump-mobj_dump.$(OBJEXT): \ + src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) +src/libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT): \ + src/libbluray/hdmv/$(am__dirstamp) \ + src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) + +mobj_dump$(EXEEXT): $(mobj_dump_OBJECTS) $(mobj_dump_DEPENDENCIES) $(EXTRA_mobj_dump_DEPENDENCIES) + @rm -f mobj_dump$(EXEEXT) + $(AM_V_CCLD)$(mobj_dump_LINK) $(mobj_dump_OBJECTS) $(mobj_dump_LDADD) $(LIBS) +src/examples/mpls_dump-mpls_dump.$(OBJEXT): \ + src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) +src/examples/mpls_dump-util.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +mpls_dump$(EXEEXT): $(mpls_dump_OBJECTS) $(mpls_dump_DEPENDENCIES) $(EXTRA_mpls_dump_DEPENDENCIES) + @rm -f mpls_dump$(EXEEXT) + $(AM_V_CCLD)$(mpls_dump_LINK) $(mpls_dump_OBJECTS) $(mpls_dump_LDADD) $(LIBS) +src/examples/sound_dump.$(OBJEXT): src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +sound_dump$(EXEEXT): $(sound_dump_OBJECTS) $(sound_dump_DEPENDENCIES) $(EXTRA_sound_dump_DEPENDENCIES) + @rm -f sound_dump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sound_dump_OBJECTS) $(sound_dump_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f contrib/libudfread/src/*.$(OBJEXT) + -rm -f contrib/libudfread/src/*.lo + -rm -f src/examples/*.$(OBJEXT) + -rm -f src/file/*.$(OBJEXT) + -rm -f src/file/*.lo + -rm -f src/libbluray/*.$(OBJEXT) + -rm -f src/libbluray/*.lo + -rm -f src/libbluray/bdj/*.$(OBJEXT) + -rm -f src/libbluray/bdj/*.lo + -rm -f src/libbluray/bdj/native/*.$(OBJEXT) + -rm -f src/libbluray/bdj/native/*.lo + -rm -f src/libbluray/bdnav/*.$(OBJEXT) + -rm -f src/libbluray/bdnav/*.lo + -rm -f src/libbluray/decoders/*.$(OBJEXT) + -rm -f src/libbluray/decoders/*.lo + -rm -f src/libbluray/disc/*.$(OBJEXT) + -rm -f src/libbluray/disc/*.lo + -rm -f src/libbluray/hdmv/*.$(OBJEXT) + -rm -f src/libbluray/hdmv/*.lo + -rm -f src/util/*.$(OBJEXT) + -rm -f src/util/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/default_blockinput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/ecma167.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@contrib/libudfread/src/$(DEPDIR)/udfread.Plo@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)/bdj_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/bdjo_dump.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)/clpi_dump-clpi_dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/clpi_dump-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/hdmv_test.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)/mobj_dump-mobj_dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/mpls_dump-util.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)/dir_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dir_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_xdg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dl_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dl_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/file_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/file_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/filesystem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/mount.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/mount_darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/bluray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/$(DEPDIR)/register.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/bdj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/$(DEPDIR)/bdjo_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/bdjo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/java_awt_BDFontMetrics.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/java_awt_BDGraphics.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/org_videolan_Libbluray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/org_videolan_Logger.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/register_native.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdj/native/$(DEPDIR)/util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/bdid_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/clpi_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/extdata_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/index_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/meta_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/mpls_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/navigation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/bdnav/$(DEPDIR)/sound_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/graphics_controller.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/graphics_processor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/ig_decode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/m2ts_demux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/m2ts_filter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/pes_buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/pg_decode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/rle.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/textst_decode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/decoders/$(DEPDIR)/textst_render.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/aacs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/bdplus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/dec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/disc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/disc/$(DEPDIR)/udf_fs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/hdmv_vm.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/libbluray/hdmv/$(DEPDIR)/mobj_parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libbluray/hdmv/$(DEPDIR)/mobj_print.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/array.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/bits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/logging.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/refcnt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/strutl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/time.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +src/examples/clpi_dump-clpi_dump.o: src/examples/clpi_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT src/examples/clpi_dump-clpi_dump.o -MD -MP -MF src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o src/examples/clpi_dump-clpi_dump.o `test -f 'src/examples/clpi_dump.c' || echo '$(srcdir)/'`src/examples/clpi_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/clpi_dump.c' object='src/examples/clpi_dump-clpi_dump.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o src/examples/clpi_dump-clpi_dump.o `test -f 'src/examples/clpi_dump.c' || echo '$(srcdir)/'`src/examples/clpi_dump.c + +src/examples/clpi_dump-clpi_dump.obj: src/examples/clpi_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT src/examples/clpi_dump-clpi_dump.obj -MD -MP -MF src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o src/examples/clpi_dump-clpi_dump.obj `if test -f 'src/examples/clpi_dump.c'; then $(CYGPATH_W) 'src/examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/clpi_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo src/examples/$(DEPDIR)/clpi_dump-clpi_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/clpi_dump.c' object='src/examples/clpi_dump-clpi_dump.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o src/examples/clpi_dump-clpi_dump.obj `if test -f 'src/examples/clpi_dump.c'; then $(CYGPATH_W) 'src/examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/clpi_dump.c'; fi` + +src/examples/clpi_dump-util.o: src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT src/examples/clpi_dump-util.o -MD -MP -MF src/examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o src/examples/clpi_dump-util.o `test -f 'src/examples/util.c' || echo '$(srcdir)/'`src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/clpi_dump-util.Tpo src/examples/$(DEPDIR)/clpi_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/util.c' object='src/examples/clpi_dump-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o src/examples/clpi_dump-util.o `test -f 'src/examples/util.c' || echo '$(srcdir)/'`src/examples/util.c + +src/examples/clpi_dump-util.obj: src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT src/examples/clpi_dump-util.obj -MD -MP -MF src/examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o src/examples/clpi_dump-util.obj `if test -f 'src/examples/util.c'; then $(CYGPATH_W) 'src/examples/util.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/clpi_dump-util.Tpo src/examples/$(DEPDIR)/clpi_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/util.c' object='src/examples/clpi_dump-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o src/examples/clpi_dump-util.obj `if test -f 'src/examples/util.c'; then $(CYGPATH_W) 'src/examples/util.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/util.c'; fi` + +src/examples/mobj_dump-mobj_dump.o: src/examples/mobj_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT src/examples/mobj_dump-mobj_dump.o -MD -MP -MF src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o src/examples/mobj_dump-mobj_dump.o `test -f 'src/examples/mobj_dump.c' || echo '$(srcdir)/'`src/examples/mobj_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/mobj_dump.c' object='src/examples/mobj_dump-mobj_dump.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mobj_dump-mobj_dump.o `test -f 'src/examples/mobj_dump.c' || echo '$(srcdir)/'`src/examples/mobj_dump.c + +src/examples/mobj_dump-mobj_dump.obj: src/examples/mobj_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT src/examples/mobj_dump-mobj_dump.obj -MD -MP -MF src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o src/examples/mobj_dump-mobj_dump.obj `if test -f 'src/examples/mobj_dump.c'; then $(CYGPATH_W) 'src/examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/mobj_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo src/examples/$(DEPDIR)/mobj_dump-mobj_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/mobj_dump.c' object='src/examples/mobj_dump-mobj_dump.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mobj_dump-mobj_dump.obj `if test -f 'src/examples/mobj_dump.c'; then $(CYGPATH_W) 'src/examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/mobj_dump.c'; fi` + +src/libbluray/hdmv/mobj_dump-mobj_print.o: src/libbluray/hdmv/mobj_print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT src/libbluray/hdmv/mobj_dump-mobj_print.o -MD -MP -MF src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o src/libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'src/libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`src/libbluray/hdmv/mobj_print.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libbluray/hdmv/mobj_print.c' object='src/libbluray/hdmv/mobj_dump-mobj_print.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o src/libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'src/libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`src/libbluray/hdmv/mobj_print.c + +src/libbluray/hdmv/mobj_dump-mobj_print.obj: src/libbluray/hdmv/mobj_print.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT src/libbluray/hdmv/mobj_dump-mobj_print.obj -MD -MP -MF src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o src/libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'src/libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'src/libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/src/libbluray/hdmv/mobj_print.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo src/libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libbluray/hdmv/mobj_print.c' object='src/libbluray/hdmv/mobj_dump-mobj_print.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o src/libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'src/libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'src/libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/src/libbluray/hdmv/mobj_print.c'; fi` + +src/examples/mpls_dump-mpls_dump.o: src/examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT src/examples/mpls_dump-mpls_dump.o -MD -MP -MF src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o src/examples/mpls_dump-mpls_dump.o `test -f 'src/examples/mpls_dump.c' || echo '$(srcdir)/'`src/examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/mpls_dump.c' object='src/examples/mpls_dump-mpls_dump.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mpls_dump-mpls_dump.o `test -f 'src/examples/mpls_dump.c' || echo '$(srcdir)/'`src/examples/mpls_dump.c + +src/examples/mpls_dump-mpls_dump.obj: src/examples/mpls_dump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT src/examples/mpls_dump-mpls_dump.obj -MD -MP -MF src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o src/examples/mpls_dump-mpls_dump.obj `if test -f 'src/examples/mpls_dump.c'; then $(CYGPATH_W) 'src/examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/mpls_dump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo src/examples/$(DEPDIR)/mpls_dump-mpls_dump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/mpls_dump.c' object='src/examples/mpls_dump-mpls_dump.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mpls_dump-mpls_dump.obj `if test -f 'src/examples/mpls_dump.c'; then $(CYGPATH_W) 'src/examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/mpls_dump.c'; fi` + +src/examples/mpls_dump-util.o: src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT src/examples/mpls_dump-util.o -MD -MP -MF src/examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o src/examples/mpls_dump-util.o `test -f 'src/examples/util.c' || echo '$(srcdir)/'`src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mpls_dump-util.Tpo src/examples/$(DEPDIR)/mpls_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/util.c' object='src/examples/mpls_dump-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mpls_dump-util.o `test -f 'src/examples/util.c' || echo '$(srcdir)/'`src/examples/util.c + +src/examples/mpls_dump-util.obj: src/examples/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT src/examples/mpls_dump-util.obj -MD -MP -MF src/examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o src/examples/mpls_dump-util.obj `if test -f 'src/examples/util.c'; then $(CYGPATH_W) 'src/examples/util.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/mpls_dump-util.Tpo src/examples/$(DEPDIR)/mpls_dump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/util.c' object='src/examples/mpls_dump-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o src/examples/mpls_dump-util.obj `if test -f 'src/examples/util.c'; then $(CYGPATH_W) 'src/examples/util.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/util.c'; fi` + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf contrib/libudfread/src/.libs contrib/libudfread/src/_libs + -rm -rf src/file/.libs src/file/_libs + -rm -rf src/libbluray/.libs src/libbluray/_libs + -rm -rf src/libbluray/bdj/.libs src/libbluray/bdj/_libs + -rm -rf src/libbluray/bdj/native/.libs src/libbluray/bdj/native/_libs + -rm -rf src/libbluray/bdnav/.libs src/libbluray/bdnav/_libs + -rm -rf src/libbluray/decoders/.libs src/libbluray/decoders/_libs + -rm -rf src/libbluray/disc/.libs src/libbluray/disc/_libs + -rm -rf src/libbluray/hdmv/.libs src/libbluray/hdmv/_libs + -rm -rf src/util/.libs src/util/_libs distclean-libtool: -rm -f libtool config.lt +install-jarDATA: $(jar_DATA) + @$(NORMAL_INSTALL) + @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(jardir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(jardir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(jardir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(jardir)" || exit $$?; \ + done -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ +uninstall-jarDATA: + @$(NORMAL_UNINSTALL) + @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(jardir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -530,15 +1662,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -547,9 +1675,31 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -583,31 +1733,6 @@ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -617,39 +1742,41 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -660,8 +1787,6 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -673,18 +1798,19 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -707,7 +1833,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -738,19 +1864,25 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +check: check-am +@USING_BDJAVA_FALSE@all-local: +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(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 \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -769,98 +1901,133 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f contrib/libudfread/src/$(DEPDIR)/$(am__dirstamp) + -rm -f contrib/libudfread/src/$(am__dirstamp) + -rm -f src/examples/$(DEPDIR)/$(am__dirstamp) + -rm -f src/examples/$(am__dirstamp) + -rm -f src/file/$(DEPDIR)/$(am__dirstamp) + -rm -f src/file/$(am__dirstamp) + -rm -f src/libbluray/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/$(am__dirstamp) + -rm -f src/libbluray/bdj/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/bdj/$(am__dirstamp) + -rm -f src/libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/bdj/native/$(am__dirstamp) + -rm -f src/libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/bdnav/$(am__dirstamp) + -rm -f src/libbluray/decoders/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/decoders/$(am__dirstamp) + -rm -f src/libbluray/disc/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/disc/$(am__dirstamp) + -rm -f src/libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libbluray/hdmv/$(am__dirstamp) + -rm -f src/util/$(DEPDIR)/$(am__dirstamp) + -rm -f src/util/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive +@USING_BDJAVA_FALSE@clean-local: +clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-local clean-noinstPROGRAMS mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf contrib/libudfread/src/$(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 Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: +install-data-am: install-jarDATA install-pkgconfigDATA \ + install-pkgincludeHEADERS -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: -install-exec-am: +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf contrib/libudfread/src/$(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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ +uninstall-am: uninstall-binPROGRAMS uninstall-jarDATA \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS + +.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 \ + 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 \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am + install-html-am install-info install-info-am install-jarDATA \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-jarDATA \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS @DX_COND_doc_TRUE@@DX_COND_ps_TRUE@doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps @@ -909,6 +2076,23 @@ @DX_COND_doc_TRUE@ rm -rf @DX_DOCDIR@ @DX_COND_doc_TRUE@ $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) +@USING_BDJAVA_TRUE@$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar: all-local + +@USING_BDJAVA_TRUE@all-local: +@USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ +@USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \ +@USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ +@USING_BDJAVA_TRUE@ -Dsrc_awt=:java-$(BDJ_TYPE) \ +@USING_BDJAVA_TRUE@ -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \ +@USING_BDJAVA_TRUE@ -Dversion='$(BDJ_TYPE)-$(VERSION)' + +@USING_BDJAVA_TRUE@clean-local: +@USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ +@USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \ +@USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ +@USING_BDJAVA_TRUE@ -Dversion='$(BDJ_TYPE)-$(VERSION)' \ +@USING_BDJAVA_TRUE@ clean + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru libbluray-0.5.0/src/examples/bd_info.c libbluray-0.8.1/src/examples/bd_info.c --- libbluray-0.5.0/src/examples/bd_info.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/bd_info.c 2015-05-15 09:23:46.000000000 +0000 @@ -17,18 +17,14 @@ * . */ -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include "libbluray/bdnav/meta_data.h" -#include "libbluray/bluray.h" - #include #include #include #include +#include "libbluray/bdnav/meta_data.h" +#include "libbluray/bluray.h" + static const char *_yes_no(int i) { return i > 0 ? "yes" : i < 0 ? "unknown" : "no"; @@ -55,7 +51,7 @@ static char *str = NULL; size_t i; - str = realloc(str, 2*len + 1); + str = (char*)realloc(str, 2*len + 1); *str = 0; for (i = 0; i < len; i++) { @@ -120,6 +116,31 @@ } } +static void _print_app_info(const BLURAY_DISC_INFO *info) +{ + static const char video_format_str[16][8] = { + "ignored", "480i", "576i", "480p", "1080i", "720p", "1080p", "576p" + }; + + static const char frame_rate_str[16][16] = { + "ignored", + "23.976 Hz", + "24 Hz", + "25 Hz", + "29.97 Hz", + "reserved", + "50 Hz", + "59.94 Hz" + }; + + printf("\nApplication info:\n"); + printf(" initial mode preference : %s\n", info->initial_output_mode_preference ? "3D" : "2D"); + printf(" 3D content exists : %s\n", info->content_exist_3D ? "Yes" : "No"); + printf(" video format : %s (0x%x)\n", video_format_str[info->video_format & 0xf], info->video_format); + printf(" frame rate : %s (0x%x)\n", frame_rate_str[info->frame_rate & 0xf], info->frame_rate); + printf(" provider data : \'%32s\'\n", info->provider_data); +} + int main(int argc, char *argv[]) { const char *disc_root = (argc > 1) ? argv[1] : NULL; @@ -146,6 +167,9 @@ exit(EXIT_FAILURE); } + if (info->udf_volume_id) { + printf("Volume Identifier : %s\n", info->udf_volume_id); + } printf("BluRay detected : %s\n", _yes_no(info->bluray_detected)); if (info->bluray_detected) { printf("First Play supported: %s\n", _yes_no(info->first_play_supported)); @@ -161,6 +185,8 @@ printf("Java VM found : %s\n", _yes_no(info->libjvm_detected)); printf("BD-J handled : %s\n", _yes_no(info->bdj_handled)); } + printf("BD-J organization ID: %s\n", info->bdj_org_id); + printf("BD-J disc ID : %s\n", info->bdj_disc_id); } } @@ -192,6 +218,8 @@ } } + _print_app_info(info); + _print_meta(bd_get_meta(bd)); bd_close(bd); diff -Nru libbluray-0.5.0/src/examples/bdjo_dump.c libbluray-0.8.1/src/examples/bdjo_dump.c --- libbluray-0.5.0/src/examples/bdjo_dump.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/examples/bdjo_dump.c 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,206 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#include "libbluray/bluray.h" +#include "libbluray/bdj/bdjo_data.h" + +#include +#include + +static const char *_yes_no(int i) +{ + return i > 0 ? "yes" : i < 0 ? "unknown" : "no"; +} + +static const char *_binding_str(int i) +{ + switch (i) { + case 0: return "unbound"; + case 1: return "disc bound"; + case 3: return "title bound"; + default: return "???"; + } +} + +static const char *_visibility_str(int i) +{ + switch (i) { + case 0: return "none"; + case 1: return "applications"; + case 2: return "user"; + default: return "???"; + } +} + +static void _terminal_info_print(const BDJO_TERMINAL_INFO *p) +{ + printf("Terminal Info:\n"); + printf(" Default AWT font : %s\n", p->default_font); + printf(" initial HaVi config : %d\n", p->initial_havi_config_id); + printf(" Menu call mask : %d\n", p->menu_call_mask); + printf(" Title search mask : %d\n", p->menu_call_mask); +} + +static void _app_cache_item_print(const BDJO_APP_CACHE_ITEM *p) +{ + printf(" %3.3s: %s%s\n", + p->lang_code, p->ref_to_name, + p->type == 1 ? ".jar" : p->type == 2 ? "/" : " (unknown type)"); +} + +static void _app_cache_info_print(const BDJO_APP_CACHE_INFO *p) +{ + unsigned ii; + + printf("Application cache info:\n"); + for (ii = 0; ii < p->num_item; ii++) { + _app_cache_item_print(&p->item[ii]); + } +} + +static void _accessible_playlists_print(const BDJO_ACCESSIBLE_PLAYLISTS *p) +{ + unsigned ii; + + printf("Accessible playlists:\n"); + printf(" Access to all : %s\n", _yes_no(p->access_to_all_flag)); + printf(" Autostart first : %s\n", _yes_no(p->autostart_first_playlist_flag)); + + if (p->num_pl) { + printf(" Playlists : %d\n", p->num_pl); + for (ii = 0; ii < p->num_pl; ii++) { + printf(" %s.mpls\n", p->pl[ii].name); + } + } +} + +static void _app_profile_print(BDJO_APP_PROFILE *p) +{ + printf(" Profile %d Version %d.%d.%d\n", + p->profile_number, p->major_version, p->minor_version, p->micro_version); +} + +static void _app_print(const BDJO_APP *p) +{ + unsigned ii; + + printf(" Control code: : %d (%s)\n", p->control_code, + p->control_code == 1 ? "autostart" : p->control_code == 2 ? "present" : "???"); + printf(" Type : %d (%s)\n", p->type, + p->type == 1 ? "BD-J App" : "???"); + printf(" Organization ID : %08X\n", p->org_id); + printf(" Application ID : %04X\n", p->app_id); + printf(" Priority : %d\n", p->priority); + printf(" Binding : %d (%s)\n", p->binding, _binding_str(p->binding)); + printf(" Visibility : %d (%s)\n", p->visibility, _visibility_str(p->visibility)); + + if (p->num_profile) { + printf(" Profiles:\n"); + for (ii = 0; ii < p->num_profile; ii++) { + _app_profile_print(&p->profile[ii]); + } + } + + if (p->num_name) { + printf(" Names:\n"); + for (ii = 0; ii < p->num_name; ii++) { + printf(" %s: %s\n", p->name[ii].lang, p->name[ii].name); + } + } + + printf(" Base directory : %s\n", p->base_dir); + printf(" Icon locator : %s\n", p->icon_locator); + printf(" Icon flags : 0x%04x\n", p->icon_flags); + printf(" Classpath extension : %s\n", p->classpath_extension); + printf(" Initial class : %s\n", p->initial_class); + printf(" Parameters : "); + for (ii = 0; ii < p->num_param; ii++) { + printf("%s ", p->param[ii].param); + } + printf("\n"); +} + +static void _app_management_table_print(const BDJO_APP_MANAGEMENT_TABLE *p) +{ + unsigned ii; + + for (ii = 0; ii < p->num_app; ii++) { + printf("Application %d:\n", ii); + _app_print(&p->app[ii]); + } +} + +static void _key_interest_table_print(const BDJO_KEY_INTEREST_TABLE *p) +{ + unsigned int v; + memcpy(&v, p, sizeof(unsigned int)); + if (v) { + printf("Key interest table:\n"); + printf(" %s%s%s%s%s%s%s%s%s%s%s\n", + p->vk_play ? "VK_PLAY " : "", + p->vk_stop ? "VK_STOP " : "", + p->vk_ffw ? "VK_FFW " : "", + p->vk_rew ? "VK_REW " : "", + p->vk_track_next ? "VK_TRACK_NEXT " : "", + p->vk_track_prev ? "VK_TRACK_PREV " : "", + p->vk_pause ? "VK_PAUSE " : "", + p->vk_still_off ? "VK_STILL_OFF " : "", + p->vk_sec_audio_ena_dis ? "VK_SEC_AUDIO " : "", + p->vk_sec_video_ena_dis ? "VK_SEC_VIDEO " : "", + p->pg_textst_ena_dis ? "VK_PG_TEXTST " : ""); + } +} + +static void _file_access_info_print(const BDJO_FILE_ACCESS_INFO *p) +{ + printf("File access info:\n %s\n", p->path); +} + +static void _bdjo_print(const BDJO *p) +{ + _terminal_info_print(&p->terminal_info); + _app_cache_info_print(&p->app_cache_info); + _accessible_playlists_print(&p->accessible_playlists); + _app_management_table_print(&p->app_table); + _key_interest_table_print(&p->key_interest_table); + _file_access_info_print(&p->file_access_info); +} + +int main(int argc, const char *argv[]) +{ + if (argc < 2) { + fprintf(stderr, "usage: %s \n", argv[0]); + return 1; + } + + int cnt; + for (cnt = 1; cnt < argc; cnt++) { + + printf("%s\n", argv[cnt]); + + BDJO *bdjo = bd_read_bdjo(argv[cnt]); + if (bdjo) { + _bdjo_print(bdjo); + bd_free_bdjo(bdjo); + } + printf("\n"); + } + + return 0; +} diff -Nru libbluray-0.5.0/src/examples/bdj_test.c libbluray-0.8.1/src/examples/bdj_test.c --- libbluray-0.5.0/src/examples/bdj_test.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/bdj_test.c 2015-01-26 08:01:57.000000000 +0000 @@ -53,7 +53,6 @@ BLURAY* bd = bd_open(argv[1], NULL); bd_get_titles(bd, TITLES_ALL, 0); - bd_select_title(bd, 1); if (!bd_start_bdj(bd, argv[2])) { printf("Failed to start BD-J application.\n"); diff -Nru libbluray-0.5.0/src/examples/bdsplice.c libbluray-0.8.1/src/examples/bdsplice.c --- libbluray-0.5.0/src/examples/bdsplice.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/bdsplice.c 2015-05-15 09:25:06.000000000 +0000 @@ -21,15 +21,14 @@ #include "config.h" #endif -#include "libbluray/bluray.h" -#include "util/macro.h" -#include "util/strutl.h" - +#include #include #include #include #include +#include "libbluray/bluray.h" + #define PKT_SIZE 192 #define BUF_SIZE (PKT_SIZE * 1024) #define MIN(a,b) (((a) < (b)) ? a : b) @@ -227,7 +226,7 @@ } break; } - total += PKT_SIZE * wrote; + total += wrote; } if (verbose) { fprintf(stderr, "Wrote %"PRId64" bytes\n", total); diff -Nru libbluray-0.5.0/src/examples/clpi_dump.c libbluray-0.8.1/src/examples/clpi_dump.c --- libbluray-0.5.0/src/examples/clpi_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/clpi_dump.c 2015-01-26 08:01:57.000000000 +0000 @@ -18,8 +18,6 @@ * . */ -#include "config.h" - #include #include #include diff -Nru libbluray-0.5.0/src/examples/hdmv_test.c libbluray-0.8.1/src/examples/hdmv_test.c --- libbluray-0.5.0/src/examples/hdmv_test.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/hdmv_test.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,14 +17,14 @@ * . */ -#include "util/log_control.h" -#include "libbluray/bluray.h" - #include #include #include #include +#include "util/log_control.h" +#include "libbluray/bluray.h" + static void _print_event(BD_EVENT *ev) { switch (ev->event) { diff -Nru libbluray-0.5.0/src/examples/index_dump.c libbluray-0.8.1/src/examples/index_dump.c --- libbluray-0.5.0/src/examples/index_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/index_dump.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,110 +17,76 @@ * . */ -#include "libbluray/bdnav/index_parse.h" - #include -static void _indx_print_app_info(INDX_APP_INFO *app_info) -{ - const char video_format_str[16][8] = { - "ignored", "480i", "576i", "480p", "1080i", "720p", "1080p", "576p" - }; - - const char frame_rate_str[16][16] = { - "ignored", - "23.976 Hz", - "24 Hz", - "25 Hz", - "29.97 Hz", - "reserved", - "50 Hz", - "59.94 Hz" - }; - - printf(" initial mode : %s\n", app_info->initial_output_mode_preference ? "3D" : "2D"); - printf(" content exists: %s\n", app_info->content_exist_flag ? "Yes" : "No"); - printf(" video format : %s (0x%x)\n", video_format_str[app_info->video_format], app_info->video_format); - printf(" frame rate : %s (0x%x)\n", frame_rate_str[app_info->frame_rate], app_info->frame_rate); - printf(" provider data : %32s\n", app_info->user_data); -} - -static void _indx_print_hdmv_obj(INDX_HDMV_OBJ *hdmv) -{ - const char *const playback_types[] = {"Movie", "Interactive", "???", "???"}; - - printf(" object type : HDMV\n"); - printf(" playback type : %s\n", playback_types[hdmv->playback_type]); - printf(" id_ref : %u\n", hdmv->id_ref); -} +#include "libbluray/bluray.h" -static void _indx_print_bdj_obj(INDX_BDJ_OBJ *bdj) +static void _indx_print_title(const BLURAY_TITLE *title, int normal_title) { - const char * const playback_types[] = {"???", "???", "Movie", "Interactive"}; + printf(" object type : %s\n", title->bdj ? "BD-J" : "HDMV"); + printf(" playback type : %s\n", title->interactive ? "Interactive" : "Movie"); + printf(title->bdj ? + " name : %05d.bdjo\n" : + " id_ref : %u\n", + title->id_ref); - printf(" object type : BD-J\n"); - printf(" playback type : %s\n", playback_types[bdj->playback_type]); - printf(" name : %s\n", bdj->name); -} - -static void _indx_print_play_item(INDX_PLAY_ITEM *title) -{ - if (title->object_type == 1) { - _indx_print_hdmv_obj(&title->hdmv); - } else { - _indx_print_bdj_obj(&title->bdj); + if (normal_title) { + printf(" access type : %s%s\n", title->accessible ? "Accessible" : "Prohibited", title->hidden ? ", Hidden" : ""); } } -static void _indx_print_title(INDX_TITLE *title) -{ - if (title->object_type == 1) { - _indx_print_hdmv_obj(&title->hdmv); - } else { - _indx_print_bdj_obj(&title->bdj); - } - printf(" access type : %d\n", title->access_type); -} - -static void _indx_print(INDX_ROOT *index) +static void _indx_print(const BLURAY_DISC_INFO *info) { uint32_t i; - printf("Application info:\n"); - _indx_print_app_info(&index->app_info); - printf("\nFirst playback:\n"); - _indx_print_play_item(&index->first_play); + if (info->first_play) { + _indx_print_title(info->first_play, 0); + } else { + printf(" (not present)\n"); + } printf("\nTop menu:\n"); - _indx_print_play_item(&index->top_menu); + if (info->top_menu) { + _indx_print_title(info->titles[0], 0); + } else { + printf(" (not present)\n"); + } - printf("\nTitles: %d\n", index->num_titles); - for (i = 0; i < index->num_titles; i++) { - printf("%02d", i); - _indx_print_title(&index->titles[i]); + printf("\nTitles: %d\n", info->num_titles); + for (i = 1; i <= info->num_titles; i++) { + printf("%02d %s\n", i, info->titles[i]->name ? info->titles[i]->name : ""); + _indx_print_title(info->titles[i], 1); } } int main(int argc, const char *argv[]) { - char file[1024]; - INDX_ROOT *index; + BLURAY *bd; + const BLURAY_DISC_INFO *info; if (argc != 2) { fprintf(stderr, "usage: %s \n", argv[0]); return 1; } - sprintf(file, "%s/BDMV/index.bdmv", argv[1]); - - index = indx_parse(file); + bd = bd_open(argv[1], NULL); + if (!bd) { + fprintf(stderr, "error opening BD disc %s\n", argv[1]); + return -1; + } - if (index) { - _indx_print(index); + info = bd_get_disc_info(bd); - indx_free(&index); + if (!info->bluray_detected) { + fprintf(stderr, "no BD disc detected in %s\n", argv[1]); + bd_close(bd); + return -1; } + _indx_print(info); + + bd_close(bd); + return 0; } diff -Nru libbluray-0.5.0/src/examples/libbluray_test.c libbluray-0.8.1/src/examples/libbluray_test.c --- libbluray-0.5.0/src/examples/libbluray_test.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/libbluray_test.c 2015-01-26 08:01:57.000000000 +0000 @@ -18,17 +18,13 @@ * . */ -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include "libbluray/bluray.h" - #include #include #include #include +#include "libbluray/bluray.h" + int main(int argc, char *argv[]) { BLURAY *bd; diff -Nru libbluray-0.5.0/src/examples/list_titles.c libbluray-0.8.1/src/examples/list_titles.c --- libbluray-0.5.0/src/examples/list_titles.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/list_titles.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,10 +17,6 @@ * . */ -#if HAVE_CONFIG_H -#include "config.h" -#endif - #include "libbluray/bluray.h" #include @@ -32,7 +28,7 @@ static void _usage(char *cmd) { - fprintf(stderr, + fprintf(stderr, "%s [-s ]\n" " List the titles and title info of a BD\n" " -s # - Filter out titles shorter than # seconds\n" diff -Nru libbluray-0.5.0/src/examples/mobj_dump.c libbluray-0.8.1/src/examples/mobj_dump.c --- libbluray-0.5.0/src/examples/mobj_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/mobj_dump.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,9 +17,12 @@ * . */ -#include "util/macro.h" -#include "libbluray/hdmv/mobj_parse.h" +#include "libbluray/bluray.h" +#include "libbluray/hdmv/mobj_data.h" +#include "libbluray/hdmv/mobj_print.h" + +#include #include static void _mobj_print(MOBJ_OBJECTS *objects, int disasm) @@ -53,13 +56,12 @@ int main(int argc, const char *argv[]) { - char file[1024]; int disasm = 0; MOBJ_OBJECTS *mobj = NULL; if (argc < 2) { fprintf(stderr, - "usage: %s [-d] \n" + "usage: %s [-d] \n" "Options:\n" " d disassemble object code\n", argv[0]); @@ -69,14 +71,12 @@ disasm = !strcmp(argv[1], "-d"); } - sprintf(file, "%s/BDMV/MovieObject.bdmv", argv[argc-1]); - - mobj = mobj_parse(file); + mobj = bd_read_mobj(argv[argc-1]); if (mobj) { _mobj_print(mobj, disasm); - mobj_free(&mobj); + bd_free_mobj(mobj); } return 0; diff -Nru libbluray-0.5.0/src/examples/mpls_dump.c libbluray-0.8.1/src/examples/mpls_dump.c --- libbluray-0.5.0/src/examples/mpls_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/mpls_dump.c 2015-03-20 10:51:10.000000000 +0000 @@ -25,12 +25,20 @@ #include #include -#include "util/strutl.h" - #include "libbluray/bdnav/mpls_parse.h" +#include "libbluray/bluray.h" #include "util.h" +#ifdef _WIN32 +# define DIR_SEP "\\" +# define PLAYLIST_DIR "\\BDMV\\PLAYLIST" +#else +# define DIR_SEP "/" +# define PLAYLIST_DIR "/BDMV/PLAYLIST" +#endif + + static int verbose; typedef struct { @@ -126,6 +134,13 @@ {0, NULL} }; +const VALUE_MAP connection_type_map[] = { + {1, "Non-seamless"}, + {5, "Seamless"}, + {6, "Seamless"}, + {0, NULL} +}; + static const char* _lookup_str(const VALUE_MAP *map, int val) { @@ -139,6 +154,19 @@ return "?"; } +static char * +_mk_path(const char *base, const char *sub) +{ + size_t n1 = strlen(base); + size_t n2 = strlen(sub); + char *result = (char*)malloc(n1 + n2 + strlen(DIR_SEP) + 1); + strcpy(result, base); + strcat(result, DIR_SEP); + strcat(result, sub); + + return result; +} + static void _show_stream(MPLS_STREAM *ss, int level) { @@ -222,8 +250,9 @@ pi = &pl->play_item[ii]; indent_printf(level, "Clip Id %s", pi->clip[0].clip_id); indent_printf(level+1, "Stc Id: %02x", pi->clip[0].stc_id); - indent_printf(level+1, "Connection Condition: %02x", - pi->connection_condition); + indent_printf(level+1, "Connection Condition: %s (%02x)", + _lookup_str(connection_type_map, pi->connection_condition), + pi->connection_condition); indent_printf(level+1, "In-Time: %d", pi->in_time); indent_printf(level+1, "Out-Time: %d", pi->out_time); if (pi->still_mode == 1) { @@ -368,7 +397,9 @@ indent_printf(level+2, "Clip Id %s", pi->clip[0].clip_id); indent_printf(level+2, "Multi clip: %d", pi->is_multi_clip); indent_printf(level+2, "Clip count: %d", pi->clip_count); - indent_printf(level+2, "Connection Condition: %02x", pi->connection_condition); + indent_printf(level+2, "Connection Condition: %s (%02x)", + _lookup_str(connection_type_map, pi->connection_condition), + pi->connection_condition); indent_printf(level+2, "In-Time: %d", pi->in_time); indent_printf(level+2, "Out-Time: %d", pi->out_time); indent_printf(level+2, "Sync playitem Id: %d", pi->sync_play_item_id); @@ -543,26 +574,26 @@ { MPLS_PL *pl; - pl = mpls_parse(name); + pl = bd_read_mpls(name); if (pl == NULL) { fprintf(stderr, "Parse failed: %s\n", name); return NULL; } if (seconds) { if (!_filter_short(pl, seconds)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } if (repeats) { if (!_filter_repeats(pl, repeats)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } if (dups) { if (!_filter_dup(pl_list, pl_count, pl)) { - mpls_free(pl); + bd_free_mpls(pl); return NULL; } } @@ -710,7 +741,7 @@ if (S_ISDIR(st.st_mode)) { printf("Directory: %s:\n", argv[ii]); - path = str_printf("%s/BDMV/PLAYLIST", argv[ii]); + path = _mk_path(argv[ii], PLAYLIST_DIR); if (path == NULL) { fprintf(stderr, "Failed to find playlist path: %s\n", argv[ii]); continue; @@ -723,18 +754,16 @@ } } if (dir != NULL) { - char **dirlist = calloc(10001, sizeof(char*)); + char **dirlist = (char**)calloc(10001, sizeof(char*)); struct dirent *ent; int jj = 0; for (ent = readdir(dir); ent != NULL; ent = readdir(dir)) { - if (ent->d_name != NULL) { - dirlist[jj++] = str_dup(ent->d_name); - } + dirlist[jj++] = strcpy((char*)malloc(strlen(ent->d_name)), ent->d_name); } qsort(dirlist, jj, sizeof(char*), _qsort_str_cmp); for (jj = 0; dirlist[jj] != NULL; jj++) { char *name = NULL; - name = str_printf("%s/%s", path, dirlist[jj]); + name = _mk_path(path, dirlist[jj]); free(dirlist[jj]); if (stat(name, &st)) { free(name); @@ -749,7 +778,7 @@ if (pl != NULL) { pl_list[pl_ii++] = pl; } - } while (ent != NULL); + } free(dirlist); free(path); } else { @@ -761,7 +790,7 @@ } // Cleanup for (ii = 0; ii < pl_ii; ii++) { - mpls_free(pl_list[ii]); + bd_free_mpls(pl_list[ii]); } return 0; } diff -Nru libbluray-0.5.0/src/examples/sound_dump.c libbluray-0.8.1/src/examples/sound_dump.c --- libbluray-0.5.0/src/examples/sound_dump.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/sound_dump.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,11 +17,11 @@ * . */ -#include "libbluray/bluray.h" - #include #include +#include "libbluray/bluray.h" + static void _sound_print(int sound_index, BLURAY_SOUND_EFFECT *data) { diff -Nru libbluray-0.5.0/src/examples/util.c libbluray-0.8.1/src/examples/util.c --- libbluray-0.5.0/src/examples/util.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/util.c 2015-01-26 08:01:57.000000000 +0000 @@ -23,24 +23,6 @@ #include "util.h" void -hex_dump(uint8_t *buf, int count) -{ - int ii; - - for (ii = 0; ii < count; ii++) - { - if ((ii & 0xF) == 0xF) - fprintf(stderr, "%02x\n", buf[ii]); - else if ((ii & 0x7) == 0x7) - fprintf(stderr, "%02x ", buf[ii]); - else - fprintf(stderr, "%02x ", buf[ii]); - } - if ((ii & 0xF) != 0x0) - fprintf(stderr, "\n"); -} - -void indent_printf(int level, const char *fmt, ...) { va_list ap; diff -Nru libbluray-0.5.0/src/examples/util.h libbluray-0.8.1/src/examples/util.h --- libbluray-0.5.0/src/examples/util.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/examples/util.h 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,7 @@ #include -#include "../util/attributes.h" +#include "util/attributes.h" #if defined( __MINGW32__ ) # undef lseek @@ -39,6 +39,5 @@ # define wstat _wstati64 #endif -void hex_dump(uint8_t *buf, int count); void indent_printf(int level, const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(2,3); diff -Nru libbluray-0.5.0/src/file/dir_posix.c libbluray-0.8.1/src/file/dir_posix.c --- libbluray-0.5.0/src/file/dir_posix.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dir_posix.c 2015-05-15 09:25:06.000000000 +0000 @@ -54,16 +54,21 @@ } else if (p_e == NULL) { return 1; } - strncpy(entry->d_name, e.d_name, 256); + strncpy(entry->d_name, e.d_name, sizeof(entry->d_name)); + entry->d_name[sizeof(entry->d_name) - 1] = 0; return 0; } static BD_DIR_H *_dir_open_posix(const char* dirname) { - BD_DIR_H *dir = malloc(sizeof(BD_DIR_H)); + BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H)); BD_DEBUG(DBG_DIR, "Opening POSIX dir %s... (%p)\n", dirname, (void*)dir); + if (!dir) { + return NULL; + } + dir->close = _dir_close_posix; dir->read = _dir_read_posix; @@ -79,3 +84,8 @@ } BD_DIR_H* (*dir_open)(const char* dirname) = _dir_open_posix; + +BD_DIR_OPEN dir_open_default(void) +{ + return _dir_open_posix; +} diff -Nru libbluray-0.5.0/src/file/dirs_darwin.c libbluray-0.8.1/src/file/dirs_darwin.c --- libbluray-0.5.0/src/file/dirs_darwin.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dirs_darwin.c 2015-05-15 09:25:06.000000000 +0000 @@ -38,82 +38,45 @@ #define SYSTEM_CFG_DIR "/Library/Preferences" -const char *file_get_config_home(void) +char *file_get_config_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CFG_DIR); - } - - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CFG_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_DATA_DIR); - } - - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_DATA_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR); - } - - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CACHE_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } const char *file_get_config_system(const char *dir) { - static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" - - if (!dirs) { - dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); - } - if (!dir) { // first call - dir = dirs; - } else { - // next call - dir += strlen(dir) + 1; - if (!*dir) { - // end of list - dir = NULL; - } + return SYSTEM_CFG_DIR; } - return dir; + return NULL; } diff -Nru libbluray-0.5.0/src/file/dirs.h libbluray-0.8.1/src/file/dirs.h --- libbluray-0.5.0/src/file/dirs.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dirs.h 2015-03-04 08:34:15.000000000 +0000 @@ -20,19 +20,20 @@ #ifndef BLURAY_DIRS_H #define BLURAY_DIRS_H -#include +#include "util/attributes.h" #ifdef _WIN32 -BD_PRIVATE int win32_mkdir(const char *dir); +BD_PRIVATE char *win32_get_font_dir(const char *font_file); #endif /* * Config, cache and data dirs */ -BD_PRIVATE const char *file_get_config_home(void); BD_PRIVATE const char *file_get_config_system(const char *dir); -BD_PRIVATE const char *file_get_cache_home(void); -BD_PRIVATE const char *file_get_data_home(void); + +BD_PRIVATE char *file_get_config_home(void) BD_ATTR_MALLOC; +BD_PRIVATE char *file_get_cache_home(void) BD_ATTR_MALLOC; +BD_PRIVATE char *file_get_data_home(void) BD_ATTR_MALLOC; #endif diff -Nru libbluray-0.5.0/src/file/dirs_win32.c libbluray-0.8.1/src/file/dirs_win32.c --- libbluray-0.5.0/src/file/dirs_win32.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dirs_win32.c 2015-05-15 09:25:06.000000000 +0000 @@ -29,39 +29,46 @@ #include #include -#include #include +#include #include -#include -int win32_mkdir(const char *dir) +char *win32_get_font_dir(const char *font_file) { wchar_t wdir[MAX_PATH]; + if (S_OK != SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, wdir)) { + GetWindowsDirectoryW(wdir, MAX_PATH); + wcscat(wdir, L"\\fonts"); + } - MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); - return _wmkdir(wdir); + int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); + char *path = malloc(len + strlen(font_file) + 2); + if (path) { + WideCharToMultiByte(CP_UTF8, 0, wdir, -1, path, len, NULL, NULL); + path[len - 1] = '\\'; + strcpy(path + len, font_file); + } + return path; } -const char *file_get_config_home(void) +char *file_get_config_home(void) { return file_get_data_home(); } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *appdir = NULL; wchar_t wdir[MAX_PATH]; - if (appdir) - return appdir; - /* Get the "Application Data" folder for the user */ if (S_OK == SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, wdir)) { int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); - appdir = malloc(len); - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + char *appdir = malloc(len); + if (appdir) { + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + } return appdir; } @@ -69,7 +76,7 @@ return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { return file_get_data_home(); } @@ -90,7 +97,9 @@ NULL, SHGFP_TYPE_CURRENT, wdir)) { int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); appdir = malloc(len); - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + if (appdir) { + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + } return appdir; } else { BD_DEBUG(DBG_FILE, "Can't find common configuration directory !\n"); diff -Nru libbluray-0.5.0/src/file/dirs_xdg.c libbluray-0.8.1/src/file/dirs_xdg.c --- libbluray-0.5.0/src/file/dirs_xdg.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dirs_xdg.c 2015-05-15 09:25:06.000000000 +0000 @@ -26,7 +26,6 @@ #include "util/strutl.h" #include "util/logging.h" -#include #include #include @@ -41,76 +40,52 @@ #define SYSTEM_CFG_DIR "/etc/xdg" -const char *file_get_config_home(void) +char *file_get_config_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_home = getenv("XDG_CONFIG_HOME"); - if (xdg_home && *xdg_home) { - return dir = str_printf("%s", xdg_home); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CFG_DIR); - } + const char *xdg_home = getenv("XDG_CONFIG_HOME"); + if (xdg_home && *xdg_home) { + return str_dup(xdg_home); + } - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CFG_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_home = getenv("XDG_DATA_HOME"); - if (xdg_home && *xdg_home) { - return dir = str_printf("%s", xdg_home); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_DATA_DIR); - } + const char *xdg_home = getenv("XDG_DATA_HOME"); + if (xdg_home && *xdg_home) { + return str_dup(xdg_home); + } - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_DATA_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_cache = getenv("XDG_CACHE_HOME"); - if (xdg_cache && *xdg_cache) { - return dir = str_printf("%s", xdg_cache); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR); - } + const char *xdg_cache = getenv("XDG_CACHE_HOME"); + if (xdg_cache && *xdg_cache) { + return str_dup(xdg_cache); + } - BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CACHE_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } const char *file_get_config_system(const char *dir) @@ -123,6 +98,9 @@ if (xdg_sys && *xdg_sys) { dirs = calloc(1, strlen(xdg_sys) + 2); + if (!dirs) { + return NULL; + } strcpy(dirs, xdg_sys); char *pt = dirs; diff -Nru libbluray-0.5.0/src/file/dir_win32.c libbluray-0.8.1/src/file/dir_win32.c --- libbluray-0.5.0/src/file/dir_win32.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dir_win32.c 2015-05-15 09:25:06.000000000 +0000 @@ -72,9 +72,12 @@ static BD_DIR_H *_dir_open_win32(const char* dirname) { - BD_DIR_H *dir = malloc(sizeof(BD_DIR_H)); + BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H)); BD_DEBUG(DBG_DIR, "Opening WIN32 dir %s... (%p)\n", dirname, (void*)dir); + if (!dir) { + return NULL; + } dir->close = _dir_close_win32; dir->read = _dir_read_win32; @@ -104,3 +107,8 @@ } BD_DIR_H* (*dir_open)(const char* dirname) = _dir_open_win32; + +BD_DIR_OPEN dir_open_default(void) +{ + return _dir_open_win32; +} diff -Nru libbluray-0.5.0/src/file/dl.h libbluray-0.8.1/src/file/dl.h --- libbluray-0.5.0/src/file/dl.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dl.h 2015-02-12 09:56:04.000000000 +0000 @@ -21,7 +21,7 @@ #ifndef DL_H_ #define DL_H_ -#include +#include "util/attributes.h" #include @@ -30,10 +30,12 @@ */ #ifdef __cplusplus +typedef void (*fptr_void)(...); typedef int (*fptr_int)(...); typedef int32_t (*fptr_int32)(...); typedef void* (*fptr_p_void)(...); #else +typedef void (*fptr_void)(); typedef int (*fptr_int)(); typedef int32_t (*fptr_int32)(); typedef void* (*fptr_p_void)(); diff -Nru libbluray-0.5.0/src/file/dl_posix.c libbluray-0.8.1/src/file/dl_posix.c --- libbluray-0.5.0/src/file/dl_posix.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dl_posix.c 2015-05-15 09:25:06.000000000 +0000 @@ -81,6 +81,11 @@ name = str_printf("%s%s%s", search_paths[i], path, ext); } + if (!name) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "out of memory\n"); + continue; + } + BD_DEBUG(DBG_FILE, "Attempting to open %s\n", name); dll = _dl_dlopen (name); @@ -98,7 +103,7 @@ void *result = dlsym(handle, symbol); if (!result) { - BD_DEBUG(DBG_FILE | DBG_CRIT, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror()); + BD_DEBUG(DBG_FILE, "dlsym(%p, '%s') failed: %s\n", handle, symbol, dlerror()); } return result; diff -Nru libbluray-0.5.0/src/file/dl_win32.c libbluray-0.8.1/src/file/dl_win32.c --- libbluray-0.5.0/src/file/dl_win32.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/dl_win32.c 2015-05-15 09:25:06.000000000 +0000 @@ -29,7 +29,7 @@ #include "util/strutl.h" #include - +#include #include static const char *dlerror(char *buf, int buf_size) @@ -55,11 +55,18 @@ void *dl_dlopen(const char *path, const char *version) { + (void)version; + wchar_t wname[MAX_PATH]; char *name; void *result; name = str_printf("%s.dll", path); + if (!name) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "out of memory\n"); + return NULL; + } + MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, MAX_PATH); X_FREE(name); @@ -79,7 +86,7 @@ if (!result) { char buf[128]; - BD_DEBUG(DBG_FILE | DBG_CRIT, "GetProcAddress(%p, '%s') failed: %s\n", handle, symbol, dlerror(buf, sizeof(buf))); + BD_DEBUG(DBG_FILE, "GetProcAddress(%p, '%s') failed: %s\n", handle, symbol, dlerror(buf, sizeof(buf))); } return result; diff -Nru libbluray-0.5.0/src/file/file.c libbluray-0.8.1/src/file/file.c --- libbluray-0.5.0/src/file/file.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/file/file.c 2015-03-04 08:34:15.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "file.h" + +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include // SEEK_* +#include // strchr + + +int64_t file_size(BD_FILE_H *fp) +{ + int64_t pos = file_tell(fp); + int64_t res1 = file_seek(fp, 0, SEEK_END); + int64_t length = file_tell(fp); + int64_t res2 = file_seek(fp, pos, SEEK_SET); + + if (res1 < 0 || res2 < 0 || pos < 0 || length < 0) { + return -1; + } + + return length; +} + +int file_mkdirs(const char *path) +{ + int result = 0; + char *dir = str_dup(path); + char *end = dir; + char *p; + + /* strip file name */ + if (!(end = strrchr(end, DIR_SEP_CHAR))) { + X_FREE(dir); + return -1; + } + *end = 0; + + /* tokenize, stop to first existing dir */ + while ((p = strrchr(dir, DIR_SEP_CHAR))) { + if (!file_path_exists(dir)) { + break; + } + *p = 0; + } + + /* create missing dirs */ + p = dir; + while (p < end) { + + /* concatenate next non-existing dir */ + while (*p) p++; + if (p >= end) break; + *p = DIR_SEP_CHAR; + + result = file_mkdir(dir); + if (result < 0) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error creating directory %s\n", dir); + break; + } + BD_DEBUG(DBG_FILE, " created directory %s\n", dir); + } + + X_FREE(dir); + return result; +} diff -Nru libbluray-0.5.0/src/file/file.h libbluray-0.8.1/src/file/file.h --- libbluray-0.5.0/src/file/file.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/file.h 2015-05-15 09:25:06.000000000 +0000 @@ -23,24 +23,28 @@ #include "filesystem.h" -#include +#include "util/attributes.h" #include -//#ifdef __LINUX__ -#define DIR_SEP "/" -//#endif +#ifdef _WIN32 +# define DIR_SEP "\\" +# define DIR_SEP_CHAR '\\' +#else +# define DIR_SEP "/" +# define DIR_SEP_CHAR '/' +#endif /* * file access */ -#define file_close(X) X->close(X) +#define file_close(X) X->close(X) #define file_seek(X,Y,Z) X->seek(X,Y,Z) -#define file_tell(X) X->tell(X) -#define file_eof(X) X->eof(X) +#define file_tell(X) X->tell(X) +//#define file_eof(X) X->eof(X) #define file_read(X,Y,Z) (size_t)X->read(X,Y,Z) -#define file_write(X,Y,Z) (size_t)X->write(X,Y,Z) +//#define file_write(X,Y,Z) (size_t)X->write(X,Y,Z) BD_PRIVATE int64_t file_size(BD_FILE_H *fp); BD_PRIVATE extern BD_FILE_H* (*file_open)(const char* filename, const char *mode); @@ -57,4 +61,15 @@ BD_PRIVATE extern BD_DIR_H* (*dir_open)(const char* dirname); +BD_PRIVATE BD_DIR_OPEN dir_open_default(void); + +/* + * local filesystem + */ + +BD_PRIVATE int file_unlink(const char *file); +BD_PRIVATE int file_path_exists(const char *path); +BD_PRIVATE int file_mkdir(const char *dir); +BD_PRIVATE int file_mkdirs(const char *path); + #endif /* FILE_H_ */ diff -Nru libbluray-0.5.0/src/file/file_posix.c libbluray-0.8.1/src/file/file_posix.c --- libbluray-0.5.0/src/file/file_posix.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/file_posix.c 2015-05-15 09:25:06.000000000 +0000 @@ -2,6 +2,7 @@ * This file is part of libbluray * Copyright (C) 2009-2010 Obliter0n * Copyright (C) 2009-2010 John Stebbins + * Copyright (C) 2010-2015 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,137 +23,166 @@ #include "config.h" #endif -#if defined(__MINGW32__) -/* ftello64() and fseeko64() prototypes from stdio.h */ -# undef __STRICT_ANSI__ -#endif - #include "file.h" #include "util/macro.h" #include "util/logging.h" -#include -#include +#include #include +#include // remove() +#include +#include -#ifdef _WIN32 -#include -#endif // #ifdef _WIN32 +#include +#include +#include +#include -static void file_close_linux(BD_FILE_H *file) +static void _file_close(BD_FILE_H *file) { if (file) { - fclose((FILE *)file->internal); + close((int)(intptr_t)file->internal); - BD_DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", (void*)file); + BD_DEBUG(DBG_FILE, "Closed POSIX file (%p)\n", (void*)file); X_FREE(file); } } -static int64_t file_seek_linux(BD_FILE_H *file, int64_t offset, int32_t origin) +static int64_t _file_seek(BD_FILE_H *file, int64_t offset, int32_t origin) { -#if defined(__MINGW32__) - return fseeko64((FILE *)file->internal, offset, origin); -#elif defined(_WIN32) - return _fseeki64((FILE *)file->internal, offset, origin); -#else - return fseeko((FILE *)file->internal, offset, origin); -#endif + off_t result = lseek((int)(intptr_t)file->internal, offset, origin); + if (result == (off_t)-1) { + BD_DEBUG(DBG_FILE, "lseek() failed (%p)\n", (void*)file); + return -1; + } + return (int64_t)result; } -static int64_t file_tell_linux(BD_FILE_H *file) +static int64_t _file_tell(BD_FILE_H *file) { -#if defined(__MINGW32__) - return ftello64((FILE *)file->internal); -#elif defined(_WIN32) - return _ftelli64((FILE *)file->internal); -#else - return ftello((FILE *)file->internal); -#endif + return _file_seek(file, 0, SEEK_CUR); } -static int file_eof_linux(BD_FILE_H *file) +#if 0 +static int _file_eof(BD_FILE_H *file) { return feof((FILE *)file->internal); } +#endif -#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1)) - -static int64_t file_read_linux(BD_FILE_H *file, uint8_t *buf, int64_t size) +static int64_t _file_read(BD_FILE_H *file, uint8_t *buf, int64_t size) { - if (size > 0 && size < BD_MAX_SSIZE) { - return (int64_t)fread(buf, 1, (size_t)size, (FILE *)file->internal); + ssize_t got, result; + + if (size <= 0 || size >= BD_MAX_SSIZE) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); + return 0; } - BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); - return 0; + for (got = 0; got < (ssize_t)size; got += result) { + result = read((int)(intptr_t)file->internal, buf + got, size - got); + if (result < 0) { + if (errno != EINTR) { + BD_DEBUG(DBG_FILE, "read() failed (%p)\n", (void*)file); + break; + } + result = 0; + } else if (result == 0) { + // hit EOF. + break; + } + } + return (int64_t)got; } -static int64_t file_write_linux(BD_FILE_H *file, const uint8_t *buf, int64_t size) +static int64_t _file_write(BD_FILE_H *file, const uint8_t *buf, int64_t size) { - if (size > 0 && size < BD_MAX_SSIZE) { - return (int64_t)fwrite(buf, 1, (size_t)size, (FILE *)file->internal); + ssize_t written, result; + + if (size <= 0 || size >= BD_MAX_SSIZE) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); + return 0; } - BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); - return 0; + for (written = 0; written < (ssize_t)size; written += result) { + result = write((int)(intptr_t)file->internal, buf + written, size - written); + if (result < 0) { + if (errno != EINTR) { + BD_DEBUG(DBG_FILE, "write() failed (%p)\n", (void*)file); + break; + } + result = 0; + } + } + return (int64_t)written; } -static BD_FILE_H *file_open_linux(const char* filename, const char *mode) +static BD_FILE_H *_file_open(const char* filename, const char *cmode) { - FILE *fp = NULL; - BD_FILE_H *file = malloc(sizeof(BD_FILE_H)); + BD_FILE_H *file; + int fd = -1; + int flags = 0; + int mode = 0; - BD_DEBUG(DBG_FILE, "Opening LINUX file %s... (%p)\n", filename, (void*)file); - file->close = file_close_linux; - file->seek = file_seek_linux; - file->read = file_read_linux; - file->write = file_write_linux; - file->tell = file_tell_linux; - file->eof = file_eof_linux; + if (strchr(cmode, 'w')) { + flags = O_WRONLY | O_CREAT | O_TRUNC; + mode = S_IRUSR | S_IWUSR; + } else { + flags = O_RDONLY; + } -#ifdef _WIN32 - wchar_t wfilename[MAX_PATH], wmode[8]; - if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wfilename, MAX_PATH) && - MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mode, -1, wmode, 8) && - (fp = _wfopen(wfilename, wmode))) { -#else - if ((fp = fopen(filename, mode))) { +#ifdef O_CLOEXEC + flags |= O_CLOEXEC; +#endif +#ifdef O_BINARY + flags |= O_BINARY; #endif - file->internal = fp; - return file; + if ((fd = open(filename, flags, mode)) < 0) { + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } + + file = calloc(1, sizeof(BD_FILE_H)); + if (!file) { + close(fd); + BD_DEBUG(DBG_FILE, "Error opening file %s (out of memory)\n", filename); + return NULL; } - BD_DEBUG(DBG_FILE, "Error opening file! (%p)\n", (void*)file); + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = _file_write; + file->tell = _file_tell; + //file->eof = file_eof_linux; - X_FREE(file); + file->internal = (void*)(intptr_t)fd; - return NULL; + BD_DEBUG(DBG_FILE, "Opened POSIX file %s (%p)\n", filename, (void*)file); + return file; } -BD_FILE_H* (*file_open)(const char* filename, const char *mode) = file_open_linux; +BD_FILE_H* (*file_open)(const char* filename, const char *mode) = _file_open; BD_FILE_OPEN file_open_default(void) { - return file_open_linux; + return _file_open; } -/* - * - */ - -int64_t file_size(BD_FILE_H *fp) +int file_unlink(const char *file) { - int64_t pos = file_tell(fp); - int64_t res1 = file_seek(fp, 0, SEEK_END); - int64_t length = file_tell(fp); - int64_t res2 = file_seek(fp, pos, SEEK_SET); + return remove(file); +} - if (res1 < 0 || res2 < 0 || pos < 0 || length < 0) { - return -1; - } +int file_path_exists(const char *path) +{ + struct stat s; + return stat(path, &s); +} - return length; +int file_mkdir(const char *dir) +{ + return mkdir(dir, S_IRWXU); } diff -Nru libbluray-0.5.0/src/file/filesystem.c libbluray-0.8.1/src/file/filesystem.c --- libbluray-0.5.0/src/file/filesystem.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/filesystem.c 2015-05-15 09:25:06.000000000 +0000 @@ -26,14 +26,14 @@ BD_FILE_OPEN bd_register_file(BD_FILE_OPEN p) { - BD_FILE_OPEN old = file_open; - file_open = p; - return old; + BD_FILE_OPEN old = file_open; + file_open = p; + return old; } BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p) { - BD_DIR_OPEN old = dir_open; - dir_open = p; - return old; + BD_DIR_OPEN old = dir_open; + dir_open = p; + return old; } diff -Nru libbluray-0.5.0/src/file/filesystem.h libbluray-0.8.1/src/file/filesystem.h --- libbluray-0.5.0/src/file/filesystem.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/filesystem.h 2015-05-15 09:25:06.000000000 +0000 @@ -35,12 +35,12 @@ struct bd_file_s { void* internal; - void (*close)(BD_FILE_H *file); - int64_t (*seek)(BD_FILE_H *file, int64_t offset, int32_t origin); - int64_t (*tell)(BD_FILE_H *file); - int (*eof)(BD_FILE_H *file); - int64_t (*read)(BD_FILE_H *file, uint8_t *buf, int64_t size); - int64_t (*write)(BD_FILE_H *file, const uint8_t *buf, int64_t size); + void (*close) (BD_FILE_H *file); + int64_t (*seek) (BD_FILE_H *file, int64_t offset, int32_t origin); + int64_t (*tell) (BD_FILE_H *file); + int (*eof) (BD_FILE_H *file); + int64_t (*read) (BD_FILE_H *file, uint8_t *buf, int64_t size); + int64_t (*write) (BD_FILE_H *file, const uint8_t *buf, int64_t size); }; /* @@ -83,7 +83,7 @@ BD_DIR_OPEN bd_register_dir(BD_DIR_OPEN p); #ifdef __cplusplus -}; +} #endif #endif /* BD_FILESYSTEM_H_ */ diff -Nru libbluray-0.5.0/src/file/file_win32.c libbluray-0.8.1/src/file/file_win32.c --- libbluray-0.5.0/src/file/file_win32.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/file/file_win32.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,170 @@ +/* + * This file is part of libbluray + * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2009-2010 John Stebbins + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(__MINGW32__) +/* ftello64() and fseeko64() prototypes from stdio.h */ +# undef __STRICT_ANSI__ +#endif + +#include "file.h" +#include "util/macro.h" +#include "util/logging.h" + +#include +#include +#include + +#include + +static void _file_close(BD_FILE_H *file) +{ + if (file) { + fclose((FILE *)file->internal); + + BD_DEBUG(DBG_FILE, "Closed WIN32 file (%p)\n", (void*)file); + + X_FREE(file); + } +} + +static int64_t _file_seek(BD_FILE_H *file, int64_t offset, int32_t origin) +{ +#if defined(__MINGW32__) + return fseeko64((FILE *)file->internal, offset, origin); +#else + return _fseeki64((FILE *)file->internal, offset, origin); +#endif +} + +static int64_t _file_tell(BD_FILE_H *file) +{ +#if defined(__MINGW32__) + return ftello64((FILE *)file->internal); +#else + return _ftelli64((FILE *)file->internal); +#endif +} + +#if 0 +static int _file_eof(BD_FILE_H *file) +{ + return feof((FILE *)file->internal); +} +#endif + +static int64_t _file_read(BD_FILE_H *file, uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fread(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static int64_t _file_write(BD_FILE_H *file, const uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fwrite(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static BD_FILE_H *_file_open(const char* filename, const char *mode) +{ + BD_FILE_H *file; + FILE *fp; + wchar_t wfilename[MAX_PATH], wmode[8]; + + if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wfilename, MAX_PATH) || + !MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mode, -1, wmode, 8)) { + + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } + + fp = _wfopen(wfilename, wmode); + if (!fp) { + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } + + file = calloc(1, sizeof(BD_FILE_H)); + if (!file) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error opening file %s (out of memory)\n", filename); + fclose(fp); + return NULL; + } + + file->internal = fp; + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = _file_write; + file->tell = _file_tell; + //file->eof = _file_eof; + + BD_DEBUG(DBG_FILE, "Opened WIN32 file %s (%p)\n", filename, (void*)file); + return file; +} + +BD_FILE_H* (*file_open)(const char* filename, const char *mode) = _file_open; + +BD_FILE_OPEN file_open_default(void) +{ + return _file_open; +} + +int file_unlink(const char *file) +{ + wchar_t wfile[MAX_PATH]; + + MultiByteToWideChar(CP_UTF8, 0, file, -1, wfile, MAX_PATH); + return _wremove(wfile); +} + +int file_path_exists(const char *path) +{ + wchar_t wpath[MAX_PATH]; + + MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_PATH); + + DWORD dwAttrib = GetFileAttributesW(wpath); + if (dwAttrib != INVALID_FILE_ATTRIBUTES) { + return 0; + } + return -1; +} + +int file_mkdir(const char *dir) +{ + wchar_t wdir[MAX_PATH]; + + MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); + if (!CreateDirectoryW(wdir, NULL)) + return -1; + return 0; +} diff -Nru libbluray-0.5.0/src/file/libaacs.c libbluray-0.8.1/src/file/libaacs.c --- libbluray-0.5.0/src/file/libaacs.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/libaacs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,298 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2013 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 - * . - */ - -#include "libaacs.h" - -#include "dl.h" -#include "file.h" -#include "util/logging.h" -#include "util/macro.h" -#include "util/strutl.h" - -#include - - -struct bd_aacs { - void *h_libaacs; /* library handle from dlopen */ - void *aacs; /* aacs handle from aacs_open() */ - - const uint8_t *disc_id; - uint32_t mkbv; - - /* function pointers */ - fptr_int decrypt_unit; - - fptr_p_void get_vid; - fptr_p_void get_pmsn; - fptr_p_void get_device_binding_id; - fptr_p_void get_device_nonce; - fptr_p_void get_media_key; -}; - - -static void _libaacs_close(BD_AACS *p) -{ - if (p->aacs) { - DL_CALL(p->h_libaacs, aacs_close, p->aacs); - p->aacs = NULL; - } -} - -void libaacs_unload(BD_AACS **p) -{ - if (p && *p) { - _libaacs_close(*p); - - if ((*p)->h_libaacs) { - dl_dlclose((*p)->h_libaacs); - } - - X_FREE(*p); - } -} - -int libaacs_required(const char *device_path) -{ - BD_FILE_H *fd; - char *tmp; - - tmp = str_printf("%s/AACS/Unit_Key_RO.inf", device_path); - fd = file_open(tmp, "rb"); - X_FREE(tmp); - - if (fd) { - file_close(fd); - - BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf found. Disc seems to be AACS protected.\n"); - return 1; - } - - BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf not found. No AACS protection.\n"); - return 0; -} - -static void *_open_libaacs(void) -{ - const char * const libaacs[] = { - getenv("LIBAACS_PATH"), - "libaacs", - "libmmbd", - }; - unsigned ii; - - for (ii = 0; ii < sizeof(libaacs) / sizeof(libaacs[0]); ii++) { - if (libaacs[ii]) { - void *handle = dl_dlopen(libaacs[ii], "0"); - if (handle) { - BD_DEBUG(DBG_BLURAY, "Using %s for AACS\n", libaacs[ii]); - return handle; - } - } - } - - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No usable AACS libraries found!\n"); - return NULL; -} - -BD_AACS *libaacs_load(void) -{ - BD_AACS *p = calloc(1, sizeof(BD_AACS)); - - p->h_libaacs = _open_libaacs(); - if (!p->h_libaacs) { - X_FREE(p); - return NULL; - } - - BD_DEBUG(DBG_BLURAY, "Loading aacs library (%p)\n", p->h_libaacs); - - *(void **)(&p->decrypt_unit) = dl_dlsym(p->h_libaacs, "aacs_decrypt_unit"); - *(void **)(&p->get_vid) = dl_dlsym(p->h_libaacs, "aacs_get_vid"); - *(void **)(&p->get_pmsn) = dl_dlsym(p->h_libaacs, "aacs_get_pmsn"); - *(void **)(&p->get_device_binding_id) = dl_dlsym(p->h_libaacs, "aacs_get_device_binding_id"); - *(void **)(&p->get_device_nonce) = dl_dlsym(p->h_libaacs, "aacs_get_device_nonce"); - *(void **)(&p->get_media_key) = dl_dlsym(p->h_libaacs, "aacs_get_mk"); - - if (!p->decrypt_unit) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libaacs dlsym failed! (%p)\n", p->h_libaacs); - libaacs_unload(&p); - return NULL; - } - - BD_DEBUG(DBG_BLURAY, "Loaded libaacs (%p)\n", p->h_libaacs); - - if (file_open != file_open_default()) { - BD_DEBUG(DBG_BLURAY, "Registering libaacs filesystem handler %p (%p)\n", (void *)(intptr_t)file_open, p->h_libaacs); - DL_CALL(p->h_libaacs, aacs_register_file, file_open); - } - - return p; -} - -int libaacs_open(BD_AACS *p, const char *device_path, const char *keyfile_path) -{ - int error_code = 0; - - fptr_p_void open; - fptr_p_void open2; - fptr_int aacs_get_mkb_version; - fptr_p_void aacs_get_disc_id; - - _libaacs_close(p); - - *(void **)(&open) = dl_dlsym(p->h_libaacs, "aacs_open"); - *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2"); - *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version"); - *(void **)(&aacs_get_disc_id) = dl_dlsym(p->h_libaacs, "aacs_get_disc_id"); - - if (open2) { - p->aacs = open2(device_path, keyfile_path, &error_code); - } else if (open) { - BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n"); - p->aacs = open(device_path, keyfile_path); - } else { - BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n"); - } - - if (p->aacs) { - if (aacs_get_mkb_version) { - p->mkbv = aacs_get_mkb_version(p->aacs); - } - if (aacs_get_disc_id) { - p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs); - } - return error_code; - } - - return error_code ? error_code : 1; -} - -/* - * - */ - -void libaacs_select_title(BD_AACS *p, uint32_t title) -{ - if (p && p->aacs) { - DL_CALL(p->h_libaacs, aacs_select_title, p->aacs, title); - } -} - -int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf) -{ - if (p && p->aacs) { - if (!p->decrypt_unit(p->aacs, buf)) { - BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable decrypt unit (AACS)!\n"); - - return -1; - } // decrypt - } // aacs - - return 0; -} - -/* - * - */ - -static const uint8_t *_get_vid(BD_AACS *p) -{ - if (!p->get_vid) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_vid() dlsym failed!\n"); - return NULL; - } - - return (const uint8_t*)p->get_vid(p->aacs); -} - -static const uint8_t *_get_pmsn(BD_AACS *p) -{ - if (!p->get_pmsn) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_pmsn() dlsym failed!\n"); - return NULL; - } - - return (const uint8_t*)p->get_pmsn(p->aacs); -} - -static const uint8_t *_get_device_binding_id(BD_AACS *p) -{ - if (!p->get_device_binding_id) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_device_binding_id() dlsym failed!\n"); - return NULL; - } - - return (const uint8_t*)p->get_device_binding_id(p->aacs); -} - -static const uint8_t *_get_device_nonce(BD_AACS *p) -{ - if (!p->get_device_nonce) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_device_nonce() dlsym failed!\n"); - return NULL; - } - - return (const uint8_t*)p->get_device_nonce(p->aacs); -} - -static const uint8_t *_get_media_key(BD_AACS *p) -{ - if (!p->get_media_key) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_mk() dlsym failed!\n"); - return NULL; - } - - return (const uint8_t*)p->get_media_key(p->aacs); -} - -uint32_t libaacs_get_mkbv(BD_AACS *p) -{ - return p ? p->mkbv : 0; -} - -BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type) -{ - if (!p || !p->aacs) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "get_aacs_data(): libaacs not initialized!\n"); - return NULL; - } - - switch (type) { - case BD_AACS_DISC_ID: - return p ? p->disc_id : NULL; - - case BD_AACS_MEDIA_VID: - return _get_vid(p); - - case BD_AACS_MEDIA_PMSN: - return _get_pmsn(p); - - case BD_AACS_DEVICE_BINDING_ID: - return _get_device_binding_id(p); - - case BD_AACS_DEVICE_NONCE: - return _get_device_nonce(p); - - case BD_AACS_MEDIA_KEY: - return _get_media_key(p); - } - - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "get_aacs_data(): unknown query %d\n", type); - return NULL; -} diff -Nru libbluray-0.5.0/src/file/libaacs.h libbluray-0.8.1/src/file/libaacs.h --- libbluray-0.5.0/src/file/libaacs.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/libaacs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2013 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 - * . - */ - -#ifndef _BD_LIBAACS_H_ -#define _BD_LIBAACS_H_ - -#include - -#include - - -typedef struct bd_aacs BD_AACS; - -BD_PRIVATE int libaacs_required(const char *device_path); -BD_PRIVATE BD_AACS *libaacs_load(void); -BD_PRIVATE int libaacs_open(BD_AACS *p, const char *device_path, const char *keyfile_path); -BD_PRIVATE void libaacs_unload(BD_AACS **p); - -BD_PRIVATE void libaacs_select_title(BD_AACS *p, uint32_t title); -BD_PRIVATE int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf); - -BD_PRIVATE uint32_t libaacs_get_mkbv(BD_AACS *p); - -#define BD_AACS_DISC_ID 1 -#define BD_AACS_MEDIA_VID 2 -#define BD_AACS_MEDIA_PMSN 3 -#define BD_AACS_DEVICE_BINDING_ID 4 -#define BD_AACS_DEVICE_NONCE 5 -#define BD_AACS_MEDIA_KEY 6 - -BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type); - - -#endif /* _BD_LIBAACS_H_ */ diff -Nru libbluray-0.5.0/src/file/libbdplus.c libbluray-0.8.1/src/file/libbdplus.c --- libbluray-0.5.0/src/file/libbdplus.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/libbdplus.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2013 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 - * . - */ - -#include "libbdplus.h" - -#include "dl.h" -#include "file.h" -#include "util/logging.h" -#include "util/macro.h" -#include "util/strutl.h" - -#include - - -struct bd_bdplus { - void *h_libbdplus; /* library handle from dlopen */ - - void *bdplus; /* bdplus handle from bdplus_open() */ - - /* functions */ - fptr_int32 event; - fptr_p_void m2ts; - fptr_int32 m2ts_close; - fptr_int32 seek; - fptr_int32 fixup; - - /* old API */ - fptr_p_void title; -}; - - -static void _libbdplus_close(BD_BDPLUS *p) -{ - if (p->bdplus) { - DL_CALL(p->h_libbdplus, bdplus_free, p->bdplus); - p->bdplus = NULL; - } -} - -void libbdplus_unload(BD_BDPLUS **p) -{ - if (p && *p) { - _libbdplus_close(*p); - - if ((*p)->h_libbdplus) { - dl_dlclose((*p)->h_libbdplus); - } - - X_FREE(*p); - } -} - -int libbdplus_required(const char *device_path) -{ - BD_FILE_H *fd; - char *tmp; - - tmp = str_printf("%s/BDSVM/00000.svm", device_path); - fd = file_open(tmp, "rb"); - X_FREE(tmp); - - if (fd) { - file_close(fd); - - BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm found. Disc seems to be BD+ protected.\n"); - return 1; - } - - BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm not found. No BD+ protection.\n"); - return 0; -} - -static void *_libbdplus_open(void) -{ - const char * const libbdplus[] = { - getenv("LIBBDPLUS_PATH"), - "libbdplus", - "libmmbd", - }; - unsigned ii; - - for (ii = 0; ii < sizeof(libbdplus) / sizeof(libbdplus[0]); ii++) { - if (libbdplus[ii]) { - void *handle = dl_dlopen(libbdplus[ii], "0"); - if (handle) { - BD_DEBUG(DBG_BLURAY, "Using %s for BD+\n", libbdplus[ii]); - return handle; - } - } - } - - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No usable BD+ libraries found!\n"); - return NULL; -} - -BD_BDPLUS *libbdplus_load(void) -{ - BD_BDPLUS *p = calloc(1, sizeof(BD_BDPLUS)); - - BD_DEBUG(DBG_BDPLUS, "attempting to load libbdplus\n"); - - p->h_libbdplus = _libbdplus_open(); - if (!p->h_libbdplus) { - X_FREE(p); - return NULL; - } - - BD_DEBUG(DBG_BLURAY, "Loading libbdplus (%p)\n", p->h_libbdplus); - - *(void **)(&p->event) = dl_dlsym(p->h_libbdplus, "bdplus_event"); - *(void **)(&p->m2ts) = dl_dlsym(p->h_libbdplus, "bdplus_m2ts"); - *(void **)(&p->seek) = dl_dlsym(p->h_libbdplus, "bdplus_seek"); - *(void **)(&p->fixup) = dl_dlsym(p->h_libbdplus, "bdplus_fixup"); - *(void **)(&p->m2ts_close) = dl_dlsym(p->h_libbdplus, "bdplus_m2ts_close"); - if (!p->m2ts) { - /* Old API */ - *(void **)(&p->title) = dl_dlsym(p->h_libbdplus, "bdplus_set_title"); - if (!p->title) { - *(void **)(&p->title) = dl_dlsym(p->h_libbdplus, "bdplus_set_m2ts"); - } - } - - if (!p->seek || !p->fixup || !((p->m2ts && p->m2ts_close) || p->title)) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libbdplus dlsym failed! (%p)\n", p->h_libbdplus); - libbdplus_unload(&p); - return NULL; - } - - BD_DEBUG(DBG_BLURAY, "Loaded libbdplus (%p)\n", p->h_libbdplus); - - if (file_open != file_open_default()) { - BD_DEBUG(DBG_BLURAY, "Registering libbdplus filesystem handler %p (%p)\n", (void *)(intptr_t)file_open, p->h_libbdplus); - DL_CALL(p->h_libbdplus, bdplus_register_file, file_open); - } - - return p; -} - -int libbdplus_init(BD_BDPLUS *p, const char *device_path, const uint8_t *vid, const uint8_t *mk) -{ - fptr_p_void bdplus_init; - - _libbdplus_close(p); - - *(void **)(&bdplus_init) = dl_dlsym(p->h_libbdplus, "bdplus_init"); - - if (!bdplus_init) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libbdplus dlsym(bdplus_init) failed! (%p)\n", p->h_libbdplus); - return -1; - } - - p->bdplus = bdplus_init(device_path, NULL, vid); - if (!p->bdplus) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bdplus_init() failed! (%p)\n", p->h_libbdplus); - return -1; - } - - DL_CALL(p->h_libbdplus, bdplus_set_mk, p->bdplus, mk); - - return 0; -} - -static uint32_t _bdplus_get(BD_BDPLUS *p, const char *func) -{ - if (p && p->bdplus) { - fptr_int32 fp; - *(void **)(&fp) = dl_dlsym(p->h_libbdplus, func); - if (fp) { - return fp(p->bdplus); - } - } - return 0; -} - -int libbdplus_get_gen(BD_BDPLUS *p) -{ - return _bdplus_get(p, "bdplus_get_code_gen"); -} - -int libbdplus_get_date(BD_BDPLUS *p) -{ - return _bdplus_get(p, "bdplus_get_code_date"); -} - -void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2) -{ - if (p && p->bdplus && p->event) { - p->event(p->bdplus, event, param1, param2); - } -} - -void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem) -{ - if (p && p->bdplus) { - DL_CALL(p->h_libbdplus, bdplus_mmap, p->bdplus, region_id, mem); - } -} - -void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write) -{ - if (p && p->bdplus) { - DL_CALL(p->h_libbdplus, bdplus_psr, p->bdplus, regs, read, write); - } -} - -void libbdplus_start(BD_BDPLUS *p) -{ - if (p && p->bdplus) { - DL_CALL(p->h_libbdplus, bdplus_start, p->bdplus); - } -} - -/* - * stream layer - */ - -struct bd_bdplus_st { - BD_BDPLUS *lib; - void *st; -}; - -BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos) -{ - if (p && p->bdplus) { - - if (!p->m2ts) { - /* use old API */ - BD_BDPLUS_ST *ret = calloc(1, sizeof(BD_BDPLUS_ST)); - ret->lib = p; - ret->st = NULL; - p->title(p->bdplus, clip_id); - p->seek(p->bdplus, pos); - return ret; - } - - void *st = p->m2ts(p->bdplus, clip_id); - - if (!st) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ failed for clip %05d.m2ts\n", clip_id); - - } else if (p->seek(st, pos) < 0) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ seek failed for clip %05d.m2ts\n", clip_id); - p->m2ts_close(st); - } else { - BD_BDPLUS_ST *ret = calloc(1, sizeof(BD_BDPLUS_ST)); - ret->lib = p; - ret->st = st; - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ active for clip %05d.m2ts\n", clip_id); - return ret; - } - } - - return NULL; -} - -int libbdplus_m2ts_close(BD_BDPLUS_ST **p) -{ - int result = -1; - if (p && *p) { - if ((*p)->lib && (*p)->st) { - result = (*p)->lib->m2ts_close((*p)->st); - } - X_FREE(*p); - } - - return result; -} - -int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos) -{ - if (p) { - if (p->st) { - return p->lib->seek(p->st, pos); - } else { - /* use old API */ - return p->lib->seek(p->lib->bdplus, pos); - } - } - - return -1; -} - -int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len) -{ - if (p && !p->lib->m2ts) { - /* use old API */ - return p->lib->fixup(p->lib->bdplus, len, buf); - } - - if (p && p->st) { - int32_t numFixes; - numFixes = p->lib->fixup(p->st, len, buf); -#if 1 - if (numFixes) { - BD_DEBUG(DBG_BDPLUS, "BD+ did %d fixups\n", numFixes); - } -#endif - return numFixes; - } - - return -1; -} diff -Nru libbluray-0.5.0/src/file/libbdplus.h libbluray-0.8.1/src/file/libbdplus.h --- libbluray-0.5.0/src/file/libbdplus.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/file/libbdplus.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2013 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 - * . - */ - -#ifndef _BD_LIBBDPLUS_H_ -#define _BD_LIBBDPLUS_H_ - -#include - -#include - - -typedef struct bd_bdplus BD_BDPLUS; - -BD_PRIVATE int libbdplus_required(const char *device_path); -BD_PRIVATE BD_BDPLUS *libbdplus_load(void); -BD_PRIVATE int libbdplus_init(BD_BDPLUS *p, const char *device_path, const uint8_t *vid, const uint8_t *mk); -BD_PRIVATE void libbdplus_unload(BD_BDPLUS **p); - -BD_PRIVATE int libbdplus_get_gen(BD_BDPLUS *p); -BD_PRIVATE int libbdplus_get_date(BD_BDPLUS *p); - -BD_PRIVATE void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem); -BD_PRIVATE void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write); -BD_PRIVATE void libbdplus_start(BD_BDPLUS *p); -BD_PRIVATE void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2); - -/* - * stream layer - */ - -typedef struct bd_bdplus_st BD_BDPLUS_ST; - -BD_PRIVATE BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos); -BD_PRIVATE int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos); -BD_PRIVATE int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len); -BD_PRIVATE int libbdplus_m2ts_close(BD_BDPLUS_ST **p); - - -#endif /* _BD_BDPLUS_H_ */ diff -Nru libbluray-0.5.0/src/file/mount.c libbluray-0.8.1/src/file/mount.c --- libbluray-0.5.0/src/file/mount.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/file/mount.c 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mount.h" + +#include "util/strutl.h" + +#ifdef HAVE_MNTENT_H +#include +#include +#include +#endif + +char *mount_get_mountpoint(const char *device_path) +{ +#ifdef HAVE_MNTENT_H + struct stat st; + if (stat (device_path, &st) ) { + return str_dup(device_path); + } + + /* If it's a directory, all is good */ + if (S_ISDIR(st.st_mode)) { + return str_dup(device_path); + } + + FILE *f = setmntent ("/proc/self/mounts", "r"); + if (f) { + struct mntent* m; +#ifdef HAVE_GETMNTENT_R + struct mntent mbuf; + char buf [8192]; + while ((m = getmntent_r (f, &mbuf, buf, sizeof(buf))) != NULL) { +#else + while ((m = getmntent (f)) != NULL) { +#endif + if (!strcmp (m->mnt_fsname, device_path)) { + endmntent (f); + return str_dup (m->mnt_dir); + } + } + endmntent (f); + } +#endif /* HAVE_MNTENT_H */ + + return str_dup(device_path); +} diff -Nru libbluray-0.5.0/src/file/mount_darwin.c libbluray-0.8.1/src/file/mount_darwin.c --- libbluray-0.5.0/src/file/mount_darwin.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/file/mount_darwin.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mount.h" + +#include "util/strutl.h" + +#include + +#define _DARWIN_C_SOURCE +#include +#include +#include +#include + +char *mount_get_mountpoint(const char *device_path) +{ + struct stat st; + if (stat (device_path, &st) ) { + return str_dup(device_path); + } + + /* If it's a directory, all is good */ + if (S_ISDIR(st.st_mode)) { + return str_dup(device_path); + } + + struct statfs mbuf[128]; + int fs_count; + + if ( (fs_count = getfsstat (NULL, 0, MNT_NOWAIT)) != -1 ) { + + getfsstat (mbuf, fs_count * sizeof(mbuf[0]), MNT_NOWAIT); + + for ( int i = 0; i < fs_count; ++i) { + if (!strcmp (mbuf[i].f_mntfromname, device_path)) { + return str_dup (mbuf[i].f_mntonname); + } + } + } + + return str_dup (device_path); +} diff -Nru libbluray-0.5.0/src/file/mount.h libbluray-0.8.1/src/file/mount.h --- libbluray-0.5.0/src/file/mount.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/file/mount.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#ifndef BD_MOUNT_H_ +#define BD_MOUNT_H_ + +#include "util/attributes.h" + +/* + * Resolve device node (/dev/sr0) to mount point + * Implemented on Linux and MacOSX + */ +BD_PRIVATE char *mount_get_mountpoint(const char *device_path); + +#endif /* BD_MOUNT_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj.c libbluray-0.8.1/src/libbluray/bdj/bdj.c --- libbluray-0.5.0/src/libbluray/bdj/bdj.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdj.c 2015-05-15 09:25:06.000000000 +0000 @@ -24,18 +24,14 @@ #include "bdj.h" -#include "bdj_private.h" -#include "bdjo_parser.h" -#include "bdj_util.h" -#include "common.h" -#include "libbluray/register.h" +#include "native/register_native.h" + #include "file/dirs.h" #include "file/dl.h" #include "util/strutl.h" #include "util/macro.h" #include "util/logging.h" -#include "libbluray/bdnav/bdid_parse.h" -#include "libbluray/bdj/native/register_native.h" + #include #include @@ -45,14 +41,29 @@ #ifdef _WIN32 #include #include +#define DIR_SEP "\\" +#else +#define DIR_SEP "/" +#endif + +#ifdef HAVE_BDJ_J2ME +#define BDJ_JARFILE "libbluray-j2me-" VERSION ".jar" +#else +#define BDJ_JARFILE "libbluray-j2se-" VERSION ".jar" #endif +struct bdjava_s { + void *h_libjvm; + JavaVM *jvm; +}; + typedef jint (JNICALL * fptr_JNI_CreateJavaVM) (JavaVM **pvm, void **penv,void *args); +typedef jint (JNICALL * fptr_JNI_GetCreatedJavaVMs) (JavaVM **vmBuf, jsize bufLen, jsize *nVMs); #if defined(_WIN32) && !defined(HAVE_BDJ_J2ME) static void *_load_jvm_win32(const char **p_java_home) { - static const char *java_home = NULL; + static char java_home[256] = ""; wchar_t buf_loc[4096] = L"SOFTWARE\\JavaSoft\\Java Runtime Environment\\"; wchar_t buf_vers[128]; @@ -94,9 +105,9 @@ if (r == ERROR_SUCCESS) { /* do not fail even if not found */ - WideCharToMultiByte(CP_UTF8, 0, buf_loc, -1, strbuf, sizeof(strbuf), NULL, NULL); - *p_java_home = java_home = str_dup(strbuf); - BD_DEBUG(DBG_BDJ, "JavaHome: %s\n", strbuf); + WideCharToMultiByte(CP_UTF8, 0, buf_loc, -1, java_home, sizeof(java_home), NULL, NULL); + *p_java_home = java_home; + BD_DEBUG(DBG_BDJ, "JavaHome: %s\n", java_home); } dSize = sizeof(buf_loc); @@ -125,12 +136,12 @@ { if (java_home) { char *path = str_printf("%s/%s/%s", java_home, jvm_dir, jvm_lib); - BD_DEBUG(DBG_BDJ|DBG_CRIT, "Opening %s ...\n", path); + BD_DEBUG(DBG_BDJ, "Opening %s ...\n", path); void *h = dl_dlopen(path, NULL); X_FREE(path); return h; } else { - BD_DEBUG(DBG_BDJ|DBG_CRIT, "Opening %s ...\n", jvm_lib); + BD_DEBUG(DBG_BDJ, "Opening %s ...\n", jvm_lib); return dl_dlopen(jvm_lib, NULL); } } @@ -153,7 +164,11 @@ static const char jvm_dir[] = "jre/bin/server"; static const char jvm_lib[] = "jvm"; # else - static const char *jvm_path[] = {NULL, JDK_HOME, "/usr/lib/jvm/default-java/"}; + static const char *jvm_path[] = {NULL, JDK_HOME, + "/usr/lib/jvm/default-java", + "/usr/lib/jvm/java-6-openjdk", + "/usr/lib/jvm/java-7-openjdk", + "/etc/java-config-2/current-system-vm"}; static const char jvm_dir[] = "jre/lib/" JAVA_ARCH "/server"; static const char jvm_lib[] = "libjvm"; # endif @@ -176,7 +191,7 @@ } #endif - BD_DEBUG(DBG_BDJ | DBG_CRIT, "JAVA_HOME not set, trying default locations\n"); + BD_DEBUG(DBG_BDJ, "JAVA_HOME not set, trying default locations\n"); /* try our pre-defined locations */ for (path_ind = 0; !handle && path_ind < sizeof(jvm_path) / sizeof(jvm_path[0]); path_ind++) { @@ -191,29 +206,58 @@ return handle; } -static const char *_find_libbluray_jar(void) +static int _can_read_file(const char *fn) +{ + FILE *fp = fopen(fn, "rb"); + if (fp) { + char b; + int result = (int)fread(&b, 1, 1, fp); + fclose(fp); + if (result == 1) { + return 1; + } + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", fn); + } + return 0; +} + +static const char *_find_libbluray_jar(BDJ_STORAGE *storage) { // pre-defined search paths for libbluray.jar static const char * const jar_paths[] = { #ifdef _WIN32 "" BDJ_JARFILE, #else - "/usr/lib/libbluray/" BDJ_JARFILE, - "/usr/share/libbluray/" BDJ_JARFILE, + "/usr/share/java/" BDJ_JARFILE, + "/usr/share/libbluray/lib/" BDJ_JARFILE, #endif }; - static const char *classpath = NULL; - - FILE *fp; unsigned i; - // check if overriding the classpath - if (!classpath) { - classpath = getenv("LIBBLURAY_CP"); + if (storage->classpath) { + return storage->classpath; } + + // check if overriding the classpath + const char *classpath = getenv("LIBBLURAY_CP"); if (classpath) { - return classpath; + size_t cp_len = strlen(classpath); + + // directory or file ? + if (cp_len > 0 && (classpath[cp_len - 1] == '/' || classpath[cp_len - 1] == '\\')) { + storage->classpath = str_printf("%s%s", classpath, BDJ_JARFILE); + } else { + storage->classpath = str_dup(classpath); + } + + if (_can_read_file(storage->classpath)) { + return storage->classpath; + } + + X_FREE(storage->classpath); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "invalid LIBBLURAY_CP %s\n", classpath); + return NULL; } BD_DEBUG(DBG_BDJ, "LIBBLURAY_CP not set, searching for "BDJ_JARFILE" ...\n"); @@ -223,10 +267,8 @@ if (lib_path) { char *cp = str_printf("%s" BDJ_JARFILE, lib_path); BD_DEBUG(DBG_BDJ, "Checking %s ...\n", cp); - fp = fopen(cp, "rb"); - if (fp) { - fclose(fp); - classpath = cp; + if (_can_read_file(cp)) { + storage->classpath = cp; BD_DEBUG(DBG_BDJ, "using %s\n", cp); return cp; } @@ -236,69 +278,96 @@ // check pre-defined directories for (i = 0; i < sizeof(jar_paths) / sizeof(jar_paths[0]); i++) { BD_DEBUG(DBG_BDJ, "Checking %s ...\n", jar_paths[i]); - fp = fopen(jar_paths[i], "rb"); - if (fp) { - fclose(fp); - classpath = jar_paths[i]; - BD_DEBUG(DBG_BDJ, "using %s\n", classpath); - return classpath; + 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; } } - classpath = BDJ_CLASSPATH; + // try from current directory + if (_can_read_file(BDJ_JARFILE)) { + storage->classpath = str_dup(BDJ_JARFILE); + BD_DEBUG(DBG_BDJ, "using %s\n", storage->classpath); + return storage->classpath; + } + BD_DEBUG(DBG_BDJ | DBG_CRIT, BDJ_JARFILE" not found.\n"); - return classpath; + return NULL; } -static const char *_bdj_persistent_root(void) +static const char *_bdj_persistent_root(BDJ_STORAGE *storage) { - static const char *root = NULL; + const char *root; + char *data_home; - if (root) { - return root; - } + if (!storage->persistent_root) { - root = getenv("LIBBLURAY_PERSISTENT_ROOT"); - if (root) { - return root; - } + root = getenv("LIBBLURAY_PERSISTENT_ROOT"); + if (root) { + return root; + } - root = file_get_data_home(); - if (!root) { - root = ""; - } - root = str_printf("%s/bluray/dvb.persistent.root/", root); + data_home = file_get_data_home(); + storage->persistent_root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "dvb.persistent.root" DIR_SEP, data_home ? data_home : ""); + X_FREE(data_home); - BD_DEBUG(DBG_BDJ, "LIBBLURAY_PERSISTENT_ROOT not set, using %s\n", root); + BD_DEBUG(DBG_BDJ, "LIBBLURAY_PERSISTENT_ROOT not set, using %s\n", storage->persistent_root); + } - return root; + return storage->persistent_root; } -static const char *_bdj_buda_root(void) +static const char *_bdj_buda_root(BDJ_STORAGE *storage) { - static const char *root = NULL; + const char *root; + char *cache_home; - if (root) { - return root; - } + if (!storage->cache_root) { + + root = getenv("LIBBLURAY_CACHE_ROOT"); + if (root) { + return root; + } + + cache_home = file_get_cache_home(); + storage->cache_root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "bluray.bindingunit.root" DIR_SEP, cache_home ? cache_home : ""); + X_FREE(cache_home); - root = getenv("LIBBLURAY_CACHE_ROOT"); - if (root) { - return root; + BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", storage->cache_root); } - root = file_get_cache_home(); - if (!root) { - root = ""; + return storage->cache_root; +} + +static int _get_method(JNIEnv *env, jclass *cls, jmethodID *method_id, + const char *class_name, const char *method_name, const char *method_sig) +{ + *method_id = NULL; + *cls = (*env)->FindClass(env, class_name); + if (!*cls) { + (*env)->ExceptionDescribe(env); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); + (*env)->ExceptionClear(env); + return 0; } - root = str_printf("%s/bluray/bluray.bindingunit.root/", root); - BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", root); + *method_id = (*env)->GetStaticMethodID(env, *cls, method_name, method_sig); + if (!*method_id) { + (*env)->ExceptionDescribe(env); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s method %s %s\n", + class_name, method_name, method_sig); + (*env)->DeleteLocalRef(env, *cls); + *cls = NULL; + (*env)->ExceptionClear(env); + return 0; + } - return root; + return 1; } -static int _bdj_init(BDJAVA *bdjava, JNIEnv *env) +static int _bdj_init(JNIEnv *env, struct bluray *bd, const char *disc_root, const char *bdj_disc_id, + BDJ_STORAGE *storage) { if (!bdj_register_native_methods(env)) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't register native methods.\n"); @@ -307,34 +376,38 @@ // initialize class org.videolan.Libbluray jclass init_class; jmethodID init_id; - if (!bdj_get_method(env, &init_class, &init_id, - "org/videolan/Libbluray", "init", "(JLjava/lang/String;)V")) { + if (!_get_method(env, &init_class, &init_id, + "org/videolan/Libbluray", "init", + "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V")) { return 0; } - char* id_path = str_printf("%s/CERTIFICATE/id.bdmv", bdjava->path); - BDID_DATA *id = bdid_parse(id_path); - jlong param_bdjava_ptr = (jlong)(intptr_t) bdjava; - jstring param_disc_id = (*env)->NewStringUTF(env, - id ? id->disc_id : "00000000000000000000000000000000"); + const char *disc_id = (bdj_disc_id && bdj_disc_id[0]) ? bdj_disc_id : "00000000000000000000000000000000"; + jlong param_bdjava_ptr = (jlong)(intptr_t) bd; + jstring param_disc_id = (*env)->NewStringUTF(env, disc_id); + jstring param_disc_root = (*env)->NewStringUTF(env, disc_root); + jstring param_persistent_root = (*env)->NewStringUTF(env, _bdj_persistent_root(storage)); + jstring param_buda_root = (*env)->NewStringUTF(env, _bdj_buda_root(storage)); + (*env)->CallStaticVoidMethod(env, init_class, init_id, - param_bdjava_ptr, param_disc_id); + param_bdjava_ptr, param_disc_id, param_disc_root, + param_persistent_root, param_buda_root); if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to initialize BD-J (uncaught exception)\n"); (*env)->ExceptionClear(env); + return 0; } (*env)->DeleteLocalRef(env, init_class); (*env)->DeleteLocalRef(env, param_disc_id); - - free(id_path); - bdid_free(&id); + (*env)->DeleteLocalRef(env, param_disc_root); return 1; } -int bdj_jvm_available(void) +int bdj_jvm_available(BDJ_STORAGE *storage) { const char *java_home; void* jvm_lib = _load_jvm(&java_home); @@ -344,59 +417,54 @@ } dl_dlclose(jvm_lib); - FILE *fp = fopen(_find_libbluray_jar(), "rb"); - if (!fp) { + if (!_find_libbluray_jar(storage)) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J check: Failed to load libbluray.jar\n"); return 1; } - fclose(fp); BD_DEBUG(DBG_BDJ, "BD-J check: OK\n"); return 2; } -BDJAVA* bdj_open(const char *path, struct bluray *bd, - struct indx_root_s *index, - bdj_overlay_cb osd_cb, struct bd_argb_buffer_s *buf) +static int _find_jvm(void *jvm_lib, JNIEnv **env, JavaVM **jvm) { - BD_DEBUG(DBG_BDJ, "bdj_open()\n"); + fptr_JNI_GetCreatedJavaVMs JNI_GetCreatedJavaVMs_fp = (fptr_JNI_GetCreatedJavaVMs)(intptr_t)dl_dlsym(jvm_lib, "JNI_GetCreatedJavaVMs"); + if (JNI_GetCreatedJavaVMs_fp == NULL) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't find symbol JNI_GetCreatedJavaVMs.\n"); + return 0; + } - // first load the jvm using dlopen - const char *java_home = NULL; - void* jvm_lib = _load_jvm(&java_home); + jsize nVMs = 0; + JavaVM* javavm = NULL; - if (!jvm_lib) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load JVM\n"); - return NULL; + int result = JNI_GetCreatedJavaVMs_fp(&javavm, 1, &nVMs); + if (result == JNI_OK && nVMs > 0) { + *jvm = javavm; + (**jvm)->AttachCurrentThread(*jvm, (void**)env, NULL); + return 1; } - fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)(intptr_t)dl_dlsym(jvm_lib, "JNI_CreateJavaVM"); + return 0; +} + +static int _create_jvm(void *jvm_lib, const char *java_home, const char *jar_file, + JNIEnv **env, JavaVM **jvm) +{ + (void)java_home; /* used only with J2ME */ + fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)(intptr_t)dl_dlsym(jvm_lib, "JNI_CreateJavaVM"); if (JNI_CreateJavaVM_fp == NULL) { - dl_dlclose(jvm_lib); BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't find symbol JNI_CreateJavaVM.\n"); - return NULL; + return 0; } - BDJAVA* bdjava = calloc(1, sizeof(BDJAVA)); - bdjava->bd = bd; - bdjava->index = index; - bdjava->path = path; - bdjava->h_libjvm = jvm_lib; - bdjava->osd_cb = osd_cb; - bdjava->buf = buf; - JavaVMOption* option = calloc(1, sizeof(JavaVMOption) * 20); int n = 0; JavaVMInitArgs args; - option[n++].optionString = str_printf("-Dbluray.vfs.root=%s", path); - option[n++].optionString = str_printf("-Ddvb.persistent.root=%s", _bdj_persistent_root()); - option[n++].optionString = str_printf("-Dbluray.bindingunit.root=%s", _bdj_buda_root()); - 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_printf("-Xbootclasspath/p:%s", _find_libbluray_jar()); + 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"); @@ -431,106 +499,68 @@ args.options = option; args.ignoreUnrecognized = JNI_FALSE; // don't ignore unrecognized options - JNIEnv* env = NULL; - int result = JNI_CreateJavaVM_fp(&bdjava->jvm, (void**) &env, &args); - -// while (n) { -// X_FREE(option[--n].optionString); -// } + int result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args); - X_FREE(option); - - if (result != JNI_OK || !env) { - bdj_close(bdjava); - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to create new Java VM.\n"); - return NULL; + while (--n >= 0) { + X_FREE(option[n].optionString); } + X_FREE(option); - if (!_bdj_init(bdjava, env)) { - bdj_close(bdjava); - return NULL; + if (result != JNI_OK || !*env) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to create new Java VM. JNI_CreateJavaVM result: %d\n", result); + return 0; } - /* detach java main thread (CreateJavaVM attachs calling thread to JVM) */ - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - - return bdjava; + return 1; } -int bdj_start(BDJAVA *bdjava, unsigned title) +BDJAVA* bdj_open(const char *path, struct bluray *bd, + const char *bdj_disc_id, BDJ_STORAGE *storage) { - JNIEnv* env; - int attach = 0; - jboolean status = JNI_FALSE; - jclass loader_class; - jmethodID load_id; - - if (!bdjava) { - return BDJ_ERROR; - } - - BD_DEBUG(DBG_BDJ, "bdj_start(%d)\n", title); + BD_DEBUG(DBG_BDJ, "bdj_open()\n"); - if ((*bdjava->jvm)->GetEnv(bdjava->jvm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { - (*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL); - attach = 1; + const char *jar_file = _find_libbluray_jar(storage); + if (!jar_file) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J start failed: " BDJ_JARFILE " not found.\n"); + return NULL; } - if (bdj_get_method(env, &loader_class, &load_id, - "org/videolan/BDJLoader", "load", "(I)Z")) { - status = (*env)->CallStaticBooleanMethod(env, loader_class, load_id, (jint)title); - - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - } - - (*env)->DeleteLocalRef(env, loader_class); - } + // first load the jvm using dlopen + const char *java_home = NULL; + void* jvm_lib = _load_jvm(&java_home); - if (attach) { - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); + if (!jvm_lib) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load JVM\n"); + return 0; } - return (status == JNI_TRUE) ? BDJ_SUCCESS : BDJ_ERROR; -} - -int bdj_stop(BDJAVA *bdjava) -{ - JNIEnv *env; - int attach = 0; - jboolean status = JNI_FALSE; - jclass loader_class; - jmethodID unload_id; + JNIEnv* env = NULL; + JavaVM *jvm = NULL; + if (!_find_jvm(jvm_lib, &env, &jvm) && + !_create_jvm(jvm_lib, java_home, jar_file, &env, &jvm)) { - if (!bdjava) { - return BDJ_ERROR; + dl_dlclose(jvm_lib); + return NULL; } - BD_DEBUG(DBG_BDJ, "bdj_stop()\n"); + BDJAVA* bdjava = calloc(1, sizeof(BDJAVA)); + bdjava->h_libjvm = jvm_lib; + bdjava->jvm = jvm; - if ((*bdjava->jvm)->GetEnv(bdjava->jvm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { - (*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL); - attach = 1; + if (debug_mask & DBG_JNI) { + int version = (int)(*env)->GetVersion(env); + BD_DEBUG(DBG_BDJ, "Java version: %d.%d\n", version >> 16, version & 0xffff); } - if (bdj_get_method(env, &loader_class, &unload_id, - "org/videolan/BDJLoader", "unload", "()Z")) { - status = (*env)->CallStaticBooleanMethod(env, loader_class, unload_id); - - if ((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - } - - (*env)->DeleteLocalRef(env, loader_class); + if (!_bdj_init(env, bd, path, bdj_disc_id, storage)) { + bdj_close(bdjava); + return NULL; } - if (attach) { - (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - } + /* detach java main thread (CreateJavaVM attachs calling thread to JVM) */ + (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); - return (status == JNI_TRUE) ? BDJ_SUCCESS : BDJ_ERROR; + return bdjava; } void bdj_close(BDJAVA *bdjava) @@ -552,23 +582,24 @@ attach = 1; } - if (bdj_get_method(env, &shutdown_class, &shutdown_id, + if (_get_method(env, &shutdown_class, &shutdown_id, "org/videolan/Libbluray", "shutdown", "()V")) { (*env)->CallStaticVoidMethod(env, shutdown_class, shutdown_id); if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to shutdown BD-J (uncaught exception)\n"); (*env)->ExceptionClear(env); } (*env)->DeleteLocalRef(env, shutdown_class); } + bdj_unregister_native_methods(env); + if (attach) { (*bdjava->jvm)->DetachCurrentThread(bdjava->jvm); } - - (*bdjava->jvm)->DestroyJavaVM(bdjava->jvm); } if (bdjava->h_libjvm) { @@ -586,12 +617,20 @@ "PLAYITEM", "ANGLE", "SUBTITLE", - "PIP", "END_OF_PLAYLIST", "PTS", "VK_KEY", "MARK", "PSR102", + "PLAYLIST", + + "START", + "STOP", + + "RATE", + "AUDIO_STREAM", + "SECONDARY_STREAM", + "UO_MASKED", }; JNIEnv* env; @@ -604,14 +643,17 @@ return -1; } - BD_DEBUG(DBG_BDJ, "bdj_process_event(%s,%d)\n", ev_name[ev], param); + // Disable too verbose logging (PTS) + if (ev != BDJ_EVENT_PTS) { + BD_DEBUG(DBG_BDJ, "bdj_process_event(%s,%d)\n", ev_name[ev], param); + } if ((*bdjava->jvm)->GetEnv(bdjava->jvm, (void**)&env, JNI_VERSION_1_4) != JNI_OK) { (*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL); attach = 1; } - if (bdj_get_method(env, &event_class, &event_id, + if (_get_method(env, &event_class, &event_id, "org/videolan/Libbluray", "processEvent", "(II)Z")) { if ((*env)->CallStaticBooleanMethod(env, event_class, event_id, ev, param)) { result = 0; @@ -619,6 +661,7 @@ if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "bdj_process_event(%u,%u) failed (uncaught exception)\n", ev, param); (*env)->ExceptionClear(env); } @@ -631,12 +674,3 @@ return result; } - -int bdj_get_uo_mask(BDJAVA *bdjava) -{ - if (!bdjava) { - return 0; - } - - return bdjava->uo_mask; -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj.h libbluray-0.8.1/src/libbluray/bdj/bdj.h --- libbluray-0.5.0/src/libbluray/bdj/bdj.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdj.h 2015-05-15 09:25:06.000000000 +0000 @@ -20,9 +20,7 @@ #ifndef BDJ_H_ #define BDJ_H_ -#include "common.h" - -#include +#include "util/attributes.h" typedef enum { BDJ_EVENT_NONE = 0, @@ -30,36 +28,38 @@ BDJ_EVENT_PLAYITEM, BDJ_EVENT_ANGLE, BDJ_EVENT_SUBTITLE, - BDJ_EVENT_PIP, BDJ_EVENT_END_OF_PLAYLIST, BDJ_EVENT_PTS, BDJ_EVENT_VK_KEY, BDJ_EVENT_MARK, BDJ_EVENT_PSR102, + BDJ_EVENT_PLAYLIST, + + BDJ_EVENT_START, /* param: title number */ + BDJ_EVENT_STOP, + + BDJ_EVENT_RATE, + BDJ_EVENT_AUDIO_STREAM, + BDJ_EVENT_SECONDARY_STREAM, + BDJ_EVENT_UO_MASKED, } BDJ_EVENT; -/* bdj_get_uo_mask() */ -#define BDJ_MENU_CALL_MASK 0x01 -#define BDJ_TITLE_SEARCH_MASK 0x02 +typedef struct { + char *persistent_root; + char *cache_root; + + char *classpath; +} BDJ_STORAGE; typedef struct bdjava_s BDJAVA; struct bluray; -struct indx_root_s; -struct bd_argb_buffer_s; - -typedef void (*bdj_overlay_cb)(struct bluray *, const unsigned *, int, int, - int, int, int, int); BD_PRIVATE BDJAVA* bdj_open(const char *path, struct bluray *bd, - struct indx_root_s *index, - bdj_overlay_cb osd_cb, struct bd_argb_buffer_s *buf); -BD_PRIVATE int bdj_start(BDJAVA *bdjava, unsigned title); -BD_PRIVATE int bdj_stop(BDJAVA *bdjava); + const char *bdj_disc_id, BDJ_STORAGE *storage); BD_PRIVATE void bdj_close(BDJAVA *bdjava); BD_PRIVATE int bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param); -BD_PRIVATE int bdj_get_uo_mask(BDJAVA *bdjava); -BD_PRIVATE int bdj_jvm_available(void); /* 0: no. 1: only jvm. 2: jvm + libbluray.jar. */ +BD_PRIVATE int bdj_jvm_available(BDJ_STORAGE *storage); /* 0: no. 1: only jvm. 2: jvm + libbluray.jar. */ #endif diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_data.h libbluray-0.8.1/src/libbluray/bdj/bdjo_data.h --- libbluray-0.5.0/src/libbluray/bdj/bdjo_data.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdjo_data.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if !defined(_BDJO_DATA_H_) +#define _BDJO_DATA_H_ + +#include + + +typedef struct { + char default_font[6]; // default AWT font. AUXDATA/?????.otf. "*****" = none. + uint8_t initial_havi_config_id; // valid only if no autostart playlist. + uint8_t menu_call_mask; + uint8_t title_search_mask; +} BDJO_TERMINAL_INFO; + +typedef struct { + uint8_t type; // 1 - JAR, 2 - directory + char ref_to_name[6]; // JAR/xxxxx.jar or JAR/xxxxx/ + char lang_code[4]; // ref. to PSR18. "*.*" = cache always. "%%%" = fallback when no language matches PSR18. +} BDJO_APP_CACHE_ITEM; + +typedef struct { + uint8_t num_item; + BDJO_APP_CACHE_ITEM *item; +} BDJO_APP_CACHE_INFO; + +typedef struct { + char name[6]; +} BDJO_PLAYLIST; + +typedef struct { + uint8_t access_to_all_flag; + uint8_t autostart_first_playlist_flag; + + uint16_t num_pl; + BDJO_PLAYLIST *pl; +} BDJO_ACCESSIBLE_PLAYLISTS; + +typedef struct { + uint16_t profile_number; /* 1: BD-ROM profile 1. 2: BD-ROM profile 2 */ + uint8_t major_version; + uint8_t minor_version; + uint8_t micro_version; +} BDJO_APP_PROFILE; + +typedef struct { + char lang[4]; + char *name; /* UTF-8, informative name */ +} BDJO_APP_NAME; + +typedef struct { + char *param; +} BDJO_APP_PARAM; + +typedef struct { + uint8_t control_code; /* 1 - autostart, 2 - present */ + uint8_t type; /* 1 - BD-J App */ + uint32_t org_id; + uint16_t app_id; + + /* descriptor */ + + uint8_t num_profile; + BDJO_APP_PROFILE *profile; + + uint8_t priority; + uint8_t binding; + uint8_t visibility; + + uint16_t num_name; + BDJO_APP_NAME *name; + + uint8_t icon_flags; + char *icon_locator; // relative to base_dir + char *base_dir; // "00000" -> 00000.jar!/ , "00000/base" -> 00000.jar!/base/ + char *classpath_extension; // separator ; . relative paths relative to base_dir. absolute paths refer to .jar files. + char *initial_class; + + uint8_t num_param; + BDJO_APP_PARAM *param; +} BDJO_APP; + +typedef struct { + uint8_t num_app; + BDJO_APP *app; +} BDJO_APP_MANAGEMENT_TABLE; + +typedef struct { + unsigned int vk_play : 1; + unsigned int vk_stop : 1; + unsigned int vk_ffw : 1; + unsigned int vk_rew : 1; + unsigned int vk_track_next : 1; + unsigned int vk_track_prev : 1; + unsigned int vk_pause : 1; + unsigned int vk_still_off : 1; + unsigned int vk_sec_audio_ena_dis : 1; + unsigned int vk_sec_video_ena_dis : 1; + unsigned int pg_textst_ena_dis : 1; +} BDJO_KEY_INTEREST_TABLE; + +typedef struct { + // relative to VFS root. Separator ";". Should not start with "/". + // common "." == access to all files in VFS. + char *path; +} BDJO_FILE_ACCESS_INFO; + +typedef struct bdjo_data { + BDJO_TERMINAL_INFO terminal_info; + BDJO_APP_CACHE_INFO app_cache_info; + BDJO_ACCESSIBLE_PLAYLISTS accessible_playlists; + BDJO_APP_MANAGEMENT_TABLE app_table; + + BDJO_KEY_INTEREST_TABLE key_interest_table; + BDJO_FILE_ACCESS_INFO file_access_info; +} BDJO; + + +#endif // _BDJO_DATA_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parse.c libbluray-0.8.1/src/libbluray/bdj/bdjo_parse.c --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parse.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdjo_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,588 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bdjo_parse.h" + +#include "bdjo_data.h" + +#include "disc/disc.h" + +#include "file/file.h" +#include "util/bits.h" +#include "util/logging.h" +#include "util/macro.h" + +#include +#include + +static char *_read_string(BITSTREAM* bs, uint32_t length) +{ + char *out = malloc(length + 1); + if (out) { + bs_read_string(bs, out, length); + } else { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + bs_skip(bs, length * 8); + } + return out; +} + +/* BDJO_TERMINAL_INFO */ + +static int _parse_terminal_info(BITSTREAM* bs, BDJO_TERMINAL_INFO *p) +{ + bs_skip(bs, 32); // skip length + + bs_read_string(bs, p->default_font, 5); + p->initial_havi_config_id = bs_read(bs, 4); + p->menu_call_mask = bs_read(bs, 1); + p->title_search_mask = bs_read(bs, 1); + + bs_skip(bs, 34); // skip padding + + return 1; +} + +/* BDJO_APP_CACHE_ITEM */ + +static void _parse_app_cache_item(BITSTREAM* bs, BDJO_APP_CACHE_ITEM *p) +{ + p->type = bs_read(bs, 8); + + bs_read_string(bs, p->ref_to_name, 5); + bs_read_string(bs, p->lang_code, 3); + + bs_skip(bs, 24); // skip padding +} + +/* BDJO_APP_CACHE_INFO */ + +static void _clean_app_cache_info(BDJO_APP_CACHE_INFO *p) +{ + if (p) { + X_FREE(p->item); + } +} + +static int _parse_app_cache_info(BITSTREAM* bs, BDJO_APP_CACHE_INFO *p) +{ + unsigned ii; + + bs_skip(bs, 32); // skip length + + p->num_item = bs_read(bs, 8); + bs_skip(bs, 8); // skip padding + + p->item = calloc(p->num_item, sizeof(BDJO_APP_CACHE_ITEM)); + if (!p->item) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_item; ii++) { + _parse_app_cache_item(bs, &p->item[ii]); + } + + return 1; +} + +/* BDJO_ACCESSIBLE_PLAYLISTS */ + +static void _clean_accessible_playlists(BDJO_ACCESSIBLE_PLAYLISTS *p) +{ + if (p) { + X_FREE(p->pl); + } +} + +static int _parse_accessible_playlists(BITSTREAM* bs, BDJO_ACCESSIBLE_PLAYLISTS *p) +{ + unsigned ii; + + bs_skip(bs, 32); // skip length + + p->num_pl = bs_read(bs, 11); + p->access_to_all_flag = bs_read(bs, 1); + p->autostart_first_playlist_flag = bs_read(bs, 1); + bs_skip(bs, 19); // skip padding + + p->pl = calloc(p->num_pl, sizeof(BDJO_PLAYLIST)); + if (!p->pl) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_pl; ii++) { + bs_read_string(bs, p->pl[ii].name, 5); + bs_skip(bs, 8); // skip padding + } + + return 1; +} + +/* BDJO_APP_PROFILE */ + +static void _parse_app_profile(BITSTREAM *bs, BDJO_APP_PROFILE *p) +{ + p->profile_number = bs_read(bs, 16); + p->major_version = bs_read(bs, 8); + p->minor_version = bs_read(bs, 8); + p->micro_version = bs_read(bs, 8); + + bs_skip(bs, 8); +} + +/* BDJO_APP_NAME */ + +static void _clean_app_name(BDJO_APP_NAME *p) +{ + if (p) { + X_FREE(p->name); + } +} + +static int _count_app_strings(BITSTREAM *bs, uint16_t data_length, uint16_t prefix_bytes, const char *type) +{ + int count = 0; + uint32_t bytes_read = 0; + int64_t pos = bs_pos(bs) >> 3; + + while (bytes_read < data_length) { + bs_skip(bs, prefix_bytes * 8); + uint8_t length = bs_read(bs, 8); + bs_skip(bs, 8 * length); + bytes_read += prefix_bytes + 1 + length; + count++; + } + + // seek back + if (bytes_read) { + bs_seek_byte(bs, pos); + } + + if (bytes_read != data_length) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "data size mismatch (%d/%d), skipping %s\n", bytes_read, data_length, type); + count = 0; + } + + return count; +} + +static int _parse_app_name(BITSTREAM *bs, BDJO_APP_NAME *p) +{ + bs_read_string(bs, p->lang, 3); + uint32_t length = bs_read(bs, 8); + p->name = _read_string(bs, length); + return p->name ? 1 : -1; +} + +/* BDJO_APP_PARAM */ + +static void _clean_app_param(BDJO_APP_PARAM *p) +{ + if (p) { + X_FREE(p->param); + } +} + +static int _parse_app_param(BITSTREAM *bs, BDJO_APP_PARAM *p) +{ + uint32_t length = bs_read(bs, 8); + p->param = _read_string(bs, length); + return p->param ? 1 : -1; +} + +/* BDJO_APP */ + +static void _clean_bdjo_app(BDJO_APP *p) +{ + if (p) { + unsigned ii; + for (ii = 0; ii < p->num_name; ii++) { + _clean_app_name(&p->name[ii]); + } + for (ii = 0; ii < p->num_param; ii++) { + _clean_app_param(&p->param[ii]); + } + X_FREE(p->profile); + X_FREE(p->name); + X_FREE(p->icon_locator); + X_FREE(p->base_dir); + X_FREE(p->classpath_extension); + X_FREE(p->initial_class); + X_FREE(p->param); + } +} + +static char *_read_app_string(BITSTREAM *bs) +{ + char *result; + uint8_t length = bs_read(bs, 8); + + result = _read_string(bs, length); + + // word align + if (!(length & 1)) + bs_skip(bs, 8); + + return result; +} + +static int _parse_app_names(BITSTREAM *bs, BDJO_APP *p) +{ + unsigned ii; + + uint32_t data_length = bs_read(bs, 16); + p->num_name = _count_app_strings(bs, data_length, 3, "names"); + + if (data_length == 0) return 1; + + if (p->num_name) { + p->name = calloc(p->num_name, sizeof(BDJO_APP_NAME)); + if (!p->name) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_name; ii++) { + if (_parse_app_name(bs, &p->name[ii]) < 0) { + return -1; + } + } + + } else { + // ignore invalid data (seek over chunk) + bs_skip(bs, data_length*8); + } + + // word align + bs_skip(bs, 8 * (data_length & 1)); + + return 1; +} + + +static int _parse_app_params(BITSTREAM *bs, BDJO_APP *p) +{ + unsigned ii; + + uint32_t data_length = bs_read(bs, 8); + p->num_param = _count_app_strings(bs, data_length, 0, "params"); + + if (p->num_param) { + p->param = calloc(p->num_param, sizeof(BDJO_APP_PARAM)); + if (!p->param) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_param; ii++) { + if (_parse_app_param(bs, &p->param[ii]) < 0) { + return -1; + } + } + + } else { + // ignore invalid data (seek over chunk) + bs_skip(bs, data_length*8); + } + + // word align + if (!(data_length & 1)) + bs_skip(bs, 8); + + return 1; +} + +static int _parse_bdjo_app(BITSTREAM *bs, BDJO_APP *p) +{ + unsigned ii; + + p->control_code = bs_read(bs, 8); + p->type = bs_read(bs, 4); + bs_skip(bs, 4); + p->org_id = bs_read(bs, 32); + p->app_id = bs_read(bs, 16); + + bs_skip(bs, 80); // skip sescriptor tag and length + + /* application descriptor */ + + p->num_profile = bs_read(bs, 4); + bs_skip(bs, 12); // skip padding + + p->profile = calloc(p->num_profile, sizeof(BDJO_APP_PROFILE)); + if (!p->profile) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_profile; ii++) { + _parse_app_profile(bs, &p->profile[ii]); + } + + p->priority = bs_read(bs, 8); + p->binding = bs_read(bs, 2); + p->visibility = bs_read(bs, 2); + bs_skip(bs, 4); + + if (_parse_app_names(bs, p) < 0) { + return -1; + } + + p->icon_locator = _read_app_string(bs); + if (!p->icon_locator) { + return -1; + } + p->icon_flags = bs_read(bs, 16); + + p->base_dir = _read_app_string(bs); + if (!p->base_dir) { + return -1; + } + + p->classpath_extension = _read_app_string(bs); + if (!p->classpath_extension) { + return -1; + } + + p->initial_class = _read_app_string(bs); + if (!p->initial_class) { + return -1; + } + + if (_parse_app_params(bs, p) < 0) { + return -1; + } + + return 1; +} + +/* BDJO_APP_MANAGEMENT_TABLE */ + +static void _clean_app_management_table(BDJO_APP_MANAGEMENT_TABLE *p) +{ + if (p) { + unsigned ii; + for (ii = 0; ii < p->num_app; ii++) { + _clean_bdjo_app(&p->app[ii]); + } + X_FREE(p->app); + } +} + +static int _parse_app_management_table(BITSTREAM *bs, BDJO_APP_MANAGEMENT_TABLE *p) +{ + unsigned ii; + + bs_skip(bs, 32); // length + + p->num_app = bs_read(bs, 8); + bs_skip(bs, 8); // skip padding + + p->app = calloc(p->num_app, sizeof(BDJO_APP)); + if (!p->app) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return -1; + } + + for (ii = 0; ii < p->num_app; ii++) { + /* TODO: if parsing of application data fails, ignore that app but parse others */ + if (_parse_bdjo_app(bs, &p->app[ii]) < 0) { + return -1; + } + } + + return 1; +} + +/* BDJO_KEY_INTEREST_TABLE */ + +static int _parse_key_interest_table(BITSTREAM *bs, BDJO_KEY_INTEREST_TABLE *p) +{ + p->vk_play = bs_read(bs, 1); + p->vk_stop = bs_read(bs, 1); + p->vk_ffw = bs_read(bs, 1); + p->vk_rew = bs_read(bs, 1); + p->vk_track_next = bs_read(bs, 1); + p->vk_track_prev = bs_read(bs, 1); + p->vk_pause = bs_read(bs, 1); + p->vk_still_off = bs_read(bs, 1); + p->vk_sec_audio_ena_dis = bs_read(bs, 1); + p->vk_sec_video_ena_dis = bs_read(bs, 1); + p->pg_textst_ena_dis = bs_read(bs, 1); + + bs_skip(bs, 21); + + return 1; +} + +/* BDJO_FILE_ACCESS_INFO */ + +static void _clean_file_access_info(BDJO_FILE_ACCESS_INFO *p) +{ + if (p) { + X_FREE(p->path); + } +} + +static int _parse_file_access_info(BITSTREAM *bs, BDJO_FILE_ACCESS_INFO *p) +{ + uint16_t file_access_length = bs_read(bs, 16); + p->path = _read_string(bs, file_access_length); + return p->path ? 1 : -1; +} + +/* BDJO */ + +static void _clean_bdjo(BDJO *p) +{ + if (p) { + _clean_app_cache_info(&p->app_cache_info); + _clean_accessible_playlists(&p->accessible_playlists); + _clean_app_management_table(&p->app_table); + _clean_file_access_info(&p->file_access_info); + } +} + +static int _get_version(const uint8_t* str) +{ + if (memcmp(str, "0100", 4) != 0) + return 100; + else if (memcmp(str, "0200", 4) != 0) + return 200; + else + return 0; +} + +static int _check_version(BITSTREAM *bs) +{ + // first check magic number + uint8_t magic[4]; + bs_read_bytes(bs, magic, 4); + + if (memcmp(magic, "BDJO", 4) != 0) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Invalid magic number in BDJO.\n"); + return -1; + } + + // get version string + uint8_t version[4]; + bs_read_bytes(bs, version, 4); + if (!_get_version(version)) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Invalid version of BDJO.\n"); + return -1; + } + BD_DEBUG(DBG_BDJ, "[bdj] BDJO > Version: %.4s\n", version); + + // skip address table + bs_skip(bs, 8*40); + + return 1; +} + +static BDJO *_bdjo_parse(BD_FILE_H *fp) +{ + BITSTREAM bs; + BDJO *p; + + bs_init(&bs, fp); + + p = calloc(1, sizeof(BDJO)); + if (!p) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Out of memory\n"); + return NULL; + } + + if (_check_version(&bs) < 0 || + _parse_terminal_info(&bs, &p->terminal_info) < 0 || + _parse_app_cache_info(&bs, &p->app_cache_info) < 0 || + _parse_accessible_playlists(&bs, &p->accessible_playlists) < 0 || + _parse_app_management_table(&bs, &p->app_table) < 0 || + _parse_key_interest_table(&bs, &p->key_interest_table) < 0 || + _parse_file_access_info(&bs, &p->file_access_info) < 0) { + + bdjo_free(&p); + } + + return p; +} + +/* + * + */ + +void bdjo_free(BDJO **pp) +{ + if (pp && *pp) { + _clean_bdjo(*pp); + X_FREE(*pp); + } +} + +BDJO *bdjo_parse(const char *path) +{ + BD_FILE_H *fp; + BDJO *bdjo; + + fp = file_open(path, "rb"); + if (!fp) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to open bdjo file (%s)\n", path); + return NULL; + } + + bdjo = _bdjo_parse(fp); + file_close(fp); + return bdjo; +} + +static BDJO *_bdjo_get(BD_DISC *disc, const char *dir, const char *file) +{ + BD_FILE_H *fp; + BDJO *bdjo; + + fp = disc_open_file(disc, dir, file); + if (!fp) { + return NULL; + } + + bdjo = _bdjo_parse(fp); + file_close(fp); + + return bdjo; +} + +BDJO *bdjo_get(BD_DISC *disc, const char *file) +{ + BDJO *bdjo; + + bdjo = _bdjo_get(disc, "BDMV" DIR_SEP "BDJO", file); + if (bdjo) { + return bdjo; + } + + /* if failed, try backup file */ + bdjo = _bdjo_get(disc, "BDMV" DIR_SEP "BACKUP" DIR_SEP "BDJO", file); + return bdjo; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parse.h libbluray-0.8.1/src/libbluray/bdj/bdjo_parse.h --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parse.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdjo_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if !defined(_BDJO_PARSE_H_) +#define _BDJO_PARSE_H_ + +#include "util/attributes.h" + +struct bdjo_data; +struct bd_disc; + +BD_PRIVATE struct bdjo_data *bdjo_parse(const char *path); +BD_PRIVATE struct bdjo_data *bdjo_get(struct bd_disc *disc, const char *file); +BD_PRIVATE void bdjo_free(struct bdjo_data **pp); + +#endif // _BDJO_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.c libbluray-0.8.1/src/libbluray/bdj/bdjo_parser.c --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdjo_parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,441 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -#include "bdjo_parser.h" -#include "common.h" - -#include -#include -#include - -#include "file/file.h" -#include "util/bits.h" -#include "util/macro.h" -#include "bdj_util.h" - -#define MAX_BDJO_FILE_SIZE 0xffff - -/* Documentation: HD Cookbook - * https://hdcookbook.dev.java.net/ - */ - -#define JNICHK(a) if((*env)->ExceptionOccurred(env)) { \ - BD_DEBUG(DBG_BDJ, "Exception occured\n"); \ - (*env)->ExceptionDescribe(env); \ - } if (!a) return NULL; - -static int _get_version(const uint8_t* str) -{ - if (strcmp((const char*) str, "0100") != 0) - return 100; - else if (strcmp((const char*) str, "0200") != 0) - return 200; - else - return BDJ_ERROR; -} - -// use when string is already allocated, out should be length + 1 -static void _get_string(BITBUFFER* buf, char* out, uint32_t length) -{ - bb_read_bytes(buf, (uint8_t*)out, length); - out[length] = 0; // add null termination -} - -static void _make_string(BITBUFFER* buf, char** out, uint32_t length) -{ - *out = malloc(length + 1); - bb_read_bytes(buf, (uint8_t*)*out, length); - (*out)[length] = 0; // add null termination -} - -static jstring _read_jstring(JNIEnv* env, BITBUFFER* buf, uint32_t length) -{ - char* str; - _make_string(buf, &str, length); - jstring jstr = (*env)->NewStringUTF(env, str); - free(str); - return jstr; -} - -static jobject _parse_terminal_info(JNIEnv* env, BITBUFFER* buf) -{ - // skip length specifier - bb_seek(buf, 32, SEEK_CUR); - - char default_font[6]; - _get_string(buf, default_font, 5); - jstring jdefault_font = (*env)->NewStringUTF(env, default_font); - - jint havi_config = bb_read(buf, 4); - jboolean menu_call_mask = bb_read(buf, 1); - jboolean title_search_mask = bb_read(buf, 1); - - bb_seek(buf, 34, SEEK_CUR); - - return bdj_make_object(env, "org/videolan/bdjo/TerminalInfo", "(Ljava/lang/String;IZZ)V", - jdefault_font, havi_config, menu_call_mask, title_search_mask); -} - -static jobject _parse_app_cache_info(JNIEnv* env, BITBUFFER* buf) -{ - // skip length specifier - bb_seek(buf, 32, SEEK_CUR); - - int count = bb_read(buf, 8); - - jobjectArray app_cache_array = bdj_make_array(env, "org/videolan/bdjo/AppCache", count); - JNICHK(app_cache_array); - - // skip padding - bb_seek(buf, 8, SEEK_CUR); - - - for (int i = 0; i < count; i++) { - jint type = bb_read(buf, 8); - - char ref_to_name[6]; - _get_string(buf, ref_to_name, 5); - jstring jref_to_name = (*env)->NewStringUTF(env, ref_to_name); - JNICHK(jref_to_name); - - char language_code[4]; - _get_string(buf, language_code, 3); - jstring jlanguage_code = (*env)->NewStringUTF(env, language_code); - JNICHK(jlanguage_code); - - jobject entry = bdj_make_object(env, "org/videolan/bdjo/AppCache", - "(ILjava/lang/String;Ljava/lang/String;)V", type, jref_to_name, jlanguage_code); - JNICHK(entry); - - (*env)->SetObjectArrayElement(env, app_cache_array, i, entry); - - // skip padding - bb_seek(buf, 24, SEEK_CUR); - } - - return app_cache_array; -} - -static jobject _parse_accessible_playlists(JNIEnv* env, BITBUFFER* buf) -{ - // skip length specifier - bb_seek(buf, 32, SEEK_CUR); - - int count = bb_read(buf, 11); - jobjectArray playlists = bdj_make_array(env, "java/lang/String", count); - - jboolean access_to_all_flag = bb_read(buf, 1); - jboolean autostart_first_playlist = bb_read(buf, 1); - - // skip padding - bb_seek(buf, 19, SEEK_CUR); - - for (int i = 0; i < count; i++) { - char playlist_name[6]; - _get_string(buf, playlist_name, 5); - jstring jplaylist_name = (*env)->NewStringUTF(env, playlist_name); - JNICHK(jplaylist_name); - - (*env)->SetObjectArrayElement(env, playlists, i, jplaylist_name); - - // skip padding - bb_seek(buf, 8, SEEK_CUR); - } - - return bdj_make_object(env, "org/videolan/bdjo/PlayListTable", "(ZZ[Ljava/lang/String;)V", - access_to_all_flag, autostart_first_playlist, playlists); -} - -static jobjectArray _parse_app_management_table(JNIEnv* env, BITBUFFER* buf) -{ - // skip length specifier - bb_seek(buf, 32, SEEK_CUR); - - int count = bb_read(buf, 8); - - jclass entries = bdj_make_array(env, "org/videolan/bdjo/AppEntry", count); - - // skip padding - bb_seek(buf, 8, SEEK_CUR); - - for (int i = 0; i < count; i++) { - jint control_code = bb_read(buf, 8); - jint type = bb_read(buf, 4); - - // skip padding - bb_seek(buf, 4, SEEK_CUR); - - jint organization_id = bb_read(buf, 32); - jshort application_id = bb_read(buf, 16); - - // skip padding - bb_seek(buf, 80, SEEK_CUR); - - int profiles_count = bb_read(buf, 4); - jobjectArray profiles = bdj_make_array(env, "org/videolan/bdjo/AppProfile", profiles_count); - JNICHK(profiles); - - // skip padding - bb_seek(buf, 12, SEEK_CUR); - - for (int j = 0; j < profiles_count; j++) { - jshort profile_num = bb_read(buf, 16); - jbyte major_version = bb_read(buf, 8); - jbyte minor_version = bb_read(buf, 8); - jbyte micro_version = bb_read(buf, 8); - - jobject profile = bdj_make_object(env, "org/videolan/bdjo/AppProfile", "(SBBB)V", - profile_num, major_version, minor_version, micro_version); - JNICHK(profile); - - (*env)->SetObjectArrayElement(env, profiles, j, profile); - JNICHK(1); - - // skip padding - bb_seek(buf, 8, SEEK_CUR); - } - - jint priority = bb_read(buf, 8); - jint binding = bb_read(buf, 2); - jint visibility = bb_read(buf, 2); - - // skip padding - bb_seek(buf, 4, SEEK_CUR); - - uint16_t name_data_length = bb_read(buf, 16); - jobjectArray app_names = NULL; - - if (name_data_length > 0) { - // first scan for the number of app names - int app_name_count = 0; - uint16_t name_bytes_read = 0; - while (name_bytes_read < name_data_length) { - bb_seek(buf, 24, SEEK_CUR); - - uint8_t name_length = bb_read(buf, 8); - bb_seek(buf, 8*name_length, SEEK_CUR); - - app_name_count++; - name_bytes_read += 4 + name_length; - } - - // seek back to beginning of names - bb_seek(buf, -name_data_length*8, SEEK_CUR); - - app_names = bdj_make_array(env, "[Ljava/lang/String;", app_name_count); - JNICHK(app_names); - - for (int j = 0; j < app_name_count; j++) { - char language[4]; - _get_string(buf, language, 3); - jstring jlanguage = (*env)->NewStringUTF(env, language); - JNICHK(jlanguage); - - uint8_t name_length = bb_read(buf, 8); - jstring jname = _read_jstring(env, buf, name_length); - JNICHK(jname); - - jobjectArray app_name = bdj_make_array(env, "java/lang/String", 2); - JNICHK(app_name); - - (*env)->SetObjectArrayElement(env, app_name, 0, jlanguage); - JNICHK(1); - (*env)->SetObjectArrayElement(env, app_name, 1, jname); - JNICHK(1); - - (*env)->SetObjectArrayElement(env, app_names, j, app_name); - JNICHK(1); - } - } - - // skip padding to word boundary - if ((name_data_length & 0x1) != 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - uint8_t icon_locator_length = bb_read(buf, 8); - jstring icon_locator = _read_jstring(env, buf, icon_locator_length); - JNICHK(icon_locator); - - // skip padding to word boundary - if ((icon_locator_length & 0x1) == 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - jshort icon_flags = bb_read(buf, 16); - - uint8_t base_dir_length = bb_read(buf, 8); - jstring base_dir = _read_jstring(env, buf, base_dir_length); - JNICHK(base_dir); - - // skip padding to word boundary - if ((base_dir_length & 0x1) == 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - uint8_t classpath_length = bb_read(buf, 8); - jstring classpath_extension = _read_jstring(env, buf, classpath_length); - JNICHK(classpath_extension); - - // skip padding to word boundary - if ((classpath_length & 0x1) == 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - uint8_t initial_class_length = bb_read(buf, 8); - jstring initial_class = _read_jstring(env, buf, initial_class_length); - - // skip padding to word boundary - if ((initial_class_length & 0x1) == 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - uint8_t param_data_length = bb_read(buf, 8); - - jobjectArray params = NULL; - if (param_data_length > 0) { - // first scan for the number of params - int param_count = 0; - uint16_t param_bytes_read = 0; - while (param_bytes_read < param_data_length) { - uint8_t param_length = bb_read(buf, 8); - bb_seek(buf, 8*param_length, SEEK_CUR); - - param_count++; - param_bytes_read += 1 + param_length; - } - - // seek back to beginning of params - bb_seek(buf, -param_data_length*8, SEEK_CUR); - - params = bdj_make_array(env, "java/lang/String", param_count); - - for (int j = 0; j < param_count; j++) { - uint8_t param_length = bb_read(buf, 8); - jstring param = _read_jstring(env, buf, param_length); - JNICHK(param); - - (*env)->SetObjectArrayElement(env, params, j, param); - JNICHK(1); - } - } - - // skip padding to word boundary - if ((param_data_length & 0x1) == 0) { - bb_seek(buf, 8, SEEK_CUR); - } - - jobject entry = bdj_make_object(env, "org/videolan/bdjo/AppEntry", - "(IIIS[Lorg/videolan/bdjo/AppProfile;SII[[Ljava/lang/String;Ljava/lang/String;SLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V", - control_code, type, organization_id, application_id, profiles, - priority, binding, visibility, app_names, icon_locator, - icon_flags, base_dir, classpath_extension, initial_class, params); - JNICHK(entry); - - (*env)->SetObjectArrayElement(env, entries, i, entry); - } - - return entries; -} - -static jobject _parse_bdjo(JNIEnv* env, BITBUFFER* buf) -{ - // first check magic number - uint8_t magic[4]; - bb_read_bytes(buf, magic, 4); - - if (strncmp((const char*) magic, "BDJO", 4) != 0) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Invalid magic number in BDJO.\n"); - return NULL; - } - - // get version string - uint8_t version[4]; - bb_read_bytes(buf, version, 4); - if (_get_version(version) == BDJ_ERROR) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Invalid version of BDJO.\n"); - return NULL; - } - BD_DEBUG(DBG_BDJ, "[bdj] BDJO > Version: %.4s\n", version); - - // skip some unnecessary data - bb_seek(buf, 8*0x28, SEEK_CUR); - - jobject terminal_info = _parse_terminal_info(env, buf); - JNICHK(terminal_info); - - jobjectArray app_cache_info = _parse_app_cache_info(env, buf); - JNICHK(app_cache_info); - - jobject accessible_playlists = _parse_accessible_playlists(env, buf); - JNICHK(accessible_playlists); - - jobjectArray app_table = _parse_app_management_table(env, buf); - JNICHK(app_table); - - jint key_interest_table = bb_read(buf, 32); - - uint16_t file_access_length = bb_read(buf, 16); - jstring file_access_info = _read_jstring(env, buf, file_access_length); - JNICHK(file_access_info); - - return bdj_make_object(env, "org/videolan/bdjo/Bdjo", - "(Lorg/videolan/bdjo/TerminalInfo;[Lorg/videolan/bdjo/AppCache;Lorg/videolan/bdjo/PlayListTable;[Lorg/videolan/bdjo/AppEntry;ILjava/lang/String;)V", - terminal_info, app_cache_info, accessible_playlists, app_table, key_interest_table, file_access_info); -} - -jobject bdjo_read(JNIEnv* env, const char* file) -{ - jobject result = NULL; - BD_FILE_H *handle = file_open(file, "rb"); - - if (handle == NULL) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to open bdjo file (%s)\n", file); - return NULL; - } - - int64_t length = file_size(handle); - - if (length <= 0 || length > MAX_BDJO_FILE_SIZE) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file); - - } else { - size_t size = (size_t)length; - uint8_t *data = malloc(size); - size_t size_read = file_read(handle, data, size); - - if (size_read != size) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file); - - } else { - BITBUFFER *buf = malloc(sizeof(BITBUFFER)); - bb_init(buf, data, size); - - result = _parse_bdjo(env, buf); - - free(buf); - } - - free(data); - } - - file_close(handle); - - return result; -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.h libbluray-0.8.1/src/libbluray/bdj/bdjo_parser.h --- libbluray-0.5.0/src/libbluray/bdj/bdjo_parser.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdjo_parser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -#ifndef BDJO_PARSER_H_ -#define BDJO_PARSER_H_ - -#include - -#include - -BD_PRIVATE jobject bdjo_read(JNIEnv* env, const char* file); - -#endif /* BDJO_PARSER_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj_private.h libbluray-0.8.1/src/libbluray/bdj/bdj_private.h --- libbluray-0.5.0/src/libbluray/bdj/bdj_private.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdj_private.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -#ifndef BDJ_PRIVATE_H_ -#define BDJ_PRIVATE_H_ - -#include "libbluray/bluray.h" -#include "libbluray/bdnav/index_parse.h" -#include "libbluray/decoders/overlay.h" -#include - -struct bdjava_s { - BLURAY *bd; - INDX_ROOT *index; - - bdj_overlay_cb osd_cb; - BD_ARGB_BUFFER *buf; - - // JVM library - void *h_libjvm; - - // JNI - JavaVM* jvm; - - const char *path; - - unsigned uo_mask; /* UO masks from bdjo */ -}; - -#endif diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj_util.c libbluray-0.8.1/src/libbluray/bdj/bdj_util.c --- libbluray-0.5.0/src/libbluray/bdj/bdj_util.c 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdj_util.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * Copyright (C) 2012 Petri Hintukainen - * - * 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.s - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - */ - -#include "util/logging.h" - -#include "bdj_util.h" - -jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...) -{ - jclass obj_class = (*env)->FindClass(env, name); - jmethodID obj_constructor = (*env)->GetMethodID(env, obj_class, "", sig); - - if (!obj_class) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Class %s not found\n", name); - return NULL; - } - - va_list ap; - va_start(ap, sig); - jobject obj = (*env)->NewObjectV(env, obj_class, obj_constructor, ap); - va_end(ap); - - return obj; -} - -jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count) -{ - jclass arr_class = (*env)->FindClass(env, name); - return (*env)->NewObjectArray(env, count, arr_class, NULL); -} - -int bdj_get_method(JNIEnv *env, jclass *cls, jmethodID *method_id, - const char *class_name, const char *method_name, const char *method_sig) -{ - *method_id = NULL; - *cls = (*env)->FindClass(env, class_name); - if (!*cls) { - (*env)->ExceptionDescribe(env); - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); - (*env)->ExceptionClear(env); - return 0; - } - - *method_id = (*env)->GetStaticMethodID(env, *cls, method_name, method_sig); - if (!*method_id) { - (*env)->ExceptionDescribe(env); - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s method %s %s\n", - class_name, method_name, method_sig); - (*env)->DeleteLocalRef(env, *cls); - *cls = NULL; - (*env)->ExceptionClear(env); - return 0; - } - - return 1; -} - -int bdj_register_methods(JNIEnv *env, const char *class_name, - const JNINativeMethod *methods, int methods_count) -{ - jclass cls; - int error; - - (*env)->ExceptionClear(env); - - cls = (*env)->FindClass(env, class_name); - - if (!cls) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return 0; - } - - error = (*env)->RegisterNatives(env, cls, methods, methods_count); - - if ((*env)->ExceptionOccurred(env)) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to register native methods for class %s\n", class_name); - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); - return 0; - } - - if (error) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to register native methods for class %s\n", class_name); - } - - return !error; -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/bdj_util.h libbluray-0.8.1/src/libbluray/bdj/bdj_util.h --- libbluray-0.5.0/src/libbluray/bdj/bdj_util.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/bdj_util.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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.s - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - */ - -#ifndef JNIUTIL_H_ -#define JNIUTIL_H_ - -#include - -#include -#include - -// makes an object from the specified class name and constructor signature -BD_PRIVATE jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...); - -// makes an array for the specified class name, all elements are initialized to null -BD_PRIVATE jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count); - -// get java method -BD_PRIVATE int bdj_get_method(JNIEnv *env, jclass *cls, jmethodID *method_id, - const char *class_name, const char *method_name, const char *method_sig); - -// register native methods for class -BD_PRIVATE int bdj_register_methods(JNIEnv *env, const char *class_name, - const JNINativeMethod *methods, int methods_count); - -#endif diff -Nru libbluray-0.5.0/src/libbluray/bdj/build.xml libbluray-0.8.1/src/libbluray/bdj/build.xml --- libbluray-0.5.0/src/libbluray/bdj/build.xml 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/build.xml 2015-01-26 08:01:57.000000000 +0000 @@ -8,6 +8,7 @@ + @@ -19,16 +20,19 @@ description="compile the source " > + source="1.4" target="1.4"> + + + - + - + diff -Nru libbluray-0.5.0/src/libbluray/bdj/common.h libbluray-0.8.1/src/libbluray/bdj/common.h --- libbluray-0.5.0/src/libbluray/bdj/common.h 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/common.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -#ifndef BDJ_COMMON_H_ -#define BDJ_COMMON_H_ - -#define BDJ_JARFILE "libbluray.jar" -#define BDJ_CLASSPATH BDJ_JARFILE -#define BDJ_BDJO_PATH "/BDMV/BDJO" -#define BDJ_JAR_PATH "/BDMV/JAR" - -#define BDJ_ERROR 0 -#define BDJ_SUCCESS 1 - -#include "util/logging.h" - -// input events -#define BDJ_KEY_PRESSED 401 -#define BDJ_KEY_RELEASED 402 - -// key codes -#define BDJ_VK_COLORED_KEY_0 403 -#define BDJ_VK_COLORED_KEY_1 404 -#define BDJ_VK_COLORED_KEY_2 405 -#define BDJ_VK_COLORED_KEY_3 406 -#define BDJ_VK_COLORED_KEY_4 407 -#define BDJ_VK_COLORED_KEY_5 408 - -#define BDJ_VK_LEFT 37 -#define BDJ_VK_UP 38 -#define BDJ_VK_RIGHT 39 -#define BDJ_VK_DOWN 40 - -#define BDJ_VK_0 48 -#define BDJ_VK_1 49 -#define BDJ_VK_2 50 -#define BDJ_VK_3 51 -#define BDJ_VK_4 52 -#define BDJ_VK_5 53 -#define BDJ_VK_6 54 -#define BDJ_VK_7 55 -#define BDJ_VK_8 56 -#define BDJ_VK_9 57 - -#define BDJ_VK_A 65 -#define BDJ_VK_B 66 -#define BDJ_VK_C 67 -#define BDJ_VK_D 68 -#define BDJ_VK_E 69 -#define BDJ_VK_F 70 -#define BDJ_VK_G 71 -#define BDJ_VK_H 72 -#define BDJ_VK_I 73 -#define BDJ_VK_J 74 -#define BDJ_VK_K 75 -#define BDJ_VK_L 76 -#define BDJ_VK_M 77 -#define BDJ_VK_N 78 -#define BDJ_VK_O 79 -#define BDJ_VK_P 80 -#define BDJ_VK_Q 81 -#define BDJ_VK_R 82 -#define BDJ_VK_S 83 -#define BDJ_VK_T 84 -#define BDJ_VK_U 85 -#define BDJ_VK_V 86 -#define BDJ_VK_W 87 -#define BDJ_VK_X 88 -#define BDJ_VK_Y 89 -#define BDJ_VK_Z 90 - -#endif /* BDJ_COMMON_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java libbluray-0.8.1/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java --- libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/com/aacsla/bluray/online/ContentAttribute.java 2015-05-15 09:25:06.000000000 +0000 @@ -27,17 +27,27 @@ } public byte[] getContentCertID() { + FileInputStream is = null; try { - FileInputStream is = new FileInputStream( + is = new FileInputStream( System.getProperty("bluray.vfs.root") + File.separator + "AACS/Content000.cer"); - is.skip(14); + if (is.skip(14) != 14) + return null; byte[] bytes = new byte[6]; - is.read(bytes, 0, 6); - is.close(); + if (is.read(bytes, 0, 6) != 6) + return null; return bytes; - } catch (Throwable e) { + } catch (Exception e) { e.printStackTrace(); return null; + } finally { + if (is != null) { + try { + is.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } } } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/MediaAttribute.java libbluray-0.8.1/src/libbluray/bdj/java/com/aacsla/bluray/online/MediaAttribute.java --- libbluray-0.5.0/src/libbluray/bdj/java/com/aacsla/bluray/online/MediaAttribute.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/com/aacsla/bluray/online/MediaAttribute.java 2015-05-15 09:25:06.000000000 +0000 @@ -30,6 +30,7 @@ byte pmsn[] = Libbluray.getAacsData(Libbluray.AACS_MEDIA_PMSN); if (pmsn == null) { logger.warning("getPMSN() failed"); + return new byte[16]; } return pmsn; } @@ -38,6 +39,7 @@ byte vid[] = Libbluray.getAacsData(Libbluray.AACS_MEDIA_VID); if (vid == null) { logger.warning("getVolumeID() failed"); + return new byte[16]; } return vid; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDFontMetrics.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDFontMetrics.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDFontMetrics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDFontMetrics.java 2015-05-15 09:25:06.000000000 +0000 @@ -19,50 +19,62 @@ package java.awt; -import java.io.*; -import java.security.*; -import java.util.*; +import java.io.File; +import java.lang.ref.WeakReference; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; -public class BDFontMetrics extends FontMetrics { +import org.videolan.Logger; + +public class BDFontMetrics extends sun.font.FontDesignMetrics { static final long serialVersionUID = -4956160226949100590L; private static long ftLib = 0; - private static Map fontNameMap; + private static long fcLib = 0; + private static Map systemFontNameMap = null; + + private static final Logger logger = Logger.getLogger(BDFontMetrics.class.getName()); private static native long initN(); private static native void destroyN(long ftLib); + private static native String[] getFontFamilyAndStyleN(long ftLib, String fontName); - public static void init() { - //System.loadLibrary("bluray"); + protected synchronized static String[] getFontFamilyAndStyle(String fontFile) { + return getFontFamilyAndStyleN(ftLib, fontFile); + } - if (ftLib != 0) - return; + private native static String resolveFontN(String fontFamily, int fontStyle); + private native static void unloadFontConfigN(); - ftLib = initN(); + private static void addSystemFont(String alias, int style, String family, String defaultPath) { - if (ftLib == 0) { - System.err.println("freetype library not loaded"); - throw new AWTError("freetype lib not loaded"); + alias = alias + "." + style; + + /* default to jre fonts, if available */ + if (new File(defaultPath).exists()) { + logger.info("mapping " + alias + " (" + family + ") to " + defaultPath); + systemFontNameMap.put(alias, defaultPath); + return; } - Runtime.getRuntime().addShutdownHook( - new Thread() { - public void run() { - Iterator it = fontMetricsMap.values().iterator(); - while (it.hasNext()) { - try { - BDFontMetrics fm = (BDFontMetrics)it.next(); - it.remove(); - fm.destroy(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - BDFontMetrics.destroyN(BDFontMetrics.ftLib); - } - } - ); + /* try fontconfig */ + String path = resolveFontN(family, style); + if (path != null) { + logger.info("fontconfig: mapping " + alias + " (" + family + ") to " + path); + systemFontNameMap.put(alias, path); + return; + } + logger.error("Can't resolve font " + alias + ": file " + defaultPath + " does not exist"); + /* useless ? font file does not exist ... */ + systemFontNameMap.put(alias, defaultPath); + } + + private static void initSystemFonts() { String javaHome = (String) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return System.getProperty("java.home"); @@ -70,33 +82,60 @@ } ); File f = new File(javaHome, "lib" + File.separator + "fonts"); - String dir = f.getAbsolutePath() + File.separator; + String defaultFontPath = f.getAbsolutePath() + File.separator; - fontNameMap = new HashMap(24); - fontNameMap.put("serif.0", dir + "LucidaBrightRegular.ttf"); - fontNameMap.put("serif.1", dir + "LucidaBrightDemiBold.ttf"); - fontNameMap.put("serif.2", dir + "LucidaBrightItalic.ttf"); - fontNameMap.put("serif.3", dir + "LucidaBrightDemiItalic.ttf"); - fontNameMap.put("sansserif.0", dir + "LucidaSansRegular.ttf"); - fontNameMap.put("sansserif.1", dir + "LucidaSansDemiBold.ttf"); - fontNameMap.put("sansserif.2", dir + "LucidaSansOblique.ttf"); - fontNameMap.put("sansserif.3", dir + "LucidaSansDemiOblique.ttf"); - fontNameMap.put("monospaced.0", dir + "LucidaTypewriterRegular.ttf"); - fontNameMap.put("monospaced.1", dir + "LucidaTypewriterBold.ttf"); - fontNameMap.put("monospaced.2", dir + "LucidaTypewriterOblique.ttf"); - fontNameMap.put("monospaced.3", dir + "LucidaTypewriterBoldOblique.ttf"); - fontNameMap.put("dialog.0", dir + "LucidaSansRegular.ttf"); - fontNameMap.put("dialog.1", dir + "LucidaSansDemiBold.ttf"); - fontNameMap.put("dialog.2", dir + "LucidaSansOblique.ttf"); - fontNameMap.put("dialog.3", dir + "LucidaSansDemiOblique.ttf"); - fontNameMap.put("dialoginput.0", dir + "LucidaTypewriterRegular.ttf"); - fontNameMap.put("dialoginput.1", dir + "LucidaTypewriterBold.ttf"); - fontNameMap.put("dialoginput.2", dir + "LucidaTypewriterOblique.ttf"); - fontNameMap.put("dialoginput.3", dir + "LucidaTypewriterBoldOblique.ttf"); - fontNameMap.put("default.0", dir + "LucidaSansRegular.ttf"); - fontNameMap.put("default.1", dir + "LucidaSansDemiBold.ttf"); - fontNameMap.put("default.2", dir + "LucidaSansOblique.ttf"); - fontNameMap.put("default.3", dir + "LucidaSansDemiOblique.ttf"); + final Object[][] sfd = { + { "serif", "Arial", new String[] {"LucidaBrightRegular.ttf", "LucidaBrightDemiBold.ttf", "LucidaBrightItalic.ttf", "LucidaBrightDemiItalic.ttf"}}, + { "sansserif", "Times New Roman", new String[] {"LucidaSansRegular.ttf", "LucidaSansDemiBold.ttf", "LucidaSansOblique.ttf", "LucidaSansDemiOblique.ttf"}}, + { "monospaced", "Courier New", new String[] {"LucidaTypewriterRegular.ttf", "LucidaTypewriterBold.ttf", "LucidaTypewriterOblique.ttf", "LucidaTypewriterBoldOblique.ttf"}}, + { "dialog", "Times New Roman", new String[] {"LucidaSansRegular.ttf", "LucidaSansDemiBold.ttf", "LucidaSansOblique.ttf", "LucidaSansDemiOblique.ttf"}}, + { "dialoginput", "Courier New", new String[] {"LucidaTypewriterRegular.ttf", "LucidaTypewriterBold.ttf", "LucidaTypewriterOblique.ttf", "LucidaTypewriterBoldOblique.ttf"}}, + { "default", "Times New Roman", new String[] {"LucidaSansRegular.ttf", "LucidaSansDemiBold.ttf", "LucidaSansOblique.ttf", "LucidaSansDemiOblique.ttf"}}, + }; + + systemFontNameMap = new HashMap(24); + + for (int type = 0; type < sfd.length; type++) { + for (int style = 0; style < 4; style++) { + addSystemFont((String)sfd[type][0], style, (String)sfd[type][1], + defaultFontPath + ((String[])sfd[type][2])[style]); + } + } + + unloadFontConfigN(); + } + + public synchronized static void init() { + + if (ftLib == 0) { + ftLib = initN(); + } + if (ftLib == 0) { + logger.error("freetype library not loaded"); + throw new AWTError("freetype lib not loaded"); + } + + if (systemFontNameMap == null) { + initSystemFonts(); + } + } + + public synchronized static void shutdown() { + Iterator it = fontMetricsMap.values().iterator(); + while (it.hasNext()) { + try { + WeakReference ref = (WeakReference)it.next(); + BDFontMetrics fm = (BDFontMetrics)ref.get(); + it.remove(); + if (fm != null) { + fm.destroy(); + } + } catch (Throwable e) { + e.printStackTrace(); + } + } + destroyN(BDFontMetrics.ftLib); + ftLib = 0; } /** A map which maps a native font name and size to a font metrics object. This is used @@ -107,66 +146,71 @@ to ensure native fonts are not loaded twice for the same font. */ static synchronized BDFontMetrics getFontMetrics(Font font) { /* See if metrics has been stored in font already. */ - BDFontMetrics fm = null; - //BDFontMetrics fm = (BDFontMetrics)font.metrics; - //if (fm == null) { + BDFontMetrics fm = (BDFontMetrics)font.metrics; + if (fm == null || fm.ftFace == 0) { /* See if a font metrics of the same native name and size has already been loaded. If it has then we use that one. */ - String nativeName = (String)fontNameMap.get(font.getName().toLowerCase() + "." + font.getStyle()); - if (nativeName == null) - nativeName = (String)fontNameMap.get("default." + font.getStyle()); + String nativeName; + if (font.fontFile != null) { + nativeName = font.fontFile.getPath(); + } else { + nativeName = (String)systemFontNameMap.get(font.getName().toLowerCase() + "." + font.getStyle()); + if (nativeName == null) { + nativeName = (String)systemFontNameMap.get("default." + font.getStyle()); + } + } + String key = nativeName + "." + font.getSize(); - fm = (BDFontMetrics)fontMetricsMap.get(key); - if (fm == null) - fontMetricsMap.put(key, fm = new BDFontMetrics(font, nativeName)); - //font.metrics = fm; - //} + WeakReference ref = (WeakReference)fontMetricsMap.get(key); + if (ref != null) { + fm = (BDFontMetrics)ref.get(); + } + + if (fm == null) { + fm = new BDFontMetrics(font, nativeName); + fontMetricsMap.put(key, new WeakReference(fm)); + } + font.metrics = fm; + } return fm; } - static String[] getFontList() { + static { + sun.font.FontDesignMetrics.setGetFontMetricsAccess( + new sun.font.FontDesignMetrics.GetFontMetricsAccess() { + public sun.font.FontDesignMetrics getFontMetrics(Font font) { + return BDFontMetrics.getFontMetrics(font); + } + }); + } + + static String stripAttributes(String fontname) { + int dotidx; + if ((dotidx = fontname.indexOf('.')) == -1) + return fontname; + return fontname.substring(0, dotidx); + } + + static synchronized String[] getFontList() { init(); ArrayList fontNames = new ArrayList(); - Iterator fonts = fontNameMap.keySet().iterator(); - int dotidx; + Iterator fonts = systemFontNameMap.keySet().iterator(); while (fonts.hasNext()) { - String fontname = (String) fonts.next(); - if ((dotidx = fontname.indexOf('.')) == -1) - dotidx = fontname.length(); - fontname = fontname.substring(0, dotidx); + String fontname = stripAttributes((String)fonts.next()); if (!fontNames.contains(fontname)) fontNames.add(fontname); } - return (String[])fontNames.toArray(new String[fontNames.size()]); - } - - public static void registerFont(String name, int style, String path) { - File f = new File(path); - path = f.getAbsolutePath(); - if (path != null) { - name = name.toLowerCase() + "." + style; - fontNameMap.put(name, path); - } - } - public static boolean registerFont(File f) { - //TODO - org.videolan.Logger.unimplemented("BDFontMetrics", "registerFont"); - return false; - } - - public static void unregisterFont(String name, int style) { - name = name.toLowerCase() + "." + style; - fontNameMap.remove(name); + return (String[])fontNames.toArray(new String[fontNames.size()]); } - long ftFace; - private int ascent; - private int descent; - private int leading; - private int maxAdvance; + private long ftFace = 0; + private int ascent = 0; + private int descent = 0; + private int leading = 0; + private int maxAdvance = 0; /** Cache of first 256 Unicode characters as these map to ASCII characters and are often used. */ private int[] widths; @@ -182,11 +226,7 @@ if (ftFace == 0) throw new AWTError("font face:" + nativeName + " not loaded"); - /* Cache first 256 char widths for use by the getWidths method and for faster metric - calculation as they are commonly used (ASCII) characters. */ - widths = new int[256]; - for (int i = 0; i < 256; i++) - widths[i] = charWidthN(ftFace, (char)i); + widths = null; } private native long loadFontN(long ftLib, String fontName, int size); @@ -195,6 +235,22 @@ private native int stringWidthN(long ftFace, String string); private native int charsWidthN(long ftFace, char chars[], int offset, int len); + private synchronized void loadWidths() { + /* Cache first 256 char widths for use by the getWidths method and for faster metric + calculation as they are commonly used (ASCII) characters. */ + if (widths == null) { + widths = new int[256]; + for (int i = 0; i < 256; i++) { + widths[i] = charWidthN(ftFace, (char)i); + } + } + } + + + protected synchronized void drawString(BDGraphics g, String string, int x, int y, int rgb) { + g.drawStringN(ftFace, string, x, y, rgb); + } + public int getAscent() { return ascent; } @@ -214,23 +270,30 @@ /** * Fast lookup of first 256 chars as these are always the same eg. ASCII charset. */ - public int charWidth(char c) { - if (c < 256) + public synchronized int charWidth(char c) { + if (c < 256) { + loadWidths(); return widths[c]; + } return charWidthN(ftFace, c); } /** * Return the width of the specified string in this Font. */ - public int stringWidth(String string) { - return stringWidthN(ftFace, string); + public synchronized int stringWidth(String string) { + /* Allow only one call at time. + * (calling this function from multiple threads caused crashes in freetype) + */ + synchronized (BDFontMetrics.class) { + return stringWidthN(ftFace, string); + } } /** * Return the width of the specified char[] in this Font. */ - public int charsWidth(char chars[], int offset, int length) { + public synchronized int charsWidth(char chars[], int offset, int length) { return charsWidthN(ftFace, chars, offset, length); } @@ -238,12 +301,13 @@ * Get the widths of the first 256 characters in the font. */ public int[] getWidths() { - int[] newWidths = new int[256]; - System.arraycopy(widths, 0, newWidths, 0, 256); + loadWidths(); + int[] newWidths = new int[widths.length]; + System.arraycopy(widths, 0, newWidths, 0, widths.length); return newWidths; } - public void destroy() { + private void destroy() { if (ftFace != 0) { destroyFontN(ftFace); ftFace = 0; @@ -251,7 +315,12 @@ } protected void finalize() throws Throwable { - destroy(); - super.finalize(); + try { + destroy(); + } catch (Throwable t) { + throw t; + } finally { + super.finalize(); + } } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java 2015-04-10 06:39:25.000000000 +0000 @@ -0,0 +1,1490 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012-2014 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 + * . + */ + +package java.awt; + +import java.lang.reflect.Field; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.awt.image.AreaAveragingScaleFilter; +import java.awt.image.BufferedImage; +import java.awt.image.ImageConsumer; +import java.awt.image.ImageObserver; + +import org.dvb.ui.DVBBufferedImage; + +import sun.awt.ConstrainableGraphics; + +import org.videolan.GUIManager; +import org.videolan.Logger; + +abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphics { + private static final Color DEFAULT_COLOR = Color.BLACK; + private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); + + private int width; + private int height; + private int[] backBuffer; + private Area dirty; + private GraphicsConfiguration gc; + private Color foreground; + protected Color background; + private Font font; + private BDFontMetrics fontMetrics; + private AlphaComposite composite; + + /** The current xor color. If null then we are in paint mode. */ + private Color xorColor; + + /** Translated X, Y offset from native offset. */ + private int originX; + private int originY; + + /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ + private Rectangle actualClip; + + /** The current user clip rectangle or null if no clip has been set. This is stored in the + native coordinate system and not the (possibly) translated Java coordinate system. */ + private Rectangle clip = null; + + /** The rectangle this graphics object has been constrained too. This is stored in the + native coordinate system and not the (possibly) translated Java coordinate system. + If it is null then this graphics has not been constrained. The constrained rectangle + is another layer of clipping independant of the user clip. */ + private Rectangle constrainedRect = null; + + BDGraphicsBase(BDGraphicsBase g) { + backBuffer = g.backBuffer; + dirty = g.dirty; + width = g.width; + height = g.height; + gc = g.gc; + foreground = g.foreground; + background = g.background; + composite = g.composite; + font = g.font; + fontMetrics = g.fontMetrics; + originX = g.originX; + originY = g.originY; + if (g.clip != null) { + clip = new Rectangle(g.clip); + } + setupClip(); + } + + BDGraphicsBase(BDRootWindow window) { + width = window.getWidth(); + height = window.getHeight(); + backBuffer = window.getBdBackBuffer(); + dirty = window.getDirtyArea(); + gc = window.getGraphicsConfiguration(); + foreground = window.getForeground(); + background = window.getBackground(); + font = window.getFont(); + + postInit(); + } + + BDGraphicsBase(BDImage image) { + width = image.getWidth(); + height = image.getHeight(); + backBuffer = image.getBdBackBuffer(); + dirty = image.getDirtyArea(); + + gc = image.getGraphicsConfiguration(); + Component component = image.getComponent(); + if (component != null) { + foreground = component.getForeground(); + background = component.getBackground(); + font = component.getFont(); + } + if (background == null) + background = new Color(0, 0, 0, 0); + + postInit(); + } + + private void postInit() { + if (foreground == null) + foreground = DEFAULT_COLOR; + if (background == null) + background = DEFAULT_COLOR; + + /* if font is not set, use AWT default font from BDJO */ + if (font == null) { + font = GUIManager.getInstance().getDefaultFont(); + if (font == null) { + font = DEFAULT_FONT; + } + } + fontMetrics = null; + + composite = AlphaComposite.SrcOver; + setupClip(); + } + + public Graphics create() { + return new BDGraphics((BDGraphics)this); + } + + public void translate(int x, int y) { + originX += x; + originY += y; + } + + public void setFont(Font font) { + if (font != null && !font.equals(this.font)) { + this.font = font; + fontMetrics = null; + } + } + + public Font getFont() { + return font; + } + + public FontMetrics getFontMetrics() { + if (font != null && fontMetrics == null) { + fontMetrics = BDFontMetrics.getFontMetrics(font); + } + return fontMetrics; + } + + public FontMetrics getFontMetrics(Font font) { + return BDFontMetrics.getFontMetrics(font); + } + + public void setColor(Color c) { + if ((c != null) && (c != foreground)) + foreground = c; + } + + public Color getColor() { + return foreground; + } + + public Composite getComposite() { + return composite; + } + + public GraphicsConfiguration getDeviceConfiguration() { + return gc; + } + + public void setComposite(Composite comp) { + if ((comp != null) && (comp != composite)) { + if (!(comp instanceof AlphaComposite)) + throw new IllegalArgumentException("Only AlphaComposite is supported"); + composite = (AlphaComposite) comp; + } + } + + public void setPaintMode() { + xorColor = null; + composite = AlphaComposite.SrcOver; + } + + public void setXORMode(Color color) { + xorColor = color; + } + + /** Gets the current clipping area. */ + public Rectangle getClipBounds() { + if (clip != null) + return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); + return null; + } + + public void constrain(int x, int y, int w, int h) { + Rectangle rect; + if (constrainedRect != null) + rect = constrainedRect; + else + rect = new Rectangle(0, 0, width, height); + constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); + originX = constrainedRect.x; + originY = constrainedRect.y; + setupClip(); + } + + /** Returns a Shape object representing the clip. */ + public Shape getClip() { + return getClipBounds(); + } + + /** Crops the clipping rectangle. */ + public void clipRect(int x, int y, int w, int h) { + Rectangle rect = new Rectangle(x + originX, y + originY, w, h); + if (clip != null) + clip = clip.intersection(rect); + else + clip = rect; + setupClip(); + } + + /** Sets the clipping rectangle. */ + public void setClip(int x, int y, int w, int h) { + clip = new Rectangle (x + originX, y + originY, w, h); + setupClip(); + } + + /** Sets the clip to a Shape (only Rectangle allowed). */ + public void setClip(Shape clip) { + if (clip == null) { + this.clip = null; + setupClip(); + } else if (clip instanceof Rectangle) { + Rectangle rect = (Rectangle) clip; + setClip(rect.x, rect.y, rect.width, rect.height); + } else + throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); + } + + private void setupClip() { + Rectangle rect; + if (constrainedRect != null) + rect = constrainedRect; + else + rect = new Rectangle(0, 0, width, height); + if (clip != null) + actualClip = clip.intersection(rect); + else + actualClip = rect; + } + + private int alphaBlend(int dest, int src) { + int As = src >>> 24; + if (As == 0) + return dest; + if (As == 255) + return src; + int Ad = (dest >>> 24); + if (Ad == 0) + return src; + int R, G, B; + R = ((src >>> 16) & 255) * As * 255; + G = ((src >>> 8) & 255) * As * 255; + B = (src & 255) * As * 255; + Ad = Ad * (255 - As); + As = As * 255 + Ad; + R = (R + ((dest >>> 16) & 255) * Ad) / As; + G = (G + ((dest >>> 8) & 255) * Ad) / As; + B = (B + (dest & 255) * Ad) / As; + R = Math.min(255, R); + G = Math.min(255, G); + B = Math.min(255, B); + Ad = As / 255; + Ad = Math.min(255, Ad); + return (Ad << 24) | (R << 16) | (G << 8) | B; + } + + private int applyComposite(int rgb) { + return ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); + } + + private void drawSpanN(int x, int y, int length, int rgb) { + + Rectangle rect = new Rectangle(x, y, length, 1); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0 || rect.x < 0 || rect.y < 0) { + return; + } + + x = rect.x; + length = rect.width; + + if (xorColor != null) { + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] ^= xorColor.getRGB() ^ rgb; + } + + dirty.add(rect); + return; + } + + switch (composite.getRule()) { + case AlphaComposite.CLEAR: + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = 0; + } + break; + case AlphaComposite.SRC: + rgb = applyComposite(rgb); + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = rgb; + } + break; + case AlphaComposite.SRC_OVER: + rgb = applyComposite(rgb); + for (int i = 0; i < length; i++) { + backBuffer[y * width + x + i] = alphaBlend(backBuffer[y * width + x + i], rgb); + } + break; + } + + dirty.add(rect); + } + + private void drawSpanN(int x, int y, int length, int src[], int srcOffset, boolean flipX) { + + /* avoid overreading source */ + if (srcOffset + length > src.length) { + length -= srcOffset + length - src.length; + } + /* avoid underreading source */ + if (srcOffset < 0) { + length += srcOffset; + x -= srcOffset; + srcOffset = 0; + } + if (length <= 0) { + return; + } + + Rectangle rect = new Rectangle(x, y, length, 1); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0 || rect.x < 0 || rect.y < 0) { + return; + } + + int dstOffset; + + srcOffset += rect.x - x; + x = rect.x; + length = rect.width; + dstOffset = y * width + x; + + if (xorColor != null) { + + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] ^= xorColor.getRGB() ^ src[srcOffset + i]; + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] ^= xorColor.getRGB() ^ src[srcOffset + i]; + } + } + + dirty.add(rect); + return; + } + + switch (composite.getRule()) { + case AlphaComposite.CLEAR: + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = 0; + } + break; + case AlphaComposite.SRC: + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] = applyComposite(src[srcOffset + i]); + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = applyComposite(src[srcOffset + i]); + } + } + break; + case AlphaComposite.SRC_OVER: + if (flipX) { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + length -1 - i] = alphaBlend(backBuffer[dstOffset + length -1 - i], applyComposite(src[srcOffset + i])); + } + } else { + for (int i = 0; i < length; i++) { + backBuffer[dstOffset + i] = alphaBlend(backBuffer[dstOffset + i], applyComposite(src[srcOffset + i])); + } + } + break; + } + + dirty.add(rect); + } + + private void drawSpan(int x, int y, int length, int rgb) { + x += originX; + y += originY; + drawSpanN(x, y, length, rgb); + } + + private void drawSpan(int x, int y, int length, int src[], int srcOffset, boolean flipX) { + x += originX; + y += originY; + drawSpanN(x, y, length, src, srcOffset, flipX); + } + + private void drawPointN(int x, int y, int rgb) { + drawSpanN(x, y, 1, rgb); + } + + private void drawGlyph(int[] rgbArray, int x0, int y0, int w, int h) { + for (int y = 0; y < h; y++) + for (int x = 0; x < w; x++) + drawPoint(x + x0, y + y0, rgbArray[y * w + x]); + } + + private void drawPoint(int x, int y, int rgb) { + x += originX; + y += originY; + if (actualClip.contains(x, y)) + drawPointN(x, y, rgb); + } + + public void clearRect(int x, int y, int w, int h) { + x += originX; + y += originY; + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + if (rect.isEmpty()) { + return; + } + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + int rgb = background.getRGB(); + for (int i = 0; i < h; i++) + Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); + + dirty.add(rect); + } + + public void fillRect(int x, int y, int w, int h) { + x += originX; + y += originY; + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + int rgb = foreground.getRGB(); + for (int Y = y; Y < (y + h); Y++) + drawSpanN(x, Y, w, rgb); + } + + public void drawRect(int x, int y, int w, int h) { + x += originX; + y += originY; + + drawLineN(x, y, x + w, y); + drawLineN(x, y + h, x + w, y + h); + drawLineN(x, y, x, y + h); + drawLineN(x + w, y, x + w, y + h); + } + + private void drawLineN(int x1, int y1, int x2, int y2) { + int rgb = foreground.getRGB(); + int dy = y2 - y1; + int dx = x2 - x1; + int stepx, stepy; + int fraction; + if (dy < 0) { + dy = -dy; + stepy = -1; + } else { + stepy = 1; + } + if (dx < 0) { + dx = -dx; + stepx = -1; + } else { + stepx = 1; + } + dy <<= 1; + dx <<= 1; + + drawPointN(x1, y1, rgb); + + if (dx > dy) { + fraction = dy - (dx >> 1); + while (x1 != x2) { + if (fraction >= 0) { + y1 += stepy; + fraction -= dx; + } + x1 += stepx; + fraction += dy; + drawPointN(x1, y1, rgb); + } + } else { + fraction = dx - (dy >> 1); + while (y1 != y2) { + if (fraction >= 0) { + x1 += stepx; + fraction -= dy; + } + y1 += stepy; + fraction += dx; + drawPointN(x1, y1, rgb); + } + } + } + + public void drawLine(int x1, int y1, int x2, int y2) { + + x1 += originX; + y1 += originY; + + x2 += originX; + y2 += originY; + + drawLineN(x1, y1, x2, y2); + } + + /** + * Copies an area of the canvas that this graphics context paints to. + * @param X the x-coordinate of the source. + * @param Y the y-coordinate of the source. + * @param W the width. + * @param H the height. + * @param dx the horizontal distance to copy the pixels. + * @param dy the vertical distance to copy the pixels. + */ + public void copyArea(int x, int y, int w, int h, int dx, int dy) { + + x += originX; + y += originY; + + Rectangle rect = new Rectangle(x, y, w, h); + rect = actualClip.intersection(rect); + + if (rect.width <= 0 || rect.height <= 0) { + return; + } + + x = rect.x; + y = rect.y; + w = rect.width; + h = rect.height; + + int subImage[] = new int[w * h]; + + // copy back buffer + for (int i = 0; i < h; i++) { + System.arraycopy(backBuffer, ((y + i) * width) + x, subImage, w * i, w); + } + + // draw sub image + for (int i = 0; i < h; i++) { + drawSpanN(x + dx, y + i + dy, w, subImage, w * i, false); + } + } + + /** Draws lines defined by an array of x points and y points */ + public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { + if (nPoints == 1) { + drawPoint(xPoints[0], yPoints[0], foreground.getRGB()); + } else { + for (int i = 0; i < (nPoints - 1); i++) + drawLine(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); + } + } + + /** Draws a polygon defined by an array of x points and y points */ + public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { + if (nPoints == 1) { + drawPoint(xPoints[0], yPoints[0], foreground.getRGB()); + } else { + for (int i = 0; i < (nPoints - 1); i++) + drawLine(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); + if (nPoints > 2) + drawLine(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); + } + } + + /** Fills a polygon with the current fill mask */ + public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { + + int minY = Integer.MAX_VALUE; + int maxY = Integer.MIN_VALUE; + int colour = foreground.getRGB(); + + if (nPoints < 3) { + return; + } + + for (int i = 0; i < nPoints; i++) { + if (yPoints[i] > maxY) { + maxY = yPoints[i]; + } + if (yPoints[i] < minY) { + minY = yPoints[i]; + } + } + + // check the last point to see if its the same as the first + if (xPoints[0] == xPoints[nPoints - 1] && yPoints[0] == yPoints[nPoints - 1]) { + nPoints--; + } + + PolyEdge[] polyEdges = new PolyEdge[nPoints]; + + for (int i = 0; i < nPoints - 1; i++) { + polyEdges[i] = new PolyEdge(xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1]); + } + + // add the last one + polyEdges[nPoints - 1] = new PolyEdge(xPoints[nPoints - 1], yPoints[nPoints - 1], xPoints[0], yPoints[0]); + ArrayList xList = new ArrayList(); + for (int i = minY; i <= maxY; i++) { + for (int j = 0; j < nPoints; j++) { + if (polyEdges[j].intersects(i)) { + int x = polyEdges[j].intersectionX(i); + xList.add(new Integer(x)); + } + } + + // probably a better way of doing this (removing duplicates); + HashSet hs = new HashSet(); + hs.addAll(xList); + xList.clear(); + xList.addAll(hs); + + if (xList.size() % 2 > 0) { + xList.clear(); + continue; // this should be impossible unless the poly is open somewhere + } + + Collections.sort(xList); + + for (int j = 0; j < xList.size(); j +=2 ) { + int x1 = ((Integer)xList.get(j)).intValue(); + int x2 = ((Integer)xList.get(j + 1)).intValue(); + + drawSpan(x1, i, x2 - x1, colour); + } + + xList.clear(); + } + } + + /** Draws an oval to fit in the given rectangle */ + public void drawOval(int x, int y, int w, int h) { + + int startX; + int endX; + int offset; + int[] xList; + int[] yList; + int numPoints; + int count; + float as; + float bs; + + if (w <= 0 || h <=0 ) { + return; + } + + count = 0; + numPoints = ((h/2) + (h/2) + 1) * 2; + numPoints += 1; // to close + xList = new int[numPoints]; + yList = new int[numPoints]; + + as = (w/2.0f) * (w/2.0f); + bs = (h/2.0f) * (h/2.0f); + + for (int i = -h/2; i <= h/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + w/2; + + xList[count] = startX; + yList[count] = y + i + h/2; + count++; + } + + for (int i = h/2; i >= -h/2; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + endX = x + offset + w/2; + + xList[count] = endX; + yList[count] = y + i + h/2; + count++; + } + + xList[count] = xList[0]; // close the loop + yList[count] = yList[0]; // close the loop + + drawPolyline(xList, yList, numPoints); + } + + /** Fills an oval to fit in the given rectangle */ + public void fillOval(int x, int y, int w, int h) { + + int startX; + int endX; + int offset; + int colour; + float as; + float bs; + + if (w <= 0 || h <= 0) { + return; + } + + as = (w/2.0f) * (w/2.0f); + bs = (h/2.0f) * (h/2.0f); + colour = foreground.getRGB(); + + for(int i=-h/2; i<=h/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + w/2; + endX = x + offset + w/2; + + drawSpan(startX, y + i + h/2, endX - startX + 1, colour); + } + } + + private int getAngle(int centreX, int centreY, int pointX, int pointY) { + + float vStartX; + float vStartY; + float vEndX; + float vEndY; + float length; + double angle; + + vStartX = 1; // vector pointing right (this is where angle starts for arcs) + vStartY = 0; + + vEndX = pointX - centreX; + vEndY = pointY - centreY; + + length = (float) Math.sqrt(vEndX*vEndX + vEndY*vEndY); + + vEndX /= length; + vEndY /= length; + + angle = Math.acos(vStartX*vEndX + vStartY*vEndY); + angle = angle * 180.0 / Math.PI; + + if (vEndY > 0) { + angle = 360 - angle; + } + + return (int)(angle + 0.5); + } + + private void drawArcI(boolean fill, int x, int y, int width, int height, int startAngle, int arcAngle) { + + int endAngle; + int startX; + int endX; + int offset; + int[] xList; + int[] yList; + int count; + int numPoints; + int tempX; + int tempY; + int angle; + int widthDiv2; + int heightDiv2; + float as; + float bs; + boolean addedZero; + boolean circle; + + // sanity checks + if (width <= 0 || height <= 0 || arcAngle == 0) { + return; + } + + // init variables + count = 0; + addedZero = false; + circle = false; + widthDiv2 = (int)(width/2.0f + 0.5f); + heightDiv2 = (int)(height/2.0f + 0.5f); + numPoints = ((height + 1/2) + (height + 1/2) + 1) * 2 + 1; + xList = new int[numPoints]; + yList = new int[numPoints]; + + as = (width/2.0f) * (width/2.0f); + bs = (height/2.0f) * (height/2.0f); + + // check if we actually want to draw a circle + if (Math.abs(arcAngle) >= 360) { + circle = true; + } + + if (startAngle < 0) { + startAngle %= 360; + startAngle = Math.abs(startAngle); + startAngle = 360 - startAngle; + } + + if (arcAngle < 0) { + int temp; + temp = startAngle; + endAngle = startAngle; + startAngle = 360 + arcAngle + temp; + } else { + endAngle = startAngle + arcAngle; + } + + startAngle %= 360; + endAngle %= 360; + + for (int i = heightDiv2; i >= -heightDiv2; i--) { + boolean hit = false; + int offsetAngle; + int startXAngle; + + offset = (int) Math.sqrt( (1.0 - i*i/bs) * as ); + startX = x + offset + widthDiv2; + + offsetAngle = (int) Math.sqrt( (1.0 - i*i/bs) * bs ); // we calculate these as if it were a circle + startXAngle = x + offsetAngle + height/2; + + tempX = startX; + tempY = y + i + height/2; + + angle = getAngle(x + height/2, y + height/2, startXAngle, tempY); + + if (startAngle < endAngle) { + if (angle < endAngle && angle >= startAngle) { + xList[count] = tempX; + yList[count] = tempY; + count++; + hit = true; + } + } else { + if (!(angle > endAngle && angle < startAngle)) { + xList[count] = tempX; + yList[count] = tempY; + count++; + hit = true; + } + } + + if (!hit && !addedZero && !circle && fill) { + xList[count] = x + width/2; + yList[count] = y + height/2; + count++; + addedZero = true; + } + + if (!hit && !fill && !circle && count > 1) { + drawPolyline(xList, yList, count); + count = 0; + } + } + + + for (int i = -heightDiv2; i <= heightDiv2; i++) { + boolean hit = false; + int offsetAngle; + int endXAngle; + + offset = (int) Math.sqrt( (1.0 - i*i/bs) * as ); + endX = x - offset + width/2; + + offsetAngle = (int) Math.sqrt( (1.0 - i*i/bs) * bs ); // we calculate these as if it were a circle + endXAngle = x - offsetAngle + height/2; + + tempX = endX; + tempY = y + i + height/2; + + angle = getAngle(x + height/2, y + height/2, endXAngle, tempY); + + if (startAngle < endAngle) { + if (angle <= endAngle && angle >= startAngle) { + xList[count] = tempX; + yList[count] = tempY; + count++; + hit = true; + } + } else { + if (!(angle > endAngle && angle < startAngle)) { + xList[count] = tempX; + yList[count] = tempY; + count++; + hit = true; + } + } + + if (!hit && !addedZero && !circle && fill) { + xList[count] = x + width/2; + yList[count] = y + height/2; + count++; + addedZero = true; + } + + if (!hit && !fill && !circle && count > 1) { + drawPolyline(xList, yList, count); + count = 0; + } + } + + if (fill) { + fillPolygon(xList, yList, count); + } else { + if (circle) { + drawPolygon(xList, yList, count); // we need to connect start to end in the case of 360 + } else { + drawPolyline(xList, yList, count); // shape must be open so no connection + } + } + } + + + /** + * Draws an arc bounded by the given rectangle from startAngle to + * endAngle. 0 degrees is a vertical line straight up from the + * center of the rectangle. Positive start angle indicate clockwise + * rotations, negative angle are counter-clockwise. + */ + public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { + drawArcI(false, x, y, w, h, startAngle, endAngle); + } + + /** fills an arc. arguments are the same as drawArc. */ + public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { + drawArcI(true, x, y, w, h, startAngle, endAngle); + } + + /** Draws a rounded rectangle. */ + public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { + + int[] xList; + int[] yList; + int numPoints; + int count; + int startX; + int endX; + int offset; + + if (w <= 0 || h <= 0) { + return; + } + + if (arcWidth == 0 || arcHeight == 0) { + drawRect(x, y, w, h); + return; + } + + if (arcWidth < 0) { // matches behaviour of normal java version + arcWidth *= -1; + } + + if (arcHeight < 0) { + arcHeight *= -1; + } + + count = 0; + numPoints = ((arcHeight/2) + 1) * 2; + numPoints += ((arcHeight/2) + 1) * 2; + numPoints += 1; // last point to close the loop + + xList = new int[numPoints]; + yList = new int[numPoints]; + + float as = (arcWidth/2.0f) * (arcWidth/2.0f); + float bs = (arcHeight/2.0f) * (arcHeight/2.0f); + + // draw top curved half of box + + for (int i = 0; -arcHeight/2 <= i; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + + xList[count] = startX; + yList[count] = y+i+(arcHeight/2); + count++; + } + + for (int i = -arcHeight / 2; i <= 0; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + endX = x + offset + (w-arcWidth) + arcWidth/2; + + xList[count] = endX; + yList[count] = y + i + (arcHeight/2); + count++; + } + + // draw bottom box + for (int i = 0; i <= arcHeight / 2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + xList[count] = endX; + yList[count] = y + i + h - arcHeight/2; + count++; + } + + // draw bottom box + for (int i = arcHeight / 2; i >= 0; i--) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w-arcWidth) + arcWidth/2; + + xList[count] = startX; + yList[count] = y+i+h-arcHeight/2; + count++; + } + + xList[count] = xList[0]; + yList[count] = yList[0]; + + drawPolyline(xList, yList, numPoints); + } + + /** Draws a filled rounded rectangle. */ + public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { + + int startX; + int endX; + int offset; + int colour; + + if (w <= 0 || h <= 0) { + return; + } + + if (arcWidth == 0 || arcHeight == 0) { + fillRect(x,y,w,h); + return; + } + + if (arcWidth < 0) { // matches behaviour of normal java version + arcWidth *= -1; + } + + if (arcHeight < 0) { + arcHeight *= -1; + } + + float as = (arcWidth/2.0f) * (arcWidth/2.0f); + float bs = (arcHeight/2.0f) * (arcHeight/2.0f); + + colour = foreground.getRGB(); + + // draw top curved half of box + for (int i = -arcHeight/2; i < 0; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + drawSpan(startX, y + i + (arcHeight/2), endX - startX + 1, colour); + } + + // draw middle section + for (int i = 0; i < h - arcHeight; i++) { + drawSpan(x, y + i + arcHeight/2, w, colour); + } + + // draw bottom box + for (int i = 0; i <= arcHeight/2; i++) { + offset = (int) Math.sqrt( (1.0 - ((i*i)/bs)) * as ); + startX = x - offset + arcWidth/2; + endX = x + offset + (w - arcWidth) + arcWidth/2; + + drawSpan(startX, y + i + h - 1 - arcHeight/2, endX - startX + 1, colour); + } + } + + protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); + + /** Draws the given string. */ + public void drawString(String string, int x, int y) { + getFontMetrics(); + if (fontMetrics != null) { + fontMetrics.drawString((BDGraphics)this, string, x, y, foreground.getRGB()); + } else { + logger.error("drawString skipped: no font metrics. string=\"" + string + "\""); + } + } + + /** Draws the given character array. */ + public void drawChars(char chars[], int offset, int length, int x, int y) { + drawString(new String(chars, offset, length), x, y); + } + + public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { + logger.unimplemented("drawString"); + } + + /** + * Draws an image at x,y in nonblocking mode with a callback object. + */ + public boolean drawImage(Image img, int x, int y, ImageObserver observer) { + return drawImage(img, x, y, null, observer); + } + + /** + * Draws an image at x,y in nonblocking mode with a solid background + * color and a callback object. + */ + public boolean drawImage(Image img, int x, int y, Color bg, + ImageObserver observer) { + return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, false, false, bg, observer); + } + + /** + * Draws an image scaled to x,y,w,h in nonblocking mode with a + * callback object. + */ + public boolean drawImage(Image img, int x, int y, int w, int h, + ImageObserver observer) { + return drawImage(img, x, y, w, h, null, observer); + } + + /** + * Draws an image scaled to x,y,w,h in nonblocking mode with a + * solid background color and a callback object. + */ + public boolean drawImage(Image img, int x, int y, int w, int h, + Color bg, ImageObserver observer) { + return drawImageN(img, x, y, w, h, 0, 0, -1, -1, false, false, bg, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle + * in nonblocking mode with a callback object. + */ + public boolean drawImage(Image img, + int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, + ImageObserver observer) { + return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle in + * nonblocking mode with a solid background color and a callback object. + */ + public boolean drawImage(Image img, + int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, + Color bg, ImageObserver observer) { + + boolean flipX = false; + boolean flipY = false; + + if (dx1 > dx2) { + int swap = dx1; + dx1 = dx2; + dx2 = swap; + flipX = !flipX; + } + + if (dy1 > dy2) { + int swap = dy1; + dy1 = dy2; + dy2 = swap; + flipY = !flipY; + } + + if (sx1 > sx2) { + int swap = sx1; + sx1 = sx2; + sx2 = swap; + flipX = !flipX; + } + + if (sy1 > sy2) { + int swap = sy1; + sy1 = sy2; + sy2 = swap; + flipY = !flipY; + } + + return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, + sx1, sy1, sx2 - sx1, sy2 - sy1, + flipX, flipY, bg, observer); + } + + /** + * Draws a subrectangle of an image scaled to a destination rectangle in + * nonblocking mode with a solid background color and a callback object. + */ + protected boolean drawImageN(Image img, + int dx, int dy, int dw, int dh, + int sx, int sy, int sw, int sh, + boolean flipX, boolean flipY, + Color bg, ImageObserver observer) { + + if ((sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) + return false; + + BDImage bdImage; + if (img instanceof BDImage) { + bdImage = (BDImage)img; + } else if (img instanceof DVBBufferedImage) { + bdImage = (BDImage)getBufferedImagePeer( + (BufferedImage)(((DVBBufferedImage)img).getImage())); + } else if (img instanceof BufferedImage) { + bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); + } else { + logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); + return false; + } + + if (bdImage instanceof BDImageConsumer) { + BDImageConsumer consumer = (BDImageConsumer)bdImage; + if (!consumer.isComplete(observer)) { + return false; + } + } + + if (sw < 0) sw = bdImage.width; + if (sh < 0) sh = bdImage.height; + if (dw < 0) dw = bdImage.width; + if (dh < 0) dh = bdImage.height; + + int stride = bdImage.width; + int[] rgbArray = bdImage.getBdBackBuffer(); + int bgColor = 0; + + if (bg != null) { + bgColor = bg.getRGB(); + } + + // draw background colour + for (int i = 0; i < dh && bg != null; i++) { + drawSpan(dx, dy + i, dw, bgColor); + } + + // resize if needed + if (dw != sw || dh != sh) { + drawResizeBilinear(rgbArray, (sy * stride) + sx, stride, sw, sh, + dx, dy, dw, dh, flipX, flipY); + return true; + } + + // draw actual colour array + if (flipY) { + for (int i = 0; i < dh; i++) { + drawSpan(dx, dy + dh - 1 - i, dw, rgbArray, (stride * (i + sy)) + sx, flipX); + } + } else { + for (int i = 0; i < dh; i++) { + drawSpan(dx, dy + i, dw, rgbArray, (stride * (i + sy)) + sx, flipX); + } + } + + return true; + } + + /** + * Bilinear resize ARGB image. + * + * @param pixels Source image pixels. + * @param sw Source image width. + * @param sh Source image height. + * @param dw New width. + * @param dh New height. + * @return New array with size dw * dh. + */ + private int[] tmpLine = null; + private void drawResizeBilinear(int[] pixels, int offset, int scansize, int sw, int sh, + int dx, int dy, int dw, int dh, boolean flipX, boolean flipY) { + + if (sh == 1) { + // crop source width if needed for 1d arrays + if (offset + sw > pixels.length) { + sw = (pixels.length - offset); + } + } else { + // crop source height to prevent possible over reads + if (offset + (scansize*sh) > pixels.length) { + sh = (pixels.length - offset) / scansize; + } + } + if (sw < 1 || sh < 1 || pixels.length < 1) { + return; + } + + if (sw == 1 && sh == 1) { + for (int Y = dy; Y < (dy + dh); Y++) + drawSpan(dx, Y, dw, pixels[offset]); + return; + } + + // a quick hack for 1D arrays, stretch them to make them 2D + if (sw == 1) { + int[] temp = new int[2 * sh]; + + for (int i = 0; i < sw * sh; i++) { + temp[(i * 2) + 0] = pixels[offset + i]; + temp[(i * 2) + 1] = pixels[offset + i]; + } + + scansize = 2; + pixels = temp; + offset = 0; + sw = 2; + + } else if (sh == 1) { + int[] temp = new int[sw * 2]; + + System.arraycopy(pixels, offset, temp, 0, sw); + System.arraycopy(pixels, offset, temp, sw, sw); + + scansize = sw; + pixels = temp; + offset = 0; + sh = 2; + } + + if (tmpLine == null || tmpLine.length < dw + 1) { + tmpLine = new int[Math.max(1920, dw + 1)]; + } + + int a, b, c, d, x, y, index; + float x_ratio = ((float)(sw - 1)) / dw; + float y_ratio = ((float)(sh - 1)) / dh; + float x_diff, y_diff, blue, red, green, alpha; + int position = 0; + for (int i = 0; i < dh; i++) { + for (int j = 0; j < dw; j++) { + x = (int)(x_ratio * j); + y = (int)(y_ratio * i); + x_diff = (x_ratio * j) - x; + y_diff = (y_ratio * i) - y; + index = (y * scansize + x); + index += offset; + + a = pixels[index]; + b = pixels[index + 1]; + c = pixels[index + scansize]; + d = pixels[index + scansize + 1]; + + int aA = a >>> 24; + int bA = b >>> 24; + int cA = c >>> 24; + int dA = d >>> 24; + + if (aA + bA + cA + dA < 1) { + tmpLine[position++] = 0; + continue; + } + + /* calculate areas, weighted with alpha */ + float aFactor = (1-x_diff) * (1-y_diff) * aA; + float bFactor = x_diff * (1-y_diff) * bA; + float cFactor = (1-x_diff) * y_diff * cA; + float dFactor = x_diff * y_diff * dA; + + // alpha element + // Yr = Ar(1-w)(1-h) + Br(w)(1-h) + Cr(h)(1-w) + Dr(wh) + alpha = aFactor + bFactor + cFactor + dFactor; + + // blue element + // Yb = Ab(1-w)(1-h) + Bb(w)(1-h) + Cb(h)(1-w) + Db(wh) + blue = (a & 0xff) * aFactor + + (b & 0xff) * bFactor + + (c & 0xff) * cFactor + + (d & 0xff) * dFactor; + + // green element + // Yg = Ag(1-w)(1-h) + Bg(w)(1-h) + Cg(h)(1-w) + Dg(wh) + green = ((a >> 8) & 0xff) * aFactor + + ((b >> 8) & 0xff) * bFactor + + ((c >> 8) & 0xff) * cFactor + + ((d >> 8) & 0xff) * dFactor; + + // red element + // Yr = Ar(1-w)(1-h) + Br(w)(1-h) + Cr(h)(1-w) + Dr(wh) + red = ((a >> 16) & 0xff) * aFactor + + ((b >> 16) & 0xff) * bFactor + + ((c >> 16) & 0xff) * cFactor + + ((d >> 16) & 0xff) * dFactor; + + blue /= alpha; + green /= alpha; + red /= alpha; + + tmpLine[position++] = + ((((int)alpha) << 24) & 0xff000000) | + ((((int)red ) << 16) & 0x00ff0000) | + ((((int)green) << 8 ) & 0x0000ff00) | + ((((int)blue ) ) & 0x000000ff); + } + + if (flipY) { + drawSpan(dx, dy + dh - 1 - i, dw, tmpLine, 0, flipX); + } else { + drawSpan(dx, dy + i, dw, tmpLine, 0, flipX); + } + + position = 0; + } + } + + public Stroke getStroke() { + logger.unimplemented("getStroke"); + throw new Error(); + } + + public void setStroke(Stroke stroke) { + logger.unimplemented("setStroke"); + } + + public void dispose() { + tmpLine = null; + font = null; + fontMetrics = null; + gc = null; + backBuffer = null; + } + + public String toString() { + return getClass().getName() + "[" + originX + "," + originY + "]"; + } + + private static Image getBufferedImagePeer(BufferedImage image) { + try { + return (Image)bufferedImagePeer.get(image); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return null; + } + + private static Field bufferedImagePeer; + + static { + try { + Class c = Class.forName("java.awt.image.BufferedImage"); + bufferedImagePeer = c.getDeclaredField("peer"); + bufferedImagePeer.setAccessible(true); + } catch (ClassNotFoundException e) { + throw new AWTError("java.awt.image.BufferedImage not found"); + } catch (SecurityException e) { + throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); + } catch (NoSuchFieldException e) { + throw new AWTError("java.awt.image.BufferedImage.peer not found"); + } + } + + private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDGraphicsConfigurationBase.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * 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 + * . + */ + +package java.awt; + +import java.awt.color.ColorSpace; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.DataBuffer; +import java.awt.image.DirectColorModel; +import java.awt.image.VolatileImage; + +abstract class BDGraphicsConfigurationBase extends GraphicsConfiguration { + private BDGraphicsDevice device; + + BDGraphicsConfigurationBase(BDGraphicsDevice device) { + this.device = device; + } + + public GraphicsDevice getDevice() { + return device; + } + + public Rectangle getBounds() { + return device.getBounds(); + } + + int getCompatibleImageType() { + return BufferedImage.TYPE_INT_ARGB; + } + + public synchronized ColorModel getColorModel() { + return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), + 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, + DataBuffer.TYPE_INT); + } + + public BufferedImage createCompatibleImage(int width, int height) { + if (width <= 0 || height <= 0) + return null; + return BDImage.getBuffededImage(width, height, this); + } + + public BufferedImage createCompatibleImage(int width, int height, int trans) { + if (width <= 0 || height <= 0) + return null; + return BDImage.getBuffededImage(width, height, this); + } + + public VolatileImage createCompatibleVolatileImage(int width, int height) { + org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); + return null; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageBase.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDImageBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageBase.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDImageBase.java 2015-02-28 16:45:26.000000000 +0000 @@ -21,6 +21,8 @@ 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; @@ -46,9 +48,16 @@ static { try { - Class c = Class.forName("java.awt.image.BufferedImage"); - bufferedImageConstructor = c.getDeclaredConstructors()[0]; - bufferedImageConstructor.setAccessible(true); + 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"); } @@ -142,16 +151,16 @@ return component; } - public int[] getBdBackBuffer() { + protected int[] getBdBackBuffer() { return backBuffer; } - public int[] getBackBuffer() { + protected int[] getBackBuffer() { System.err.println("**** BDIMAGE GETBACKBUFFER ****"); return backBuffer; } - public Area getDirtyArea() { + protected Area getDirtyArea() { return dirty; } @@ -218,7 +227,7 @@ return rgbArray; } - public synchronized void setRGB(int x, int y, int rgb) { + public void setRGB(int x, int y, int rgb) { backBuffer[y * width + x] = rgb; dirty.add(x, y); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageConsumer.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDImageConsumer.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDImageConsumer.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDImageConsumer.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,6 @@ package java.awt; -import java.awt.*; import java.util.Hashtable; import java.awt.image.ImageProducer; import java.awt.image.ImageObserver; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDJHelper.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDJHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDJHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDJHelper.java 2015-05-15 09:25:06.000000000 +0000 @@ -78,9 +78,13 @@ event = new KeyEvent(focusOwner, id, when, modifiers, KeyEvent.VK_UNDEFINED, (char)keyCode); else event = new KeyEvent(focusOwner, id, when, modifiers, keyCode, KeyEvent.CHAR_UNDEFINED); - BDToolkit.getEventQueue(focusOwner).postEvent(event); - return true; - } catch (Throwable e) { + + EventQueue eq = BDToolkit.getEventQueue(focusOwner); + if (eq != null) { + eq.postEvent(event); + return true; + } + } catch (Exception e) { org.videolan.Logger.getLogger("BDJHelper").error("postKeyEvent failed: " + e); } } else { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDOffScreenImageSource.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDOffScreenImageSource.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDOffScreenImageSource.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDOffScreenImageSource.java 2015-01-26 08:01:57.000000000 +0000 @@ -20,7 +20,6 @@ package java.awt; import java.util.Hashtable; -import java.awt.Component; import java.awt.color.ColorSpace; import java.awt.image.ColorModel; import java.awt.image.DataBuffer; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDRootWindow.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDRootWindow.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDRootWindow.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDRootWindow.java 2015-04-15 08:30:17.000000000 +0000 @@ -39,6 +39,25 @@ return dirty; } + public Font getDefaultFont() { + return defaultFont; + } + + public void setDefaultFont(String fontId) { + if (fontId == null || fontId.equals("*****")) { + defaultFont = null; + } else { + try { + defaultFont = (new org.dvb.ui.FontFactory()).createFont(fontId); + } catch (Exception ex) { + logger.error("Failed setting default font " + fontId + ".otf: " + ex); + } + } + logger.info("setting default font to " + fontId + ".otf (" + defaultFont + ")"); + setFont(defaultFont); + } + + public void setBounds(int x, int y, int width, int height) { if (!isVisible()) { if ((width > 0) && (height > 0)) { @@ -48,6 +67,8 @@ } } super.setBounds(x, y, width, height); + } else if (width != getWidth() || height != getHeight()){ + logger.error("setBounds(" + x + "," + y + "," + width + "," + height + ") FAILED: already visible"); } } @@ -140,11 +161,13 @@ /* called when new title starts (window is "created" again) */ public void clearOverlay() { - if (overlay_open) { - logger.error("clearOverlay() ignored (overlay is visible)"); - } else { - Arrays.fill(backBuffer, 0); - dirty.clear(); + synchronized (this) { + if (overlay_open) { + logger.error("clearOverlay() ignored (overlay is visible)"); + } else { + Arrays.fill(backBuffer, 0); + dirty.clear(); + } } } @@ -168,6 +191,8 @@ BDToolkit.setFocusedWindow(null); super.dispose(); + + backBuffer = null; } private int[] backBuffer = null; @@ -176,6 +201,7 @@ private Timer timer = new Timer(); private TimerTask timerTask = null; private boolean overlay_open = false; + private Font defaultFont = null; private static final Logger logger = Logger.getLogger(BDRootWindow.class.getName()); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDToolkitBase.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDToolkitBase.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDToolkitBase.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDToolkitBase.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 Petri Hintukainen + * + * 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 + * . + */ + +package java.awt; + +import java.awt.image.ColorModel; +import java.awt.image.ImageObserver; +import java.awt.image.ImageProducer; +import java.io.File; +import java.net.URL; +import java.util.Collections; +import java.util.Hashtable; +import java.util.WeakHashMap; +import java.util.Map; +import java.util.Iterator; + +import sun.awt.image.ByteArrayImageSource; +import sun.awt.image.FileImageSource; +import sun.awt.image.URLImageSource; + +import org.videolan.BDJXletContext; +import org.videolan.Logger; + +abstract class BDToolkitBase extends Toolkit { + private EventQueue eventQueue = new EventQueue(); + private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); + private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); + private static Hashtable cachedImages = new Hashtable(); + private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); + + // mapping of Components to AppContexts, WeakHashMap + private static final Map contextMap = Collections.synchronizedMap(new WeakHashMap()); + + + public BDToolkitBase () { + } + + public static void setFocusedWindow(Window window) { + } + + public static void shutdownDisc() { + try { + Toolkit toolkit = getDefaultToolkit(); + if (toolkit instanceof BDToolkit) { + ((BDToolkit)toolkit).shutdown(); + } + } catch (Throwable t) { + logger.error("shutdownDisc() failed: " + t + "\n" + Logger.dumpStack(t)); + } + } + + protected void shutdown() { + /* + if (eventQueue != null) { + BDJHelper.stopEventQueue(eventQueue); + eventQueue = null; + } + */ + cachedImages.clear(); + contextMap.clear(); + } + + public Dimension getScreenSize() { + Rectangle dims = defaultGC.getBounds(); + return new Dimension(dims.width, dims.height); + } + + Graphics getGraphics(Window window) { + if (!(window instanceof BDRootWindow)) { + logger.error("getGraphics(): not BDRootWindow"); + throw new Error("Not implemented"); + } + return new BDWindowGraphics((BDRootWindow)window); + } + + GraphicsEnvironment getLocalGraphicsEnvironment() { + return localEnv; + } + + public int getScreenResolution() { + return 72; + } + + public ColorModel getColorModel() { + return defaultGC.getColorModel(); + } + + public String[] getFontList() { + return BDFontMetrics.getFontList(); + } + + public FontMetrics getFontMetrics(Font font) { + return BDFontMetrics.getFontMetrics(font); + } + + static void clearCache(BDImage image) { + synchronized (cachedImages) { + Iterator i = cachedImages.entrySet().iterator(); + while (i.hasNext()) { + Map.Entry entry = (Map.Entry) i.next(); + if (entry.getValue() == image) { + i.remove(); + return; + } + } + } + } + + public Image getImage(String filename) { + if (cachedImages.containsKey(filename)) + return (Image)cachedImages.get(filename); + Image newImage = createImage(filename); + if (newImage != null) + cachedImages.put(filename, newImage); + return newImage; + } + + public Image getImage(URL url) { + if (cachedImages.containsKey(url)) + return (Image)cachedImages.get(url); + Image newImage = createImage(url); + if (newImage != null) + cachedImages.put(url, newImage); + return newImage; + } + + public Image createImage(String filename) { + if (!new File(filename).isAbsolute()) { + String home = BDJXletContext.getCurrentXletHome(); + if (home != null) { + String homeFile = home + filename; + if (new File(homeFile).exists()) { + logger.warning("resource translated to " + homeFile); + filename = homeFile; + } else { + logger.error("resource " + homeFile + " does not exist"); + } + } + } + + ImageProducer ip = new FileImageSource(filename); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(URL url) { + ImageProducer ip = new URLImageSource(url); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(byte[] imagedata, + int imageoffset, + int imagelength) { + ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); + Image newImage = createImage(ip); + return newImage; + } + + public Image createImage(ImageProducer producer) { + return new BDImageConsumer(producer); + } + + public Image createImage(Component component, int width, int height) { + return new BDImage(component, width, height, defaultGC); + } + + public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { + if (!(image instanceof BDImageConsumer)) + return true; + BDImageConsumer img = (BDImageConsumer)image; + return img.prepareImage(observer); + } + + public int checkImage(Image image, int width, int height, + ImageObserver observer) { + if (!(image instanceof BDImageConsumer)) { + return ImageObserver.ALLBITS; + } + BDImageConsumer img = (BDImageConsumer)image; + return img.checkImage(observer); + } + + public void beep() { + } + + public static void addComponent(Component component) { + + BDJXletContext context = BDJXletContext.getCurrentContext(); + if (context == null) { + logger.warning("addComponent() outside of app context"); + return; + } + contextMap.put(component, context); + } + + public static EventQueue getEventQueue(Component component) { + if (component != null) { + do { + BDJXletContext ctx = (BDJXletContext)contextMap.get(component); + if (ctx != null) { + EventQueue eq = ctx.getEventQueue(); + if (eq == null) { + logger.warning("getEventQueue() failed: no context event queue"); + } + return eq; + } + + component = component.getParent(); + } while (component != null); + + logger.warning("getEventQueue() failed: no context"); + return null; + } + + logger.warning("getEventQueue() failed: no component"); + return null; + } + + protected EventQueue getSystemEventQueueImpl() { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx != null) { + EventQueue eq = ctx.getEventQueue(); + if (eq != null) { + return eq; + } + } + + logger.warning("getSystemEventQueue(): no context"); + return eventQueue; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/BDWindowGraphics.java 2015-01-26 08:01:57.000000000 +0000 @@ -136,7 +136,7 @@ } } - public void drawStringN(long ftFace, String string, int x, int y, int rgb) { + protected void drawStringN(long ftFace, String string, int x, int y, int rgb) { synchronized (window) { super.drawStringN(ftFace, string, x, y, rgb); window.notifyChanged(); @@ -151,11 +151,13 @@ public boolean drawImageN(Image img, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh, + boolean flipX, boolean flipY, Color bg, ImageObserver observer) { synchronized (window) { boolean complete = super.drawImageN( img, dx, dy, dw, dh, sx, sy, sw, sh, + flipX, flipY, bg, observer); if (complete) { window.notifyChanged(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/Font.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/Font.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/Font.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/Font.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,280 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package java.awt; + +import java.io.File; +import java.util.Hashtable; +import java.util.Map; +import java.awt.font.TextAttribute; +import java.text.AttributedCharacterIterator.Attribute; + +public class Font implements java.io.Serializable { + + /* + * Java ME 1.4 compatible Font class + * + * https://docs.oracle.com/javame/config/cdc/ref-impl/pbp1.1.2/jsr217/ + */ + + public static final int PLAIN = 0; + public static final int BOLD = 1; + public static final int ITALIC = 2; + + protected String name; + protected int style; + protected int size; + + public Font(String name, int style, int size) { + this(name, style, size, null, null); + } + + public Font(Map attributes) { + this.name = "Default"; + this.style = PLAIN; + this.size = 12; + + org.videolan.Logger.unimplemented("Font", "Font(Map)"); + + setFamily(); + } + + public static Font decode(String str) { + + if (str == null) { + return new Font("Dialog", PLAIN, 12); + } + + org.videolan.Logger.unimplemented("Font", "decode"); + + return new Font("Dialog", PLAIN, 12); + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof Font)) { + return false; + } + Font font = (Font)obj; + if (size != font.size || style != font.style || !name.equals(font.name)) { + return false; + } + if (fontFile != null && font.fontFile != null && + !fontFile.equals(font.fontFile)) { + return false; + } + return true; + } + + public Attribute[] getAvailableAttributes() { + Attribute attributes[] = { + TextAttribute.FAMILY, + TextAttribute.WEIGHT, + TextAttribute.POSTURE, + TextAttribute.SIZE, + }; + return attributes; + } + + public Map getAttributes() { + Hashtable map = new Hashtable(); + map.put(TextAttribute.FAMILY, name); + map.put(TextAttribute.SIZE, new Float(size)); + map.put(TextAttribute.WEIGHT, (style & BOLD) != 0 ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR); + map.put(TextAttribute.POSTURE, (style & ITALIC) != 0 ? TextAttribute.POSTURE_OBLIQUE : TextAttribute.POSTURE_REGULAR); + return (Map)map; + } + + public String getFamily() { + return family; + } + + public static Font getFont(Map attributes) { + Font font = (Font)attributes.get(TextAttribute.FONT); + if (font != null) { + return font; + } + return new Font(attributes); + } + + public static Font getFont(String nm) { + return getFont(nm, null); + } + + public static Font getFont(String nm, Font font) { + String str = System.getProperty(nm); + if (str == null) { + return font; + } + return decode(str); + } + + public String getName() { + return name; + } + + public int getSize() { + return size; + } + + public int getStyle() { + return style; + } + + public int hashCode() { + return name.hashCode() ^ style ^ size; + } + + public boolean isBold() { + return (style & BOLD) != 0; + } + + public boolean isItalic() { + return (style & ITALIC) != 0; + } + + public boolean isPlain() { + return style == 0; + } + + public String toString() { + String strStyle[] = { "plain", "bold", "italic", "bolditalic" }; + return getClass().getName() + "[family=" + getFamily() + ",name=" + name + ",style=" + strStyle[style] + ",size=" + size + "]"; + } + + /* + * libbluray implementation-specific extensions + */ + + transient FontMetrics metrics = null; + private transient String family = null; + protected transient File fontFile = null; + + public static final int TRUETYPE_FONT = 0; + + /* used by org.dvb.ui.FontFacrtory */ + public static Font createFont(int type, File fontFile) throws FontFormatException { + if (type != TRUETYPE_FONT) { + throw new FontFormatException("unsupported font format"); + } + + if (fontFile == null) { + throw new NullPointerException("fontFile is null"); + } + + String data[] = BDFontMetrics.getFontFamilyAndStyle(fontFile.getPath()); + if (data == null || data.length < 2) { + throw new FontFormatException("error loading font " + fontFile.getPath()); + } + + String family = data[0]; + int style = parseStyle(data[1]); + + return new Font(family, style, 1, fontFile, family); + } + + /* used by org.dvb.ui.FontFacrtory */ + public Font deriveFont(int style, int size) { + return new Font(name, style, size, fontFile, family); + } + + /* constructor */ + private Font(String name, int style, int size, File fontFile, String family) { + this.name = (name != null) ? name : "Default"; + this.style = (style & ~0x03) == 0 ? style : 0; + this.size = size; + this.fontFile = fontFile; + this.family = family; + if (family == null) { + setFamily(); + } + } + + /* + * private + */ + + private static final long serialVersionUID = -4206021311591459213L; /* JDK 1.1 serialVersionUID */ + + private void writeObject(java.io.ObjectOutputStream s) + throws java.lang.ClassNotFoundException, java.io.IOException { + s.defaultWriteObject(); + } + + private void readObject(java.io.ObjectInputStream s) + throws java.lang.ClassNotFoundException, java.io.IOException { + s.defaultReadObject(); + setFamily(); + } + + private static int parseStyle(String styleName) { + int style = PLAIN; + + if (styleName != null && styleName.length() > 0) { + String[] styles = org.videolan.StrUtil.split(styleName, ' '); + if (styles.length == 1) { + styles = org.videolan.StrUtil.split(styles[0], ','); + } + + for (int i = 0; i < styles.length; i++) { + styleName = styles[i].toLowerCase(); + if (styleName.equals("bolditalic")) { + style |= BOLD | ITALIC; + } else if (styleName.equals("italic")) { + style |= ITALIC; + } else if (styleName.equals("bold")) { + style |= BOLD; + } else if (styleName.equals("plain")) { + } else if (styleName.equals("serif")) { + } else if (styleName.equals("regular")) { + } else if (styleName.equals("roman")) { + } else { + org.videolan.Logger.getLogger("Font").info("unregonized style: " + styleName); + } + } + } + + return style; + } + + private void setFamily() { + String[] names = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); + if (names.length == 0) { + family = "Default"; + return; + } + for (int i = 0; i < names.length; i++) { + if (names[i].equalsIgnoreCase(name)) { + family = names[i]; + return; + } + if (names[i].equalsIgnoreCase("Dialog")) { + family = names[i]; + } + } + if (family == null) { + family = names[0]; + } + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/awt/PolyEdge.java libbluray-0.8.1/src/libbluray/bdj/java/java/awt/PolyEdge.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/awt/PolyEdge.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/awt/PolyEdge.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package java.awt; + +class PolyEdge { + + private int x1; + private int y1; + //private int x2; + private int y2; + private float m; + private float c; + private boolean vertical; + + PolyEdge(int x1, int y1, int x2, int y2) { + + // sort lowest to highest + if (y2 < y1) { + int swap; + swap = x1; x1 = x2; x2 = swap; + swap = y1; y1 = y2; y2 = swap; + } + + this.x1 = x1; + this.y1 = y1; + //this.x2 = x2; + this.y2 = y2; + + if (x1 == x2) { + vertical = true; + m = 0; + } else { + m = (float)(y2 - y1) / (float)(x2 - x1); + c = (-x1 * m) + y1; + vertical = false; + } + } + + public boolean intersects(int y) { + + if (y <= y2 && y >= y1 && y1 != y2) { + return true; + } + + return false; + } + + public int intersectionX(int y) { + + if (vertical) { + return x1; + } + + return (int)(((y - c) / m) + 0.5f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/BDFileSystem.java libbluray-0.8.1/src/libbluray/bdj/java/java/io/BDFileSystem.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/BDFileSystem.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/io/BDFileSystem.java 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,346 @@ +/* + * 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 + * . + */ + +/* + * Wrapper for java.io.FileSystem class. + * + * - replace getBooleanAttributes() for relative paths. + * Pretend files exist, if those are in xlet home directory (inside .jar). + * No other relative paths are allowed. + */ + +package java.io; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +import org.videolan.BDJLoader; +import org.videolan.BDJXletContext; +import org.videolan.Logger; + +public abstract class BDFileSystem extends FileSystem { + + private static final Logger logger = Logger.getLogger(BDFileSystem.class.getName()); + + protected final FileSystem fs; + + private static FileSystem nativeFileSystem; + + static { + /* Java 8: getFileSystem() no longer exists on java.io.FileSystem */ + try { + nativeFileSystem = (FileSystem)Class.forName("java.io.DefaultFileSystem") + .getDeclaredMethod("getFileSystem", new Class[0]) + .invoke(null, new Object[0]); + } catch (Exception e) { + try { + nativeFileSystem = (FileSystem)FileSystem.class + .getDeclaredMethod("getFileSystem",new Class[0]) + .invoke(null, new Object[0]); + } catch (Exception t) { + System.err.print("Couldn't find native filesystem: " + t); + } + } + } + + public static void init(final Class c) { + AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + init0(c); + return null; + } + }); + } + + private static void init0(Class c) { + Field filesystem; + try { + filesystem = c.getDeclaredField("fs"); + filesystem.setAccessible(true); + + /* Java 8: remove "final" modifier from the field */ + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(filesystem, filesystem.getModifiers() & ~Modifier.FINAL); + + FileSystem fs = (FileSystem)filesystem.get(null); + if (fs instanceof BDFileSystemImpl) { + //System.err.print("FileSystem already wrapped"); + } else { + filesystem.set(null, new BDFileSystemImpl(fs)); + } + } catch (Exception t) { + System.err.print("Hooking FileSystem class failed: " + t); + } + } + + public static String[] nativeList(File f) { + return nativeFileSystem.list(f); + } + + public static boolean nativeFileExists(String path) { + return nativeFileSystem.getBooleanAttributes(new File(path)) != 0; + } + + /* + */ + + public BDFileSystem(FileSystem fs) { + this.fs = fs; + } + + public char getSeparator() { + return fs.getSeparator(); + } + + public char getPathSeparator() { + return fs.getPathSeparator(); + } + + public String normalize(String pathname) { + return fs.normalize(pathname); + } + + public int prefixLength(String pathname) { + return fs.prefixLength(pathname); + } + + public static boolean isAbsolutePath(String path) { + return path.startsWith("/") || path.indexOf(":\\") == 1 || + path.startsWith("\\"); + } + + private String getHomeDir() { + String home = BDJXletContext.getCurrentXletHome(); + if (home == null) + return ""; + return home; + } + + public String resolve(String parent, String child) { + if (parent == null || parent.equals("") || parent.equals(".")) { + parent = getHomeDir(); + } + else if (!isAbsolutePath(parent)) { + logger.info("resolve relative file at " + parent); + parent = getHomeDir() + parent; + } + + String resolvedPath = fs.resolve(parent, child); + String cachePath = BDJLoader.getCachedFile(resolvedPath); + if (cachePath != resolvedPath) { + logger.info("resolve(p,c): using cached " + cachePath + " (" + resolvedPath + ")"); + } + return cachePath; + } + + public String getDefaultParent() { + return fs.getDefaultParent(); + } + + public String fromURIPath(String path) { + return fs.fromURIPath(path); + } + + public boolean isAbsolute(File f) { + return fs.isAbsolute(f); + } + + public String resolve(File f) { + if (!f.isAbsolute()) { + logger.info("resolve relative file " + f.getPath()); + return resolve(BDJXletContext.getCurrentXletHome(), f.getPath()); + } + + String resolvedPath = fs.resolve(f); + String cachePath = BDJLoader.getCachedFile(resolvedPath); + if (cachePath != resolvedPath) { + logger.info("resolve(f): using cached " + cachePath + " (" + resolvedPath + ")"); + } + return cachePath; + } + + public String canonicalize(String path) throws IOException { + String canonPath = fs.canonicalize(path); + String cachePath = BDJLoader.getCachedFile(canonPath); + if (cachePath != canonPath) { + logger.info("canonicalize(): Using cached " + cachePath + " for " + canonPath + "(" + path + ")"); + } + return cachePath; + } + + public int getBooleanAttributes(File f) { + if (f.isAbsolute()) { + return fs.getBooleanAttributes(f); + } + + /* try to locate file in Xlet home directory */ + String home = BDJXletContext.getCurrentXletHome(); + if (home == null) { + logger.error("no home found for " + f.getPath() + " at " + Logger.dumpStack()); + return 0; + } + + String path = home + f.getPath(); + logger.info("Relative path " + f.getPath() + " translated to " + path); + return fs.getBooleanAttributes(new File(path)); + } + + /* + ME: public abstract boolean checkAccess(File f, boolean write); + SE: public abstract boolean checkAccess(File f, int access); + */ + + public long getLastModifiedTime(File f) { + return fs.getLastModifiedTime(f); + } + + public long getLength(File f) { + if (f.isAbsolute()) { + return fs.getLength(f); + } + + /* try to locate file in Xlet home directory */ + String home = BDJXletContext.getCurrentXletHome(); + if (home == null) { + logger.error("no home found for " + f.getPath() + " at " + Logger.dumpStack()); + return 0; + } + + String path = home + f.getPath(); + logger.info("Relative path " + f.getPath() + " translated to " + path); + return fs.getLength(new File(path)); + } + + /* + SE only + public abstract boolean setPermission(File f, int access, boolean enable, boolean owneronly); + */ + + /* this version exists in some java6 versions. + * Use reflection to make sure build succees and right method is called. + */ + public boolean createFileExclusively(String path, boolean restrictive) throws IOException { + return createFileExclusivelyImpl(path, restrictive); + } + /* this version exists in most java versions (1.4, 1.7, some 1.6 versions) */ + public boolean createFileExclusively(String path) throws IOException { + return createFileExclusivelyImpl(path, false); + } + + private boolean createFileExclusivelyImpl(String path, boolean restrictive) throws IOException { + Method m; + Object[] args; + + /* resolve method and set up arguments */ + try { + try { + m = fs.getClass().getDeclaredMethod("createFileExclusively", new Class[] { String.class }); + args = new Object[] {(Object)path}; + } catch (NoSuchMethodException e) { + m = fs.getClass().getDeclaredMethod("createFileExclusively", new Class[] { String.class, boolean.class }); + args = new Object[] {(Object)path, (Object)new Boolean(restrictive)}; + } + } catch (NoSuchMethodException e) { + logger.error("no matching FileSystem.createFileExclusively found !"); + throw new IOException(); + } + + /* call */ + try { + Boolean result = (Boolean)m.invoke(fs, args); + return result.booleanValue(); + } catch (IllegalAccessException e) { + logger.error("" + e); + throw new IOException(); + } catch (InvocationTargetException e) { + Throwable t = e.getTargetException(); + if (t instanceof IOException) { + throw (IOException)t; + } + logger.error("" + t); + throw new IOException(); + } + } + + /* + ME only + public abstract boolean deleteOnExit(File f); + */ + + /* + SE only + public abstract long getSpace(File f, int t); + */ + + public boolean delete(File f) { + return fs.delete(f); + } + + public String[] list(File f) { + + String path = f.getPath(); + String root = System.getProperty("bluray.vfs.root"); + if (root == null || !path.startsWith(root)) { + /* not inside VFS */ + return fs.list(f); + } + + /* path is inside VFS */ + /* EX. HOSTEL_2 lists files in BD-ROM */ + int rootLength = root.length(); + path = path.substring(rootLength); + + String[] names = org.videolan.Libbluray.listBdFiles(path, false); + return names; + } + + public boolean createDirectory(File f) { + return fs.createDirectory(f); + } + + public boolean rename(File f1, File f2) { + return fs.rename(f1, f2); + } + + public boolean setLastModifiedTime(File f, long time) { + return fs.setLastModifiedTime(f, time); + } + + public boolean setReadOnly(File f) { + return fs.setReadOnly(f); + } + + public File[] listRoots() { + return fs.listRoots(); + } + + public int compare(File f1, File f2) { + return fs.compare(f1, f2); + } + + public int hashCode(File f) { + return fs.hashCode(f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileDescriptor.java libbluray-0.8.1/src/libbluray/bdj/java/java/io/FileDescriptor.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileDescriptor.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/io/FileDescriptor.java 2015-02-13 11:44:06.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * 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 + * . + */ + +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 -Nru libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileInputStream.java libbluray-0.8.1/src/libbluray/bdj/java/java/io/FileInputStream.java --- libbluray-0.5.0/src/libbluray/bdj/java/java/io/FileInputStream.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/java/io/FileInputStream.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,211 @@ +/* + * 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 + * . + */ + +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) { + 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) { + 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 -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Clock.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Clock.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Clock.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Clock.java 2015-01-26 08:01:57.000000000 +0000 @@ -47,5 +47,5 @@ public float setRate(float factor); - public static final Time RESET = null; + public static final Time RESET = new Time(Long.MAX_VALUE); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Controller.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Controller.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Controller.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Controller.java 2015-01-26 08:01:57.000000000 +0000 @@ -42,7 +42,7 @@ public void removeControllerListener(ControllerListener listener); - public static final Time LATENCY_UNKNOWN = null; + public static final Time LATENCY_UNKNOWN = new Time(Long.MAX_VALUE); public static final int Unrealized = 100; public static final int Realizing = 200; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Duration.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Duration.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Duration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Duration.java 2015-01-26 08:01:57.000000000 +0000 @@ -22,6 +22,6 @@ public interface Duration { public Time getDuration(); - public static final Time DURATION_UNBOUNDED = null; - public static final Time DURATION_UNKNOWN = null; + public static final Time DURATION_UNBOUNDED = new Time(Long.MAX_VALUE); + public static final Time DURATION_UNKNOWN = new Time(Long.MAX_VALUE - 1); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Manager.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Manager.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Manager.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Manager.java 2015-01-26 08:01:57.000000000 +0000 @@ -34,49 +34,41 @@ dataSource.setLocator(sourceLocator); dataSource.connect(); return createPlayer(dataSource); - + // TODO: JMF seems to disconnect data sources in this method, based on this stack trace: // java.lang.NullPointerException // at com.sun.media.protocol.rtp.DataSource.disconnect(DataSource.java:207) // at javax.media.Manager.createPlayer(Manager.java:425) // at net.sf.fmj.ui.application.ContainerPlayer.createNewPlayer(ContainerPlayer.java:357) } - catch (NoPlayerException e) - { // no need to log, will be logged by call to createPlayer. + catch (NoPlayerException e) { + // no need to log, will be logged by call to createPlayer. continue; } - catch (ClassNotFoundException e) - { + catch (ClassNotFoundException e) { logger.warning("createPlayer: " + e); // no need for call stack continue; - } - catch (IOException e) - { + } + catch (IOException e) { logger.warning("" + e); continue; } - catch (NoClassDefFoundError e) - { + catch (NoClassDefFoundError e) { logger.warning("" + e); continue; } - catch (Exception e) - { + catch (Exception e) { logger.warning("" + e); continue; } - - } - + // if none found, try URLDataSource: final URL url; - try - { + try { url = sourceLocator.getURL(); } - catch (Exception e) - { + catch (Exception e) { logger.warning("" + e); throw new NoPlayerException(); } @@ -107,51 +99,39 @@ { final String protocol = sourceLocator.getProtocol(); final Vector dataSourceList = getDataSourceList(protocol); - for (int i = 0; i < dataSourceList.size(); ++i) - { + for (int i = 0; i < dataSourceList.size(); ++i) { String dataSourceClassName = (String) dataSourceList.get(i); - try - { + try { final Class dataSourceClass = Class.forName(dataSourceClassName); final DataSource dataSource = (DataSource) dataSourceClass.newInstance(); dataSource.setLocator(sourceLocator); dataSource.connect(); return dataSource; - - } - catch (ClassNotFoundException e) - { + catch (ClassNotFoundException e) { logger.warning("createDataSource: " + e); // no need for call stack continue; } - catch (IOException e) - { + catch (IOException e) { logger.warning("" + e); continue; } - catch (NoClassDefFoundError e) - { + catch (NoClassDefFoundError e) { logger.warning("" + e); continue; } - catch (Exception e) - { + catch (Exception e) { logger.warning("" + e); continue; } - - } - + // if none found, try URLDataSource: final URL url; - try - { + try { url = sourceLocator.getURL(); } - catch (Exception e) - { + catch (Exception e) { logger.warning("" + e); throw new NoDataSourceException(); } @@ -174,68 +154,65 @@ { return getClassList(toPackageFriendly(contentName), PackageManager.getContentPrefixList(), "content", "Handler"); } - + private static Player createPlayer(DataSource source, String contentType) throws IOException, NoPlayerException { final Vector handlerClassList = getHandlerClassList(contentType); - for (int i = 0; i < handlerClassList.size(); ++i) - { + for (int i = 0; i < handlerClassList.size(); ++i) { final String handlerClassName = (String) handlerClassList.get(i); - - try - { + + try { System.out.println(handlerClassName); final Class handlerClass = Class.forName(handlerClassName); - if (!Player.class.isAssignableFrom(handlerClass) && - !MediaProxy.class.isAssignableFrom(handlerClass)) - continue; // skip any classes that will not be matched below. + if (!Player.class.isAssignableFrom(handlerClass) && + !MediaProxy.class.isAssignableFrom(handlerClass)) { + continue; // skip any classes that will not be matched below. + } final MediaHandler handler = (MediaHandler) handlerClass.newInstance(); handler.setSource(source); - if (handler instanceof Player) - { return (Player) handler; - } - else if (handler instanceof MediaProxy) - { + + if (handler instanceof Player) { + return (Player) handler; + } else if (handler instanceof MediaProxy) { final MediaProxy mediaProxy = (MediaProxy) handler; return createPlayer(mediaProxy.getDataSource()); } } - catch (ClassNotFoundException e) - { - logger.warning("createPlayer: " + e); // no need for call stack + catch (ClassNotFoundException e) { + // no need for call stack + logger.warning("createPlayer: " + e); continue; - } - catch (IncompatibleSourceException e) - { - logger.warning("createPlayer(" + source + ", " + contentType + "): " + e); // no need for call stack + } + catch (IncompatibleSourceException e) { + // no need for call stack + logger.warning("createPlayer(" + source + ", " + contentType + "): " + e); continue; } - catch (IOException e) - { + catch (IOException e) { logger.warning("" + e); continue; } - catch (NoPlayerException e) - { // no need to log, will be logged by call to createPlayer. + catch (NoPlayerException e) { + // no need to log, will be logged by call to createPlayer. continue; } - catch (NoClassDefFoundError e) - { + catch (NoClassDefFoundError e) { logger.warning("" + e); continue; } - catch (Exception e) - { + catch (Exception e) { logger.warning("" + e); continue; } } + logger.error("No player found for " + contentType + " / " + source.getLocator()); throw new NoPlayerException("No player found for " + source.getLocator()); } - + private static char toPackageFriendly(char c) - { if (c >= 'a' && c <= 'z') + { + if (c >= 'a' && c <= 'z') return c; else if (c >= 'A' && c <= 'Z') return c; @@ -245,36 +222,34 @@ return c; else if (c == '/') return '.'; - else + else return '_'; } - + private static String toPackageFriendly(String contentName) { final StringBuffer b = new StringBuffer(); - for (int i = 0; i < contentName.length(); ++i) - { + for (int i = 0; i < contentName.length(); ++i) { final char c = contentName.charAt(i); b.append(toPackageFriendly(c)); } return b.toString(); } - + public static Vector getClassList(String contentName, Vector packages, String component2, String className) { final Vector result = new Vector(); //result.add("media." + component2 + "." + contentName + "." + className); - - for (int i = 0; i < packages.size(); ++i) - { + + for (int i = 0; i < packages.size(); ++i) { result.add(((String) packages.get(i)) + ".media." + component2 + "." + contentName + "." + className); } - + return result; } public static final String UNKNOWN_CONTENT_NAME = "unknown"; - + private static final TimeBase systemTimeBase = new SystemTimeBase(); private static final Logger logger = Logger.getLogger(Manager.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/MediaLocator.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/MediaLocator.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/MediaLocator.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/MediaLocator.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,10 +19,11 @@ package javax.media; +import java.io.Serializable; import java.net.MalformedURLException; import java.net.URL; -public class MediaLocator +public class MediaLocator implements Serializable { public MediaLocator(URL url) { this(url.toExternalForm()); @@ -58,4 +59,6 @@ private String protocol = ""; private String remainder = ""; + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Time.java libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Time.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/media/Time.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/media/Time.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,9 @@ package javax.media; -public class Time { +import java.io.Serializable; + +public class Time implements Serializable { public static final long ONE_SECOND = 1000000000L; protected long nanoseconds; @@ -47,4 +49,6 @@ { return nanoseconds / (double) ONE_SECOND; } + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/media/MediaSelectPermission.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/media/MediaSelectPermission.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/media/MediaSelectPermission.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/media/MediaSelectPermission.java 2015-01-26 08:01:57.000000000 +0000 @@ -46,6 +46,8 @@ } public boolean equals(Object obj) { + if (obj == null) + return false; if (this == obj) return true; if (getClass() != obj.getClass()) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/guide/ProgramScheduleEvent.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/guide/ProgramScheduleEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/guide/ProgramScheduleEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/guide/ProgramScheduleEvent.java 2015-01-26 08:01:57.000000000 +0000 @@ -31,16 +31,13 @@ public ProgramSchedule getProgramSchedule() { - return schedule; + return (ProgramSchedule)getSource(); } public ProgramEvent getProgramEvent() { - return event; + return (ProgramEvent)getSIElement(); } - + private static final long serialVersionUID = 5317004528244521709L; - protected ProgramSchedule schedule; - protected SIChangeType type; - protected ProgramEvent event; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/navigation/SIElementFilter.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/navigation/SIElementFilter.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/navigation/SIElementFilter.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/navigation/SIElementFilter.java 2015-01-26 08:01:57.000000000 +0000 @@ -54,7 +54,8 @@ // if we still don't have a response just cancel the request if (!requestor.getResponse()) { - req.cancel(); + if (req != null) + req.cancel(); } if (requestor.getResult() == null) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/ReadPermission.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/ReadPermission.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/ReadPermission.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/ReadPermission.java 2015-01-26 08:01:57.000000000 +0000 @@ -45,6 +45,8 @@ public boolean equals(Object obj) { + if (obj == null) + return false; if (this == obj) return true; if (getClass() != obj.getClass()) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/selection/SelectPermission.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/selection/SelectPermission.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/selection/SelectPermission.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/selection/SelectPermission.java 2015-01-26 08:01:57.000000000 +0000 @@ -63,6 +63,8 @@ public boolean equals(Object obj) { + if (obj == null) + return false; if (this == obj) return true; if (getClass() != obj.getClass()) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -37,6 +37,10 @@ return instance; } + public static void shutdown() { + instance = null; + } + public ServiceContext createServiceContext() throws InsufficientResourcesException, SecurityException { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIChangeType.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/SIChangeType.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIChangeType.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/SIChangeType.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,9 @@ package javax.tv.service; -public class SIChangeType +import java.io.Serializable; + +public class SIChangeType implements Serializable { public static final SIChangeType ADD = new SIChangeType("ADD"); public static final SIChangeType REMOVE = new SIChangeType("REMOVE"); @@ -34,4 +36,6 @@ } protected String name; + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/javax/tv/service/SIManagerImpl.java 2015-05-15 09:25:06.000000000 +0000 @@ -41,12 +41,29 @@ } } + public static void shutdown() { + synchronized (SIManagerImpl.class) { + instance = null; + } + } + protected SIManagerImpl() { - int ntitles = Libbluray.getTitles(); + int ntitles = Libbluray.numTitles(); LinkedList list = new LinkedList(); - for (int i = 0; i <= ntitles; i++) - list.add(new TitleImpl(i)); - list.add(new TitleImpl(65535)); + for (int i = 0; i <= ntitles; i++) { + try { + list.add(new TitleImpl(i)); + } catch (Exception t) { + org.videolan.Logger.getLogger("SIManagerImpl").error("Failed initializing title " + i + ": " + t); + } + } + + try { + list.add(new TitleImpl(65535)); + } catch (Exception t) { + org.videolan.Logger.getLogger("SIManagerImpl").error("Failed initializing title FirstPlay: " + t); + } + titles = new ServiceListImpl(list); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/bdplus/Status.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/bdplus/Status.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/bdplus/Status.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/bdplus/Status.java 2015-01-26 08:01:57.000000000 +0000 @@ -32,13 +32,25 @@ return instance; } + public static void shutdown() { + Status s; + synchronized (Status.class) { + s = instance; + instance = null; + } + if (s != null) { + s.listeners.clear(); + } + } + public void addListener(StatusListener listener) { listeners.add(listener); } public int get() { - logger.trace("get()"); - return Libbluray.readPSR(104); + int val = Libbluray.readPSR(104); + logger.trace("get(): 0x" + Integer.toHexString(val)); + return val; } public void removeListener(StatusListener listener) { @@ -46,17 +58,17 @@ } public void send(int data) { - logger.trace("send(" + data + ")"); + logger.trace("send(0x" + Integer.toHexString(data) + ")"); Libbluray.writePSR(103, data); } public void set(int data) { - logger.trace("set(" + data + ")"); + logger.trace("set(0x" + Integer.toHexString(data) + ")"); Libbluray.writePSR(104, data); } public void receive(int data) { - logger.trace("receive(" + data + ")"); + logger.trace("receive(0x" + Integer.toHexString(data) + ")"); listeners.putPSR102Callback(data); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/net/BDLocator.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/net/BDLocator.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/net/BDLocator.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/net/BDLocator.java 2015-05-15 09:25:06.000000000 +0000 @@ -27,11 +27,18 @@ public class BDLocator extends Locator { public BDLocator(String url) throws InvalidLocatorException { super(url); + try { + if (!url.startsWith("bd://")) throw new InvalidLocatorException(); String str = url.substring(5); if (!parseJar(str) && !parseSound(str) && !parsePlaylist(str)) throw new InvalidLocatorException(); + + } catch (InvalidLocatorException e) { + System.err.println("Invalid locator: " + url); + throw e; + } } public BDLocator(String disc, int titleNum, int playList) throws InvalidLocatorException { @@ -253,11 +260,19 @@ protected String getUrl() { String str = "bd://"; - if (disc != null && disc != "") - str += disc + "."; + if (disc != null && disc != "") { + str += disc; + if (titleNum >= 0) { + str += "."; + } + } - if (titleNum >= 0) - str += Integer.toString(titleNum, 16) + "."; + if (titleNum >= 0) { + str += Integer.toString(titleNum, 16); + if (jar >= 0 || playList >= 0 || sound >= 0) { + str += "."; + } + } if (jar >= 0) { str += "JAR:" + BDJUtil.makeFiveDigitStr(jar); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/CodingType.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/CodingType.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/CodingType.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/CodingType.java 2015-04-06 15:44:26.000000000 +0000 @@ -30,38 +30,27 @@ return name; } - public static final CodingType DOLBY_AC3_AUDIO = new CodingType( - "DOLBY_AC3_AUDIO"); - public static final CodingType DOLBY_DIGITAL_PLUS_AUDIO = new CodingType( - "DOLBY_DIGITAL_PLUS_AUDIO"); - public static final CodingType DOLBY_LOSSLESS_AUDIO = new CodingType( - "DOLBY_LOSSLESS_AUDIO"); + public static final CodingType DOLBY_AC3_AUDIO = new CodingType("DOLBY_AC3_AUDIO"); + public static final CodingType DOLBY_DIGITAL_PLUS_AUDIO = new CodingType("DOLBY_DIGITAL_PLUS_AUDIO"); + public static final CodingType DOLBY_LOSSLESS_AUDIO = new CodingType("DOLBY_LOSSLESS_AUDIO"); - public static final CodingType DRA_AUDIO = new CodingType("DRA_AUDIO"); - public static final CodingType DRA_EXTENSION_AUDIO = new CodingType( - "DRA_EXTENSION_AUDIO"); + // ??? + public static final CodingType DRA_AUDIO = new CodingType("DRA_AUDIO"); + public static final CodingType DRA_EXTENSION_AUDIO = new CodingType("DRA_EXTENSION_AUDIO"); - public static final CodingType DTS_AUDIO = new CodingType("DTS_AUDIO"); - public static final CodingType DTS_HD_AUDIO = new CodingType("DTS_HD_AUDIO"); - public static final CodingType DTS_HD_AUDIO_EXCEPT_XLL = new CodingType( - "DTS_HD_AUDIO_EXCEPT_XLL"); - public static final CodingType DTS_HD_AUDIO_LBR = new CodingType( - "DTS_HD_AUDIO_LBR"); - public static final CodingType DTS_HD_AUDIO_XLL = new CodingType( - "DTS_HD_AUDIO_XLL"); + public static final CodingType DTS_AUDIO = new CodingType("DTS_AUDIO"); + public static final CodingType DTS_HD_AUDIO = new CodingType("DTS_HD_AUDIO"); + public static final CodingType DTS_HD_AUDIO_EXCEPT_XLL = new CodingType("DTS_HD_AUDIO_EXCEPT_XLL"); + public static final CodingType DTS_HD_AUDIO_LBR = new CodingType("DTS_HD_AUDIO_LBR"); + public static final CodingType DTS_HD_AUDIO_XLL = new CodingType("DTS_HD_AUDIO_XLL"); - public static final CodingType INTERACTIVE_GRAPHICS = new CodingType( - "INTERACTIVE_GRAPHICS"); - public static final CodingType LPCM_AUDIO = new CodingType("LPCM_AUDIO"); - public static final CodingType MPEG2_VIDEO = new CodingType("MPEG2_VIDEO"); - public static final CodingType MPEG4_AVC_VIDEO = new CodingType( - "MPEG4_AVC_VIDEO"); - public static final CodingType PRESENTATION_GRAPHICS = new CodingType( - "PRESENTATION_GRAPHICS"); - public static final CodingType SMPTE_VC1_VIDEO = new CodingType( - "SMPTE_VC1_VIDEO"); - public static final CodingType TEXT_SUBTITLE = new CodingType( - "TEXT_SUBTITLE"); + public static final CodingType INTERACTIVE_GRAPHICS = new CodingType("INTERACTIVE_GRAPHICS"); + public static final CodingType LPCM_AUDIO = new CodingType("LPCM_AUDIO"); + public static final CodingType MPEG2_VIDEO = new CodingType("MPEG2_VIDEO"); + public static final CodingType MPEG4_AVC_VIDEO = new CodingType("MPEG4_AVC_VIDEO"); + public static final CodingType PRESENTATION_GRAPHICS = new CodingType("PRESENTATION_GRAPHICS"); + public static final CodingType SMPTE_VC1_VIDEO = new CodingType("SMPTE_VC1_VIDEO"); + public static final CodingType TEXT_SUBTITLE = new CodingType("TEXT_SUBTITLE"); private String name; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/DeliverySystemType.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/DeliverySystemType.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/DeliverySystemType.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/DeliverySystemType.java 2015-04-06 15:44:26.000000000 +0000 @@ -19,12 +19,11 @@ package org.bluray.ti; -public class DeliverySystemType extends - javax.tv.service.navigation.DeliverySystemType { +public class DeliverySystemType extends javax.tv.service.navigation.DeliverySystemType { + protected DeliverySystemType(String name) { super(name); } - public static final DeliverySystemType BD_ROM = new DeliverySystemType( - "BD_ROM"); + public static final DeliverySystemType BD_ROM = new DeliverySystemType("BD_ROM"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/DiscImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/DiscImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/DiscImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/DiscImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -20,10 +20,22 @@ public class DiscImpl implements Disc { DiscImpl(String id) { - this.id = id; + /* strip leading zeros */ + int i; + for (i = 0; i < id.length(); i++) { + if (id.charAt(i) != '0') + break; + } + this.id = id.substring(i); + if (this.id.length() < 1) { + this.id = id; + org.videolan.Logger.getLogger("DiscImpl").error("Invalid Disc ID " + this.id); + } } public String getId() { + /* Returns the 128-bit identifier of this disc (from id.bdmv), without leading zeros. + Each character in the String represents 4 bits. */ return id; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010-2015 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 + * . + */ + package org.bluray.ti; import java.util.Date; @@ -5,6 +24,7 @@ import javax.tv.locator.Locator; import javax.tv.service.ServiceInformationType; import javax.tv.service.navigation.ServiceComponent; +import javax.tv.service.navigation.StreamType; import org.bluray.net.BDLocator; import org.davic.net.InvalidLocatorException; @@ -49,12 +69,12 @@ StreamInfo[] ig = clip.getVideoStreams(); StreamInfo[] secVideo = clip.getVideoStreams(); StreamInfo[] secAudio = clip.getVideoStreams(); - + int count = video.length + audio.length + pg.length + ig.length + secVideo.length + secAudio.length; - + ServiceComponent[] components = new ServiceComponent[count]; - + int i = 0; for (int j = 0; j < video.length; i++, j++) components[i] = new TitleComponentImpl(j + 1, video[j], StreamType.VIDEO, true, playlistId, playitemId, service); @@ -68,7 +88,7 @@ components[i] = new TitleComponentImpl(j + 1, secVideo[j], StreamType.VIDEO, false, playlistId, playitemId, service); for (int j = 0; j < secAudio.length; i++, j++) components[i] = new TitleComponentImpl(j + 1, secAudio[j], StreamType.AUDIO, false, playlistId, playitemId, service); - + return components; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010-2015 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 + * . + */ + package org.bluray.ti; import java.util.Date; @@ -34,18 +53,18 @@ { TIClip[] clips = playlist.getClips(); PlayItem[] items = new PlayItem[clips.length]; - + for (int i = 0; i < clips.length; i++) { items[i] = new PlayItemImpl(id, i + 1, clips[i], service); } - + return items; } public Locator getLocator() { int title = Libbluray.getCurrentTitle(); - + try { return new BDLocator(null, title, id); } catch (InvalidLocatorException e) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java 2015-04-07 19:56:47.000000000 +0000 @@ -26,20 +26,22 @@ import javax.tv.service.Service; import javax.tv.service.selection.InvalidServiceComponentException; import javax.tv.service.selection.NormalContentEvent; +import javax.tv.service.selection.PresentationChangedEvent; import javax.tv.service.selection.PresentationTerminatedEvent; +import javax.tv.service.selection.SelectionFailedEvent; +import javax.tv.service.selection.SelectPermission; import javax.tv.service.selection.ServiceContentHandler; import javax.tv.service.selection.ServiceContextDestroyedEvent; import javax.tv.service.selection.ServiceContextEvent; import javax.tv.service.selection.ServiceContextListener; +import javax.tv.service.selection.ServiceContextPermission; import org.bluray.ti.Title; import org.bluray.ti.TitleImpl; import org.videolan.BDJLoader; -import org.videolan.BDJAction; -import org.videolan.BDJActionManager; import org.videolan.BDJLoaderCallback; import org.videolan.BDJListeners; -import org.videolan.media.content.playlist.Handler; +import org.videolan.media.content.PlayerManager; public class TitleContextImpl implements TitleContext { public Service getService() { @@ -47,16 +49,33 @@ } public ServiceContentHandler[] getServiceContentHandlers() throws SecurityException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new ServiceContextPermission("getServiceContentHandlers", "own")); + } + if (state == STATE_DESTROYED) throw new IllegalStateException(); if (state == STATE_STOPPED) return new ServiceContentHandler[0]; - ServiceContentHandler[] handler = new ServiceContentHandler[1]; - handler[0] = new Handler(); - return handler; + + ServiceContentHandler player = PlayerManager.getInstance().getPlaylistPlayer(); + if (player != null) { + ServiceContentHandler[] handler = new ServiceContentHandler[1]; + handler[0] = player; + return handler; + } + + System.err.println("getServiceContentHandlers(): none found"); + return new ServiceContentHandler[0]; } public void start(Title title, boolean restart) throws SecurityException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new SelectPermission(title.getLocator(), "own")); + } + if (state == STATE_DESTROYED) throw new IllegalStateException(); TitleStartAction action = new TitleStartAction(this, (TitleImpl)title); @@ -70,10 +89,18 @@ public void select(Locator[] locators) throws InvalidLocatorException, InvalidServiceComponentException, SecurityException { + + org.videolan.Logger.unimplemented("TitleContextImpl", "select(Locator[])"); + select(SIManager.createInstance().getService(locators[0])); } public void stop() throws SecurityException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new ServiceContextPermission("stop", "own")); + } + if (state == STATE_DESTROYED) throw new IllegalStateException(); TitleStopAction action = new TitleStopAction(this); @@ -82,6 +109,11 @@ } public void destroy() throws SecurityException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new ServiceContextPermission("stop", "own")); + } + if (state != STATE_DESTROYED) { state = STATE_DESTROYED; TitleStopAction action = new TitleStopAction(this); @@ -98,11 +130,9 @@ listeners.remove(listener); } - public void removeServiceContentHandler(ServiceContentHandler handler) { - if (handler != null) { - synchronized (handlers) { - handlers.remove(handler); - } + public void presentationChanged() { + if (state == STATE_STARTED) { + postEvent(new PresentationChangedEvent(this)); } } @@ -111,7 +141,7 @@ listeners.putCallback(event); } - private class TitleStartAction implements BDJLoaderCallback { + private static class TitleStartAction implements BDJLoaderCallback { private TitleStartAction(TitleContextImpl context, TitleImpl title) { this.context = context; this.title = title; @@ -122,6 +152,8 @@ context.title = title; context.state = STATE_STARTED; context.postEvent(new NormalContentEvent(context)); + } else { + context.postEvent(new SelectionFailedEvent(context, SelectionFailedEvent.OTHER)); } } @@ -129,7 +161,7 @@ private TitleImpl title; } - private class TitleStopAction implements BDJLoaderCallback { + private static class TitleStopAction implements BDJLoaderCallback { private TitleStopAction(TitleContextImpl context) { this.context = context; } @@ -141,6 +173,8 @@ context.postEvent(new ServiceContextDestroyedEvent(context)); else context.state = STATE_STOPPED; + } else { + context.postEvent(new SelectionFailedEvent(context, SelectionFailedEvent.OTHER)); } } @@ -151,7 +185,6 @@ private static final int STATE_STARTED = 1; private static final int STATE_DESTROYED = 2; private BDJListeners listeners = new BDJListeners(); - private LinkedList handlers = new LinkedList(); private TitleImpl title = null; private int state = STATE_STOPPED; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/StreamType.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/StreamType.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/StreamType.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/StreamType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -package org.bluray.ti; - -public class StreamType extends javax.tv.service.navigation.StreamType { - public StreamType(String name) - { - super(name); - this.name = name; - } - - public String toString() - { - return name; - } - - public static final StreamType DOLBY_AC3L_AUDIO = new StreamType( - "DOLBY_AC3L_AUDIO"); - public static final StreamType DTS_AUDIO = new StreamType("DTS_AUDIO"); - public static final StreamType LPCM_AUDIO = new StreamType("LPCM_AUDIO"); - public static final StreamType MPEG2_VIDEO = new StreamType("MPEG2_VIDEO"); - public static final StreamType MPEG4_AVC_VIDEO = new StreamType( - "MPEG4_AVC_VIDEO"); - public static final StreamType PRESENTATION_GRAPHIC = new StreamType( - "PRESENTATION_GRAPHIC"); - public static final StreamType SMPTE_VIDEO = new StreamType("SMPTE_VIDEO"); - public static final StreamType TEXT_SUBTITLE = new StreamType( - "TEXT_SUBTITLE"); - - private String name; -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010-2015 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 + * . + */ + package org.bluray.ti; import java.util.Date; @@ -12,9 +31,10 @@ import org.videolan.StreamInfo; public class TitleComponentImpl implements TitleComponent { - protected TitleComponentImpl(int stn, StreamInfo stream, StreamType type, boolean primary, int playlistId, int playitemId, Title service) + protected TitleComponentImpl(int stream_number, StreamInfo stream, StreamType type, boolean primary, + int playlistId, int playitemId, Title service) { - this.stn = stn; + this.stream_number = stream_number; this.stream = stream; this.type = type; this.primary = primary; @@ -46,21 +66,23 @@ String str; str = "bd://" + ((TitleImpl)service).getTitleNum() + - ".PLAYLIST:" + playlistId + - ".ITEM:" + playitemId; + ".PLAYLIST:" + playlistId + + ".ITEM:" + playitemId; if (type.equals(StreamType.AUDIO) && primary) - str += ".A1:" + stn; + str += ".A1:" + stream_number; else if (type.equals(StreamType.VIDEO) && primary) - str += ".V1:" + stn; + str += ".V1:" + stream_number; else if (type.equals(StreamType.AUDIO) && !primary) - str += ".A2:" + stn; + str += ".A2:" + stream_number; else if (type.equals(StreamType.VIDEO) && !primary) - str += ".V2:" + stn; + str += ".V2:" + stream_number; else if (type.equals(StreamType.SUBTITLES) && primary) - str += ".P:" + stn; - else + str += ".P:" + stream_number; + else { + System.err.println("Unknown StreamType " + type); return null; + } try { return new BDLocator(str); @@ -83,14 +105,14 @@ } public int getStreamNumber() { - return stn; + return stream_number; } public int getSubPathId() { return stream.getSubPathId(); } - int stn; + int stream_number; StreamInfo stream; StreamType type; boolean primary; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java 2015-02-12 09:56:04.000000000 +0000 @@ -1,6 +1,7 @@ package org.bluray.ti; import javax.tv.locator.Locator; +import javax.tv.service.SIException; import javax.tv.service.SIRequest; import javax.tv.service.SIRequestor; import javax.tv.service.ServiceType; @@ -12,15 +13,15 @@ import org.videolan.bdjo.Bdjo; public class TitleImpl implements Title { - public TitleImpl(int titleNum) { + public TitleImpl(int titleNum) throws SIException { this.titleNum = titleNum; this.ti = Libbluray.getTitleInfo(titleNum); if (ti == null) - throw new Error("Invalid title " + titleNum); + throw new SIException("Title " + titleNum + " does not exist in disc index"); if (ti.isBdj()) { bdjo = Libbluray.getBdjo(ti.getBdjoName()); if (bdjo == null) - throw new Error("Invalid title " + titleNum); + throw new SIException("title " + titleNum + ": Failed loading " + ti.getBdjoName() + ".bdjo"); } } @@ -65,7 +66,7 @@ case TitleInfo.BDJ_PLAYBACK_TYPE_INTERACTIVE: return TitleType.BDJ_INTERACTIVE; } - return null; + return TitleType.UNKNOWN; } public boolean hasMultipleInstances() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleInformationType.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleInformationType.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleInformationType.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleInformationType.java 2015-04-06 15:44:26.000000000 +0000 @@ -26,6 +26,5 @@ super(name); } - public static final TitleInformationType BD_ROM = new TitleInformationType( - "BD_ROM"); + public static final TitleInformationType BD_ROM = new TitleInformationType("BD_ROM"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleType.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleType.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ti/TitleType.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ti/TitleType.java 2015-04-06 15:44:26.000000000 +0000 @@ -27,10 +27,8 @@ super(name); } - public static final TitleType BDJ_INTERACTIVE = new TitleType( - "BDJ_INTERACTIVE"); - public static final TitleType BDJ_MOVIE = new TitleType("BDJ_MOVIE"); - public static final TitleType HDMV_INTERACTIVE = new TitleType( - "HDMV_INTERACTIVE"); - public static final TitleType HDMV_MOVIE = new TitleType("HDMV_MOVIE"); + public static final TitleType BDJ_INTERACTIVE = new TitleType("BDJ_INTERACTIVE"); + public static final TitleType BDJ_MOVIE = new TitleType("BDJ_MOVIE"); + public static final TitleType HDMV_INTERACTIVE = new TitleType("HDMV_INTERACTIVE"); + public static final TitleType HDMV_MOVIE = new TitleType("HDMV_MOVIE"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ui/FrameAccurateAnimation.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ui/FrameAccurateAnimation.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/ui/FrameAccurateAnimation.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/ui/FrameAccurateAnimation.java 2015-01-26 08:01:57.000000000 +0000 @@ -60,7 +60,7 @@ if (context != null) { context.addFAA(this); } else { - logger.error("FrameAccurateAnimation created from wrong thread: " + logger.dumpStack()); + logger.error("FrameAccurateAnimation created from wrong thread: " + Logger.dumpStack()); } this.params = new AnimationParameters(params); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,21 +20,27 @@ package org.bluray.vfs; +import org.videolan.BUMFAsset; +import org.videolan.BUMFParser; import org.videolan.Logger; public class VFSManager { + + private static VFSManager instance = null; + public static VFSManager getInstance() throws SecurityException, UnsupportedOperationException { - logger.unimplemented("getInstance"); - return new VFSManager(); - //throw new UnsupportedOperationException(); + if (instance == null) { + instance = new VFSManager(); + } + + return instance; } protected VFSManager() { - state = PREPARING; - logger.unimplemented("VFSManager"); + state = STABLE; } public boolean disableClip(String streamfile) @@ -56,8 +63,7 @@ public int getState() { - logger.unimplemented("getState"); - return STABLE; + return state; } public boolean isEnabledClip(String clipID) @@ -69,7 +75,17 @@ public void requestUpdating(String manifestfile, String signaturefile, boolean initBackupRegs) throws PreparingFailedException { + state = PREPARING; + + BUMFAsset[] assets = BUMFParser.parse(manifestfile); + if (assets == null) { + state = STABLE; + throw new PreparingFailedException(); + } + logger.unimplemented("requestUpdating(" + manifestfile + ")"); + state = STABLE; + throw new PreparingFailedException(); } private int state; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/DirectDrawS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/DirectDrawS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/DirectDrawS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/DirectDrawS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import java.awt.Image; +import java.awt.Rectangle; + +public class DirectDrawS3D +{ + public void drawStereoscopic(Image leftImage, int leftX, int leftY, + Rectangle[] leftUpdateAreas, + Image rightImage, int rightX, int rightY, + Rectangle[] rightUpdateAreas) + { + } + + public void drawStereoscopicImages(Image[] leftImages, int[] leftXs, int[] leftYs, + Rectangle[] leftUpdateAreas, + Image[] rightImages, int[] rightXs, int[] rightYs, + Rectangle[] rightUpdateAreas) + { + } + + public static DirectDrawS3D getInstance() + { + org.videolan.Logger.unimplemented("DirectDrawS3D", "getInstance"); + return null; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigTemplateS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigTemplateS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigTemplateS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigTemplateS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import org.havi.ui.HBackgroundConfigTemplate; +import org.havi.ui.HBackgroundConfiguration; + +public class HBackgroundConfigTemplateS3D extends HBackgroundConfigTemplate +{ + public static final int S3D = 17; + + protected int getPreferenceCount() { + return super.getPreferenceCount() + 1; + } + + protected int getPreferenceObjectCount() { + return super.getPreferenceObjectCount() + 1; + } + + protected int getPreferenceIndex(int preference) { + if (preference == S3D) + return super.getPreferenceCount(); + return super.getPreferenceIndex(preference); + } + + protected int getPreferenceObjectIndex(int preference) { + if (preference == S3D) + return super.getPreferenceObjectCount(); + return super.getPreferenceObjectIndex(preference); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigurationS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigurationS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigurationS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HBackgroundConfigurationS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import java.io.IOException; +import org.havi.ui.HBackgroundImage; +import org.havi.ui.HConfigurationException; +import org.havi.ui.HPermissionDeniedException; +import org.havi.ui.HScreenRectangle; +import org.havi.ui.HStillImageBackgroundConfiguration; + +public class HBackgroundConfigurationS3D extends HStillImageBackgroundConfiguration +{ + public void displayImage(HBackgroundImage leftImage, + HBackgroundImage rightImage) + throws IOException, HPermissionDeniedException, HConfigurationException + { + displayImage(leftImage, rightImage, + new HScreenRectangle(0.0f, 0.0f, 1.0f, 1.0f), + new HScreenRectangle(0.0f, 0.0f, 1.0f, 1.0f)); + } + + public void displayImage(HBackgroundImage leftImage, + HBackgroundImage rightImage, + HScreenRectangle leftUpdateArea, + HScreenRectangle rightUpdateAreaparamHScreenRectangle2) + throws IOException, HPermissionDeniedException, HConfigurationException + { + displayImage(leftImage, leftUpdateArea); + org.videolan.Logger.unimplemented("HBackgroundConfigurationS3D", "displayImage"); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigTemplateS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigTemplateS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigTemplateS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigTemplateS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import org.havi.ui.HGraphicsConfigTemplate; + +public class HGraphicsConfigTemplateS3D extends HGraphicsConfigTemplate +{ + public static final int S3D = 17; + + protected int getPreferenceCount() { + return super.getPreferenceCount() + 1; + } + + protected int getPreferenceObjectCount() { + return super.getPreferenceObjectCount() + 1; + } + + protected int getPreferenceIndex(int preference) { + if (preference == S3D) + return super.getPreferenceCount(); + return super.getPreferenceIndex(preference); + } + + protected int getPreferenceObjectIndex(int preference) { + if (preference == S3D) + return super.getPreferenceObjectCount(); + return super.getPreferenceObjectIndex(preference); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigurationS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigurationS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigurationS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HGraphicsConfigurationS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import org.havi.ui.HConfigurationException; +import org.havi.ui.HGraphicsConfiguration; +import org.havi.ui.HPermissionDeniedException; + +public class HGraphicsConfigurationS3D extends HGraphicsConfiguration +{ + public int getOffsetValue() + { + return 0; + } + + public void setOffsetValue(int offset) + throws HPermissionDeniedException, HConfigurationException + { + org.videolan.Logger.unimplemented("HGraphicsConfigurationS3D", "setOffsetValue"); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HVideoConfigTemplateS3D.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HVideoConfigTemplateS3D.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/HVideoConfigTemplateS3D.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/HVideoConfigTemplateS3D.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +import org.bluray.ui.BDVideoConfigTemplate; + +public class HVideoConfigTemplateS3D extends BDVideoConfigTemplate +{ + public static final int S3D = 17; + + protected int getPreferenceCount() { + return super.getPreferenceCount() + 1; + } + + protected int getPreferenceObjectCount() { + return super.getPreferenceObjectCount() + 1; + } + + protected int getPreferenceIndex(int preference) { + if (preference == S3D) + return super.getPreferenceCount(); + return super.getPreferenceIndex(preference); + } + + protected int getPreferenceObjectIndex(int preference) { + if (preference == S3D) + return super.getPreferenceObjectCount(); + return super.getPreferenceObjectIndex(preference); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/S3DProperty.java libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/S3DProperty.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/blurayx/s3d/ui/S3DProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/blurayx/s3d/ui/S3DProperty.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +package org.blurayx.s3d.ui; + +public class S3DProperty +{ + public static final S3DProperty ONE_PLANE = new S3DProperty("ONE_PLANE"); + public static final S3DProperty TWO_PLANES = new S3DProperty("TWO_PLANES"); + public static final S3DProperty TWOD_OUTPUT = new S3DProperty("TWOD_OUTPUT"); + + private String value; + protected S3DProperty(String value) + { + this.value = value; + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppID.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppID.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppID.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppID.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,9 @@ package org.dvb.application; -public class AppID { +import java.io.Serializable; + +public class AppID implements Serializable { public AppID(int oid, int aid) { this.oid = oid; @@ -68,4 +70,6 @@ int oid; int aid; + + private static final long serialVersionUID = 1; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java 2015-01-26 08:01:57.000000000 +0000 @@ -35,7 +35,8 @@ public String getActions() { - return actions; + // actions should be always null + return null; } public boolean implies(Permission perm) @@ -45,29 +46,13 @@ public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (getClass() != obj.getClass()) - return false; - AppsControlPermission other = (AppsControlPermission) obj; - if (actions == null) { - if (other.actions != null) - return false; - } else if (!actions.equals(other.actions)) - return false; - return true; + return obj instanceof AppsControlPermission; } public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((actions == null) ? 0 : actions.hashCode()); - return result; + return getClass().hashCode(); } - private String actions; private static final long serialVersionUID = 4003360685455291075L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/application/AppsDatabase.java 2015-01-26 08:01:57.000000000 +0000 @@ -22,6 +22,7 @@ import java.util.LinkedList; import java.util.Enumeration; import org.videolan.BDJAppsDatabase; +import org.videolan.BDJListeners; import org.videolan.Logger; public class AppsDatabase { @@ -55,41 +56,17 @@ } public void addListener(AppsDatabaseEventListener listener) { - synchronized(listeners) { - listeners.add(listener); - } + listeners.add(listener); } public void removeListener(AppsDatabaseEventListener listener) { - synchronized(listeners) { - listeners.remove(listener); - } + listeners.remove(listener); } protected void notifyListeners(int id, AppID appid) { - LinkedList list; - synchronized(listeners) { - list = (LinkedList)listeners.clone(); - } - AppsDatabaseEvent event = new AppsDatabaseEvent(id, appid, this); - for (int i = 0; i < list.size(); i++) { - switch (id) { - case AppsDatabaseEvent.APP_ADDED: - ((AppsDatabaseEventListener)list.get(i)).entryAdded(event); - break; - case AppsDatabaseEvent.APP_CHANGED: - ((AppsDatabaseEventListener)list.get(i)).entryChanged(event); - break; - case AppsDatabaseEvent.APP_DELETED: - ((AppsDatabaseEventListener)list.get(i)).entryRemoved(event); - break; - case AppsDatabaseEvent.NEW_DATABASE: - ((AppsDatabaseEventListener)list.get(i)).newDatabase(event); - break; - } - } + listeners.putCallback(new AppsDatabaseEvent(id, appid, this)); } - private LinkedList listeners = new LinkedList(); + private BDJListeners listeners = new BDJListeners(); private static final Logger logger = Logger.getLogger(AppsDatabase.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/AsynchronousLoadingEvent.java 2015-01-26 08:01:57.000000000 +0000 @@ -29,9 +29,8 @@ public Object getSource() { - return source; + return super.getSource(); } - private DSMCCObject source; private static final long serialVersionUID = -688613909871281279L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCObject.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCObject.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCObject.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCObject.java 2015-04-06 15:44:26.000000000 +0000 @@ -31,17 +31,19 @@ public DSMCCObject(String path) { super(path); + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), ""); } public DSMCCObject(String path, String name) { super(path, name); - + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), ""); } public DSMCCObject(DSMCCObject dir, String name) { super(dir.getPath(), name); + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), ""); } public boolean isLoaded() @@ -97,11 +99,13 @@ public static boolean prefetch(String path, byte priority) { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "prefetch"); return false; } public static boolean prefetch(DSMCCObject dir, String path, byte priority) { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "prefetch"); return false; } @@ -109,7 +113,7 @@ { if (loaded) throw new NotLoadedException(); - + loaded = false; } @@ -128,12 +132,14 @@ public void addObjectChangeEventListener(ObjectChangeEventListener listener) throws InsufficientResourcesException { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "addObjectChangeEventListener"); throw new Error("Not implemented"); // NOTE: probably unnecessary } public void removeObjectChangeEventListener( ObjectChangeEventListener listener) { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "removeObjectChangeEventListener"); throw new Error("Not implemented"); // NOTE: probably unnecessary } @@ -142,17 +148,19 @@ { if (!super.exists()) throw new InvalidPathNameException(); - + listener.receiveEvent(new SuccessEvent(this)); } public void setRetrievalMode(int retrieval_mode) { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "setRetrievalMode"); throw new Error("Not implemented"); } public X509Certificate[][] getSigners() { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "getSigners"); throw new Error("Not implemented"); } @@ -162,6 +170,7 @@ InvalidPathNameException, NotEntitledException, ServiceXFRException, InsufficientResourcesException { + org.videolan.Logger.unimplemented(DSMCCObject.class.getName(), "getSigners"); throw new Error("Not implemented"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStreamEvent.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStreamEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStreamEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStreamEvent.java 2015-04-06 15:44:26.000000000 +0000 @@ -26,6 +26,7 @@ throws NotLoadedException, IllegalObjectTypeException { super(aDSMCCObject); + org.videolan.Logger.unimplemented(DSMCCStreamEvent.class.getName(), ""); throw new Error("Not implemented"); } @@ -33,6 +34,7 @@ IllegalObjectTypeException { super(path); + org.videolan.Logger.unimplemented(DSMCCStreamEvent.class.getName(), ""); throw new Error("Not implemented"); } @@ -40,6 +42,7 @@ IllegalObjectTypeException { super(path, name); + org.videolan.Logger.unimplemented(DSMCCStreamEvent.class.getName(), ""); throw new Error("Not implemented"); } @@ -66,4 +69,5 @@ throw new Error("Not implemented"); } + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStream.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStream.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStream.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/DSMCCStream.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,24 +19,28 @@ package org.dvb.dsmcc; import java.io.IOException; +import java.io.Serializable; import org.davic.net.Locator; -public class DSMCCStream { +public class DSMCCStream implements Serializable { public DSMCCStream(DSMCCObject aDSMCCObject) throws NotLoadedException, IllegalObjectTypeException { + org.videolan.Logger.unimplemented(DSMCCStream.class.getName(), ""); throw new Error("Not implemented"); } public DSMCCStream(String path) throws IOException, IllegalObjectTypeException { + org.videolan.Logger.unimplemented(DSMCCStream.class.getName(), ""); throw new Error("Not implemented"); } public DSMCCStream(String path, String name) throws IOException, IllegalObjectTypeException { + org.videolan.Logger.unimplemented(DSMCCStream.class.getName(), ""); throw new Error("Not implemented"); } @@ -89,4 +93,6 @@ { throw new Error("Not implemented"); } + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/NPTRate.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/NPTRate.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/NPTRate.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/NPTRate.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,7 +19,9 @@ package org.dvb.dsmcc; -public class NPTRate { +import java.io.Serializable; + +public class NPTRate implements Serializable { // should only be called internally public NPTRate(int numerator, int denominator) @@ -40,4 +42,6 @@ private int numerator; private int denominator; + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceDomain.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceDomain.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceDomain.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceDomain.java 2015-04-06 15:44:26.000000000 +0000 @@ -37,21 +37,23 @@ throws ServiceXFRException, InterruptedIOException, MPEGDeliveryException { + org.videolan.Logger.unimplemented("ServiceDomain", "attach"); throw new Error("Not implemented"); } public void attach(Locator locator) throws DSMCCException, InterruptedIOException, MPEGDeliveryException - { + { BDLocator bdl = checkLocator(locator); if (bdl == null) throw new DSMCCException("invalid BDLocator"); - + if (!bdl.isJarFileItem()) throw new DSMCCException("invalid BDLocator"); - + try { this.mountPoint = new DSMCCObject(MountManager.mount(bdl.getJarFileId())); + this.locator = locator; } catch (MountException e) { e.printStackTrace(); throw new DSMCCException("couldn't mount jar"); @@ -62,6 +64,7 @@ InterruptedIOException, InvalidAddressException, MPEGDeliveryException { + org.videolan.Logger.unimplemented("ServiceDomain", "attach"); throw new Error("Not implemented"); } @@ -73,6 +76,7 @@ public byte[] getNSAPAddress() throws NotLoadedException { + org.videolan.Logger.unimplemented("ServiceDomain", "getNSAPAddress"); throw new Error("Not implemented"); } @@ -83,21 +87,21 @@ BDLocator bdl = checkLocator(locator); if (bdl == null) throw new InvalidLocatorException("invalid BDLocator"); - + if (bdl.isJarFileItem()) { String mountPt = MountManager.getMount(bdl.getJarFileId()); - + if (mountPt == null) throw new NotLoadedException(); - + DSMCCObject obj = new DSMCCObject(mountPt, bdl.getPathSegments()); - + if (!obj.exists()) throw new FileNotFoundException(); - + return obj.getURL(); } - + throw new InvalidLocatorException(); } @@ -108,6 +112,7 @@ public boolean isNetworkConnectionAvailable() { + org.videolan.Logger.unimplemented("ServiceDomain", "isNetworkConnectionAvailable"); return false; } @@ -120,20 +125,20 @@ { return locator; } - + private static BDLocator checkLocator(Locator locator) { if (!(locator instanceof BDLocator)) return null; - + BDLocator bdl = (BDLocator)locator; - + if (bdl.isJarFileItem()) return bdl; else return null; } - + private DSMCCObject mountPoint = null; private Locator locator = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceXFRReference.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceXFRReference.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceXFRReference.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/dsmcc/ServiceXFRReference.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,17 +19,21 @@ package org.dvb.dsmcc; +import java.io.Serializable; + import org.davic.net.Locator; -public class ServiceXFRReference { +public class ServiceXFRReference implements Serializable { public ServiceXFRReference(Locator serviceLocator, int carouselId, String pathName) { + org.videolan.Logger.unimplemented(ServiceXFRReference.class.getName(), ""); throw new Error("Not implemented"); } public ServiceXFRReference(byte[] nsapAddress, String pathName) { + org.videolan.Logger.unimplemented(ServiceXFRReference.class.getName(), ""); throw new Error("Not implemented"); } @@ -52,4 +56,6 @@ { throw new Error("Not implemented"); } + + private static final long serialVersionUID = 1L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/EventManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/event/EventManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/EventManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/event/EventManager.java 2015-02-28 16:45:26.000000000 +0000 @@ -31,7 +31,6 @@ import org.davic.resources.ResourceStatusListener; import org.havi.ui.HScene; import org.videolan.BDJAction; -import org.videolan.BDJActionManager; import org.videolan.BDJXletContext; import org.videolan.GUIManager; import org.videolan.Logger; @@ -45,14 +44,29 @@ return instance; } + public static void shutdown() { + EventManager e; + synchronized (EventManager.class) { + e = instance; + instance = null; + } + if (e != null) { + e.exclusiveUserEventListener.clear(); + e.sharedUserEventListener.clear(); + e.exclusiveAWTEventListener.clear(); + e.resourceStatusEventListeners.clear(); + } + } + public boolean addUserEventListener(UserEventListener listener, ResourceClient client, UserEventRepository userEvents) throws IllegalArgumentException { if (client == null) throw new IllegalArgumentException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { if (!cleanupReservedEvents(userEvents)) return false; - exclusiveUserEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), listener, client, userEvents)); + exclusiveUserEventListener.add(new UserEventItem(context, listener, client, userEvents)); sendResourceStatusEvent(new UserEventUnavailableEvent(userEvents)); return true; } @@ -61,8 +75,9 @@ public void addUserEventListener(UserEventListener listener, UserEventRepository userEvents) { if (listener == null || userEvents == null) throw new NullPointerException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { - sharedUserEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), listener, null, userEvents)); + sharedUserEventListener.add(new UserEventItem(context, listener, null, userEvents)); } } @@ -88,10 +103,11 @@ throws IllegalArgumentException { if (client == null) throw new IllegalArgumentException(); + BDJXletContext context = BDJXletContext.getCurrentContext(); synchronized (this) { if (!cleanupReservedEvents(userEvents)) return false; - exclusiveAWTEventListener.add(new UserEventItem(BDJXletContext.getCurrentContext(), null, client, userEvents)); + exclusiveAWTEventListener.add(new UserEventItem(context, null, client, userEvents)); sendResourceStatusEvent(new UserEventUnavailableEvent(userEvents)); return true; } @@ -140,7 +156,8 @@ BDJXletContext context = focusHScene.getXletContext(); for (Iterator it = exclusiveAWTEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing exclusive AWT event listener for " + item.context); it.remove(); continue; } @@ -155,12 +172,13 @@ for (Iterator it = exclusiveUserEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing exclusive UserEvent listener for " + item.context); it.remove(); continue; } if (item.userEvents.contains(ue)) { - item.context.putCallback(new UserEventAction(item, ue)); + item.context.putUserEvent(new UserEventAction(item, ue)); return true; } } @@ -169,12 +187,13 @@ for (Iterator it = sharedUserEventListener.iterator(); it.hasNext(); ) { UserEventItem item = (UserEventItem)it.next(); - if (item.context == null) { + if (item.context == null || item.context.isReleased()) { + logger.error("Removing UserEvent listener for " + item.context); it.remove(); continue; } if (item.userEvents.contains(ue)) { - item.context.putCallback(new UserEventAction(item, ue)); + item.context.putUserEvent(new UserEventAction(item, ue)); result = true; } } @@ -194,7 +213,7 @@ return false; } catch (Exception e) { logger.error("requestRelease() failed: " + e.getClass()); - logger.info("" + e.getStackTrace()); + e.printStackTrace(); return false; } sendResourceStatusEvent(new UserEventAvailableEvent(item.userEvents)); @@ -211,7 +230,7 @@ return false; } catch (Exception e) { logger.error("requestRelease() failed: " + e.getClass()); - logger.info("" + e.getStackTrace()); + e.printStackTrace(); return false; } sendResourceStatusEvent(new UserEventAvailableEvent(item.userEvents)); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/event/UserEventAvailableEvent.java 2015-01-26 08:01:57.000000000 +0000 @@ -29,9 +29,8 @@ public Object getSource() { - return source; + return super.getSource(); } - private Object source; private static final long serialVersionUID = 1747902573730814730L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/io/ixc/IxcRegistry.java 2015-01-26 08:01:57.000000000 +0000 @@ -33,10 +33,23 @@ private static IxcRegistryImpl registry = null; private static IxcRegistryImpl getIxcRegistry() { - if (registry == null) { - registry = new IxcRegistryImpl(); + synchronized (IxcRegistry.class) { + if (registry == null) { + registry = new IxcRegistryImpl(); + } + return registry; + } + } + + public static void shutdown() { + IxcRegistryImpl r; + synchronized (IxcRegistry.class) { + r = registry; + registry = null; + } + if (r != null) { + r.unbindAll(); } - return registry; } public static Remote lookup(XletContext xc, String path) throws NotBoundException, RemoteException { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/persistent/FileAttributes.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/io/persistent/FileAttributes.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/io/persistent/FileAttributes.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/io/persistent/FileAttributes.java 2015-01-26 08:01:57.000000000 +0000 @@ -38,6 +38,7 @@ public Date getExpirationDate() { + org.videolan.Logger.unimplemented(FileAttributes.class.getName(), "getExpirationDate"); return null; } @@ -69,6 +70,7 @@ public static void setFileAttributes(FileAttributes p, File f) throws IOException { + org.videolan.Logger.unimplemented(FileAttributes.class.getName(), "setFileAttributes"); // not implemented } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/media/DripFeedDataSource.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/media/DripFeedDataSource.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/media/DripFeedDataSource.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/media/DripFeedDataSource.java 2015-01-26 08:01:57.000000000 +0000 @@ -39,6 +39,7 @@ } public void feed(byte[] clip_part) { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "feed"); throw new Error("Not implemented"); } @@ -47,30 +48,37 @@ } public void connect() throws IOException { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "connect"); throw new Error("Not implemented"); } public void disconnect() { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "disconnect"); throw new Error("Not implemented"); } public void start() throws IOException { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "start"); throw new Error("Not implemented"); } public void stop() throws IOException { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "stop"); throw new Error("Not implemented"); } public Time getDuration() { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "getDuration"); throw new Error("Not implemented"); } public Object[] getControls() { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "getControls"); throw new Error("Not implemented"); } public Object getControl(String controlType) { + org.videolan.Logger.unimplemented(DripFeedDataSource.class.getName(), "getControls"); throw new Error("Not implemented"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/ui/DVBTextLayoutManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/ui/DVBTextLayoutManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/ui/DVBTextLayoutManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/ui/DVBTextLayoutManager.java 2015-01-26 08:01:57.000000000 +0000 @@ -25,124 +25,145 @@ public class DVBTextLayoutManager implements org.havi.ui.HTextLayoutManager { - public void render(String markedUpString, java.awt.Graphics g, HVisible v, - java.awt.Insets insets) + public void render(String markedUpString, java.awt.Graphics g, HVisible v, Insets insets) { - throw new Error("Not implemented"); + /* this class is defined in GEM specifications */ + logger.unimplemented("render(" + markedUpString + ")"); } public DVBTextLayoutManager() { - throw new Error("Not implemented"); + this(HORIZONTAL_START_ALIGN, VERTICAL_START_ALIGN, LINE_ORIENTATION_HORIZONTAL, START_CORNER_UPPER_LEFT, true, + /* linespace = (point size of the default font for HVisible) + 7 */ 12 + 7, + 0, 56); } public DVBTextLayoutManager(int horizontalAlign, int verticalAlign, int lineOrientation, int startCorner, boolean wrap, int linespace, int letterspace, int horizontalTabSpace) { - throw new Error("Not implemented"); + this.horizontalAlign = horizontalAlign; + this.verticalAlign = verticalAlign; + this.lineOrientation = lineOrientation; + this.startCorner = startCorner; + this.wrap = wrap; + this.linespace = linespace; + this.letterspace = letterspace; + this.horizontalTabSpace = horizontalTabSpace; } public void setHorizontalAlign(int horizontalAlign) { - throw new Error("Not implemented"); + this.horizontalAlign = horizontalAlign; } public void setVerticalAlign(int verticalAlign) { - throw new Error("Not implemented"); + this.verticalAlign = verticalAlign; } public void setLineOrientation(int lineOrientation) { - throw new Error("Not implemented"); + this.lineOrientation = lineOrientation; } public void setStartCorner(int startCorner) { - throw new Error("Not implemented"); + this.startCorner = startCorner; } public void setTextWrapping(boolean wrap) { - throw new Error("Not implemented"); + this.wrap = wrap; } public void setLineSpace(int lineSpace) { - throw new Error("Not implemented"); + this.linespace = lineSpace; } public void setLetterSpace(int letterSpace) { - throw new Error("Not implemented"); + this.letterspace = letterSpace; } public void setHorizontalTabSpacing(int horizontalTabSpace) { - throw new Error("Not implemented"); + this.horizontalTabSpace = horizontalTabSpace; } public int getHorizontalAlign() { - return HORIZONTAL_START_ALIGN; + return horizontalAlign; } public int getVerticalAlign() { - throw new Error("Not implemented"); + return verticalAlign; } public int getLineOrientation() { - throw new Error("Not implemented"); + return lineOrientation; } public int getStartCorner() { - throw new Error("Not implemented"); + return startCorner; } public boolean getTextWrapping() { - throw new Error("Not implemented"); + return wrap; } public int getLineSpace() { - throw new Error("Not implemented"); + return linespace; } public int getLetterSpace() { - throw new Error("Not implemented"); + return letterspace; } public int getHorizontalTabSpacing() { - throw new Error("Not implemented"); + return horizontalTabSpace; } public void setInsets(Insets insets) { - throw new Error("Not implemented"); + this.insets = insets; } public Insets getInsets() { - throw new Error("Not implemented"); + return this.insets; } public void addTextOverflowListener(TextOverflowListener listener) { - throw new Error("Not implemented"); + logger.unimplemented("addTextOverflowListener"); } public void removeTextOverflowListener(TextOverflowListener listener) { - throw new Error("Not implemented"); + logger.unimplemented("removeTextOverflowListener"); } - + + private int horizontalAlign; + private int verticalAlign; + private int lineOrientation; + private int startCorner; + private boolean wrap; + private int linespace; + private int letterspace; + private int horizontalTabSpace; + private Insets insets = new Insets(0, 0, 0, 0); + + private static final org.videolan.Logger logger = org.videolan.Logger.getLogger(DVBTextLayoutManager.class.getName()); + public static final int HORIZONTAL_START_ALIGN = 1; public static final int HORIZONTAL_END_ALIGN = 2; public static final int HORIZONTAL_CENTER = 3; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.dvb.ui; + +import java.awt.Font; +import java.io.File; +import java.io.InputStream; +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +import org.videolan.BDJUtil; +import org.videolan.FontIndex; +import org.videolan.FontIndexData; +import org.videolan.Logger; + +public class FontFactory { + public static synchronized void loadDiscFonts() { + unloadDiscFonts(); + } + + public static synchronized void unloadDiscFonts() { + fonts = null; + fontIds = null; + } + + private static synchronized void readDiscFonts() throws FontFormatException, IOException { + if (fonts != null) + return; + + String path = BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/dvb.fontindex"); + FontIndexData fontIndexData[] = FontIndex.parseIndex(path); + + fonts = new HashMap(fontIndexData.length); + fontIds = new HashMap(fontIndexData.length); + for (int i = 0; i < fontIndexData.length; i++) { + FontIndexData data = fontIndexData[i]; + try { + File fontFile = org.videolan.BDJLoader.addFont(data.getFileName()); + if (fontFile == null) { + throw new IOException("error caching font"); + } + + if (data.getStyle() == -1) { + logger.unimplemented("readDiscFonts(): font with all styles not supported"); + } + + Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile); + font = font.deriveFont(data.getStyle(), 1); + + fonts.put(data.getName() + "." + font.getStyle(), font); + fontIds.put(data.getFileName().substring(0, 5), font); + + } catch (IOException ex) { + logger.error("Failed reading font " + data.getName() + " from " + data.getFileName() + ": " + ex); + if (i == fontIndexData.length - 1 && fonts.size() < 1) { + logger.error("didn't load any fonts !"); + throw ex; + } + } catch (java.awt.FontFormatException ex) { + logger.error("Failed reading font " + data.getName() + " from " + data.getFileName() + ": " + ex); + if (i == fontIndexData.length - 1 && fonts.size() < 1) { + logger.error("didn't load any fonts !"); + throw new FontFormatException(); + } + } + } + + } + + public FontFactory() throws FontFormatException, IOException { + readDiscFonts(); + } + + public FontFactory(URL u) throws IOException, FontFormatException { + InputStream inStream = null; + + try { + inStream = u.openStream(); + + File fontFile = org.videolan.BDJLoader.addFont(inStream); + if (fontFile == null) { + throw new IOException("error caching font"); + } + + urlFont = Font.createFont(Font.TRUETYPE_FONT, fontFile); + urlFont = urlFont.deriveFont(urlFont.getStyle(), 1); + + } catch (IOException ex) { + logger.error("Failed reading font from " + u.getPath() + ": " + ex); + throw ex; + } catch (java.awt.FontFormatException ex) { + logger.error("Failed reading font from " + u.getPath() + ": " + ex); + throw new FontFormatException(); + } finally { + if (inStream != null) { + inStream.close(); + } + } + } + + public Font createFont(String fontId) { + Font font = null; + synchronized (FontFactory.class) { + font = (Font)fontIds.get(fontId); + } + if (font != null) { + return font.deriveFont(0, 12); + } + return null; + } + + public Font createFont(String name, int style, int size) + throws FontNotAvailableException, FontFormatException, IOException { + logger.info("Creating font: " + name + " " + style + " " + size); + + if (style < 0 || size <= 0 || (style & ~3) != 0) { + throw new IllegalArgumentException(); + } + + /* Factory created only for single font ? */ + if (urlFont != null) { + if (name.equals(urlFont.getName()) && style == urlFont.getStyle()) { + return urlFont.deriveFont(style, size); + } + logger.info("createFont(URL): request " + name + "." + style + " does not match with " + urlFont.getName() + "." + urlFont.getStyle()); + throw new FontNotAvailableException(); + } + + /* Factory created for fonts in dvb.fontindex */ + Font font = null; + synchronized (FontFactory.class) { + font = (Font)fonts.get(name + "." + style); + } + + if (font == null) { + logger.info("Font " + name + "." + style + " not found"); + throw new FontNotAvailableException(); + } + + return font.deriveFont(style, size); + } + + private Font urlFont = null; + + private static Map fonts = null; + private static Map fontIds = null; + + private static final Logger logger = Logger.getLogger(FontFactory.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/user/GeneralPreference.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/user/GeneralPreference.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/user/GeneralPreference.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/user/GeneralPreference.java 2015-01-26 08:01:57.000000000 +0000 @@ -33,5 +33,9 @@ return false; } - private static final String[] GENERAL_PREFERENCES = { "User Language", "Parental Rating", "User Name", "User Address", "User @", "Country Code", "Default Font Size" }; + private static final String[] GENERAL_PREFERENCES = { + // DVB GEM + "User Language", "Parental Rating", "User Name", "User Address", "User @", "Country Code", "Default Font Size", + // BD-ROM + "User Language Audio", "User Language Subtitles" }; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/user/Preference.java libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/user/Preference.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/dvb/user/Preference.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/dvb/user/Preference.java 2015-01-26 08:01:57.000000000 +0000 @@ -20,7 +20,7 @@ package org.dvb.user; import java.util.Iterator; -import java.util.LinkedList; +import java.util.Vector; public class Preference { protected Preference() { @@ -40,8 +40,10 @@ } public void add(String value) { - values.remove(value); - values.add(value); + synchronized (values) { + values.remove(value); + values.add(value); + } } public void add(String value[]) { @@ -50,24 +52,32 @@ } public void add(int position, String value) { - values.remove(value); - if (position < 0) - position = 0; - else if (position > values.size()) - position = values.size(); - values.add(position, value); + synchronized (values) { + values.remove(value); + if (position < 0) + position = 0; + else if (position > values.size()) + position = values.size(); + values.add(position, value); + } } public String[] getFavourites() { - if (values.isEmpty()) - return new String[0]; - return (String[])values.toArray(); + synchronized (values) { + if (values.isEmpty()) + return new String[0]; + String[] result = new String[values.size()]; + values.copyInto(result); + return result; + } } public String getMostFavourite() { - if (values.isEmpty()) - return null; - return (String)values.get(0); + synchronized (values) { + if (values.isEmpty()) + return null; + return (String)values.get(0); + } } public String getName() { @@ -75,24 +85,31 @@ } public int getPosition(String value) { - return values.indexOf(value); + synchronized (values) { + return values.indexOf(value); + } } public boolean hasValue() { - return !values.isEmpty(); + synchronized (values) { + return !values.isEmpty(); + } } public void remove(String value) { - values.remove(value); + synchronized (values) { + values.remove(value); + } } public void removeAll() { - values.clear(); + synchronized (values) { + values.clear(); + } } public void setMostFavourite(String value) { - values.remove(value); - values.addFirst(value); + add(0, value); } public String toString() { @@ -108,5 +125,5 @@ } private String name; - private LinkedList values = new LinkedList(); + private Vector values = new Vector(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/event/HEventGroup.java 2015-01-26 08:01:57.000000000 +0000 @@ -96,5 +96,5 @@ return arr; } - private LinkedList keys; + private LinkedList keys = new LinkedList(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HBackgroundConfiguration.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HBackgroundConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HBackgroundConfiguration.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HBackgroundConfiguration.java 2015-04-07 19:56:47.000000000 +0000 @@ -46,8 +46,10 @@ public void setColor(Color color) throws HPermissionDeniedException, HConfigurationException { - if (color.getAlpha() < 255) - throw new HConfigurationException(); + if (color.getAlpha() < 255) { + org.videolan.Logger.unimplemented("HBackgroundConfiguration", "setColor(alpha<255)"); + //throw new HConfigurationException(); + } this.color = color; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HContainer.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HContainer.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HContainer.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HContainer.java 2015-01-26 08:01:57.000000000 +0000 @@ -23,92 +23,293 @@ import java.awt.Container; import org.dvb.ui.TestOpacity; +//https://www.jinahya.com/mvn/site/com.googlecode.jinahya/ocap-api/1.3.1/apidocs/org/havi/ui/HContainer.html + public class HContainer extends Container implements HMatteLayer, HComponentOrdering, TestOpacity { public HContainer() { - org.videolan.Logger.unimplemented(HContainer.class.getName(), ""); + this(0,0,0,0); } public HContainer(int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HContainer.class.getName(), ""); + setBounds(x,y,width,height); } public void setMatte(HMatte m) throws HMatteException { - throw new Error("Not implemented"); + org.videolan.Logger.unimplemented("HContainer", "setMatte"); + throw new HMatteException("Matte is not supported"); } public HMatte getMatte() { - throw new Error("Not implemented"); + return hMatte; } public boolean isDoubleBuffered() { - throw new Error("Not implemented"); + return false; // can this be true ? } public boolean isOpaque() { - throw new Error("Not implemented"); + return false; // can this be true ? + } + + private int getOffset(java.awt.Component c) throws ArrayIndexOutOfBoundsException + { + Component cs[] = getComponents(); + for (int i = 0; i < cs.length; ++i) + if (cs[i] == c) return i; + + throw new ArrayIndexOutOfBoundsException("Component not contained within"); + } + + private void checkLineage(java.awt.Component c) + { + if (c.getParent() != this) throw new ArrayIndexOutOfBoundsException("Component not contained within"); } public Component addBefore(Component component, Component behind) { - throw new Error("Not implemented"); + // check to see if behind is an element of this container + try + { + getOffset(behind); + } + catch (Exception e) + { + return null; + } + + if (component == behind) return component; + synchronized (getTreeLock()) + { + try + { + // Explicitly remove component if in this container. + // Should have no effect if not in this container. + // This must be done so that problems don't occur + // when componentIndex < frontIndex. + remove(component); + + int offset = getOffset(behind); + + return add(component, offset); + } + catch (Exception e) + { + return null; + } + } } public Component addAfter(Component component, Component front) { - throw new Error("Not implemented"); + // check to see if front is an element of this container + try + { + getOffset(front); + } + catch (Exception e) + { + return null; + } + + if (component == front) return component; + synchronized (getTreeLock()) + { + try + { + // Explicitly remove component if in this container. + // Should have no effect if not in this container. + // This must be done so that problems don't occur + // when componentIndex < frontIndex. + remove(component); + + int offset = getOffset(front); + + return add(component, offset + 1); + } + catch (Exception e) + { + return null; + } + } } public boolean popToFront(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + // Ensure it is there + checkLineage(component); + + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, 0); + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pushToBack(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + // Ensure it is there + checkLineage(component); + + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, -1); + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pop(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + int offset = getOffset(component); + + if (offset > 0) + { + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, offset - 1); + return true; + } + } + catch (Exception e) + { + } + return false; + } } public boolean push(Component component) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + int offset = getOffset(component); + int count = getComponentCount(); + + if (offset == (count - 1)) + { + return true; + } + + if (offset < (count - 1)) + { + // explicitly remove component + // (even if reparenting is implicit) + remove(component); + add(component, offset + 1); + return true; + } + } + catch (Exception e) + { + } + + return false; + } } public boolean popInFrontOf(Component move, Component behind) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + if (move != behind) + { + // Ensure they are present + checkLineage(move); + checkLineage(behind); + + // explicitly remove component + // (even if reparenting is implicit) + remove(move); + // Re-add + addBefore(move, behind); + } + return true; + } + catch (Exception e) + { + return false; + } + } } public boolean pushBehind(Component move, Component front) { - throw new Error("Not implemented"); + synchronized (getTreeLock()) + { + try + { + if (move != front) + { + // Ensure they are present + checkLineage(move); + checkLineage(front); + + // explicitly remove component + // (even if reparenting is implicit) + remove(move); + // re-add in proper location + addAfter(move, front); + } + return true; + } + catch (Exception e) + { + return false; + } + } } public void group() { - throw new Error("Not implemented"); + grouped = true; } public void ungroup() { - throw new Error("Not implemented"); + grouped = false; } public boolean isGrouped() { - throw new Error("Not implemented"); + return grouped; } + private HMatte hMatte = null; + private boolean grouped = false; + private static final long serialVersionUID = 263606166411114032L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HDefaultTextLayoutManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HDefaultTextLayoutManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HDefaultTextLayoutManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HDefaultTextLayoutManager.java 2015-01-26 08:01:57.000000000 +0000 @@ -45,6 +45,8 @@ String[] lines = StrUtil.split(text, '\n'); Graphics g = hvisible.getGraphics(); + if (g == null) + continue; FontMetrics fontMetrics = g.getFontMetrics(hvisible.getFont()); g.dispose(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicLook.java 2015-01-26 08:01:57.000000000 +0000 @@ -32,51 +32,60 @@ public void fillBackground(Graphics g, HVisible visible, int state) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "fillBackground"); throw new Error("Not implemented"); } public void renderBorders(Graphics g, HVisible visible, int state) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "renderBorders"); throw new Error("Not implemented"); } public void renderVisible(Graphics g, HVisible visible, int state) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "renderVisible"); throw new Error("Not implemented"); } public void showLook(Graphics g, HVisible visible, int state) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "showLook"); throw new Error("Not implemented"); } public void widgetChanged (HVisible visible, HChangeData[] changes) { - throw new Error("Not implemented"); + if (visible.isVisible()) visible.repaint(); } public Dimension getMinimumSize(HVisible hvisible) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "getMinimumSize"); throw new Error("Not implemented"); } public Dimension getPreferredSize(HVisible hvisible) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "getPreferredSize"); throw new Error("Not implemented"); } public Dimension getMaximumSize(HVisible hvisible) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "getMaximumSize"); throw new Error("Not implemented"); } public boolean isOpaque(HVisible visible) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "isOpaque"); throw new Error("Not implemented"); } public Insets getInsets(HVisible hvisible) { + org.videolan.Logger.unimplemented(HGraphicLook.class.getName(), "getInsets"); throw new Error("Not implemented"); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsConfiguration.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicsConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsConfiguration.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicsConfiguration.java 2015-01-26 08:01:57.000000000 +0000 @@ -77,18 +77,22 @@ } public Color getPunchThroughToBackgroundColor(int percentage) { + org.videolan.Logger.unimplemented("HGraphicsConfigTemplate", ""); throw new Error("Not implemented"); } public Color getPunchThroughToBackgroundColor(int percentage, HVideoDevice hvd) { + org.videolan.Logger.unimplemented("HGraphicsConfigTemplate", ""); throw new Error("Not implemented"); } public Color getPunchThroughToBackgroundColor(Color color, int percentage) { + org.videolan.Logger.unimplemented("HGraphicsConfigTemplate", ""); throw new Error("Not implemented"); } public Color getPunchThroughToBackgroundColor(Color color, int percentage, HVideoDevice v) { + org.videolan.Logger.unimplemented("HGraphicsConfigTemplate", ""); throw new Error("Not implemented"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HGraphicsDevice.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,6 +19,11 @@ package org.havi.ui; +import java.awt.Dimension; + +import org.videolan.GUIManager; +import org.videolan.Logger; + public class HGraphicsDevice extends HScreenDevice { protected HGraphicsDevice() { int length = HScreenConfigTemplate.defaultConfig.length; @@ -65,10 +70,41 @@ public boolean setGraphicsConfiguration(HGraphicsConfiguration hgc) throws SecurityException, HPermissionDeniedException, HConfigurationException { + + logger.unimplemented("setGraphicsConfiguration"); + + GUIManager mgr = GUIManager.getInstance(); + Dimension d = hgc.getPixelResolution(); + int curWidth = mgr.getWidth(); + int curHeight = mgr.getHeight(); + + if (curWidth != d.width || curHeight != d.height) { + logger.info("Request to switch graphics resolution from " + curWidth + "x" + curHeight + + " to " + d.width + "x" + d.height); + + if (mgr.isVisible()) { + mgr.setVisible(false); + mgr.setBounds(0, 0, d.width, d.height); + mgr.setVisible(true); + } else { + mgr.setBounds(0, 0, d.width, d.height); + } + + curWidth = mgr.getWidth(); + curHeight = mgr.getHeight(); + if (curWidth != d.width || curHeight != d.height) { + logger.error("Request to switch graphics resolution from " + curWidth + "x" + curHeight + + " to " + d.width + "x" + d.height + " FAILED"); + return false; + } + } + this.hgc = hgc; return true; } private HGraphicsConfiguration[] hgcArray; private HGraphicsConfiguration hgc; + + private static final Logger logger = Logger.getLogger(HGraphicsDevice.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HSceneFactory.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HSceneFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HSceneFactory.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HSceneFactory.java 2015-05-15 09:25:06.000000000 +0000 @@ -101,7 +101,7 @@ return; } if (defaultHScene == null) { - logger.error("no HScene created"); + //logger.error("no HScene created"); return; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScene.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScene.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScene.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScene.java 2015-01-26 08:01:57.000000000 +0000 @@ -181,15 +181,11 @@ } public void addWindowListener(WindowListener listener) { - synchronized (windowListener) { - windowListener = HEventMulticaster.add(windowListener, listener); - } + windowListener = HEventMulticaster.add(windowListener, listener); } public void removeWindowListener(WindowListener listener) { - synchronized (windowListener) { - windowListener = HEventMulticaster.remove(windowListener, listener); - } + windowListener = HEventMulticaster.remove(windowListener, listener); } protected void processWindowEvent(WindowEvent event) { @@ -254,9 +250,11 @@ removeAll(); Graphics g = GUIManager.getInstance().getGraphics(); - Rectangle r = getBounds(); - g.clearRect(r.x, r.y, r.width, r.height); - + if (g != null) { + Rectangle r = getBounds(); + g.clearRect(r.x, r.y, r.width, r.height); + g.dispose(); + } if (image != null) { image.flush(); } @@ -321,11 +319,11 @@ } public int[] getAllShortcutKeycodes() { - Integer[] src = (Integer[]) shortcuts.keySet().toArray(); + Object[] src = shortcuts.keySet().toArray(); int[] dest = new int[src.length]; for (int i = 0; i < src.length; i++) - dest[i] = src[i].intValue(); + dest[i] = ((Integer)src[i]).intValue(); return dest; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenConfigTemplate.java 2015-01-26 08:01:57.000000000 +0000 @@ -166,5 +166,7 @@ { 720, 480, 16, 9 }, { 720, 576, 4, 3 }, { 720, 576, 16, 9 }, + + { 960, 540, 16, 9 }, }; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenDevice.java 2015-01-26 08:01:57.000000000 +0000 @@ -55,6 +55,7 @@ } public Dimension getScreenAspectRatio() { + org.videolan.Logger.unimplemented(HScreenDevice.class.getName(), "getScreenAspectRatio"); throw new Error("Not implemented"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HScreenRectangle.java 2015-04-06 16:23:06.000000000 +0000 @@ -40,6 +40,11 @@ this.height = height; } + public String toString() + { + return "HScreenRectangle[" + x + "," + y + " " + width + "x" + height + "]"; + } + public float x; public float y; public float width; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HStaticIcon.java 2015-01-26 08:01:57.000000000 +0000 @@ -20,41 +20,45 @@ package org.havi.ui; import java.awt.Image; +import org.videolan.BDJXletContext; public class HStaticIcon extends HVisible implements HNoInputPreferred { public HStaticIcon() { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook()); } public HStaticIcon(Image imageNormal, int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook(), x, y, width, height); + setGraphicContent(imageNormal, NORMAL_STATE); } public HStaticIcon(Image imageNormal) { - org.videolan.Logger.unimplemented(HStaticIcon.class.getName(), ""); + super(getDefaultLook()); + setGraphicContent(imageNormal, NORMAL_STATE); } public void setLook(HLook hlook) throws HInvalidLookException { - throw new Error("Not implemented"); + if ((hlook != null) && !(hlook instanceof HGraphicLook)) { + throw new HInvalidLookException(); + } + super.setLook(hlook); } public static void setDefaultLook(HGraphicLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook); } public static HGraphicLook getDefaultLook() { - if (DefaultLook == null) - org.videolan.Logger.unimplemented("", "getDefaultLook"); - return DefaultLook; + return (HGraphicLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK); } - private static HGraphicLook DefaultLook = null; - + private static final String PROPERTY_LOOK = "HStaticIcon"; + static final Class DEFAULT_LOOK = HGraphicLook.class; private static final long serialVersionUID = 2015589998794748072L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticText.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HStaticText.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HStaticText.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HStaticText.java 2015-01-26 08:01:57.000000000 +0000 @@ -23,6 +23,7 @@ import java.awt.Color; import java.awt.Font; +import org.videolan.BDJXletContext; import org.videolan.Logger; public class HStaticText extends HVisible implements HNoInputPreferred { @@ -74,19 +75,16 @@ public static void setDefaultLook(HTextLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK,hlook); } public static HTextLook getDefaultLook() { - if (DefaultLook == null) - DefaultLook = new HTextLook(); - return DefaultLook; + return (HTextLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK,DEFAULT_LOOK); } - private static HTextLook DefaultLook = null; - + static final Class DEFAULT_LOOK = HTextLook.class; + private static final String PROPERTY_LOOK = HStaticText.class.getName(); private static final Logger logger = Logger.getLogger(HStaticText.class.getName()); - private static final long serialVersionUID = 4352450387189482885L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HToggleButton.java 2015-01-26 08:01:57.000000000 +0000 @@ -21,74 +21,110 @@ import java.awt.Image; +import org.videolan.BDJXletContext; + public class HToggleButton extends HGraphicButton implements HSwitchable { public HToggleButton() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(image, x, y, width, height); + iniz(); } public HToggleButton(Image image) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(image); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + this(image, x, y, width, height); + setSwitchableState(state); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, int x, int y, int width, int height, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(imageNormal, imageFocused, imageActioned, x, y, width, height); + setGraphicContent(imageNormalActioned, ACTIONED_STATE); + setSwitchableState(state); + iniz(); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); + super(imageNormal, imageFocused, imageActioned); + setGraphicContent(imageNormalActioned, ACTIONED_STATE); + setSwitchableState(state); + iniz(); } public HToggleButton(Image image, int x, int y, int width, int height, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(image, x, y, width, height, state); + setToggleGroup(group); } public HToggleButton(Image image, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(image); + setSwitchableState(state); + setToggleGroup(group); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, int x, int y, int width, int height, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(imageNormal, imageFocused, imageActioned, imageNormalActioned, x, y, width, height, state); + setToggleGroup(group); } public HToggleButton(Image imageNormal, Image imageFocused, Image imageActioned, Image imageNormalActioned, boolean state, HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), ""); - toggleGroup = group; + this(imageNormal, imageFocused, imageActioned, imageNormalActioned, state); + setToggleGroup(group); + } + + private void iniz() + { + try { + setLook(getDefaultLook()); + } catch (HInvalidLookException ignored) { + } } public void setToggleGroup(HToggleGroup group) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "setToggleGroup"); + HToggleGroup oldGroup = toggleGroup; + + // Remove ourselves if already a member of a group + if (oldGroup != null) { + // If it is the same, don't do anything. + if (oldGroup == group) + return; + + // Remove ourselves + oldGroup.remove(this); + } + + // Assign the new toggle group toggleGroup = group; + if (group != null) { + group.add(this); + } } public HToggleGroup getToggleGroup() @@ -98,30 +134,28 @@ public void removeToggleGroup() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "removeToggleGroup"); + setToggleGroup(null); } public static void setDefaultLook(HGraphicLook hlook) { - DefaultLook = hlook; + BDJXletContext.setXletDefaultLook(PROPERTY_LOOK, hlook); } public static HGraphicLook getDefaultLook() { - if (DefaultLook == null) - org.videolan.Logger.unimplemented("", "getDefaultLook"); - return DefaultLook; + return (HGraphicLook) BDJXletContext.getXletDefaultLook(PROPERTY_LOOK, DEFAULT_LOOK); } public boolean getSwitchableState() { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "getSwitchableState"); - return true; + return (getInteractionState() & ACTIONED_STATE_BIT) != 0; } public void setSwitchableState(boolean state) { - org.videolan.Logger.unimplemented(HToggleButton.class.getName(), "setSwitchableState"); + int old = getInteractionState(); + setInteractionState(state ? (old | ACTIONED_STATE_BIT) : (old & ~ACTIONED_STATE_BIT)); } public void setUnsetActionSound(HSound sound) @@ -134,8 +168,7 @@ return unsetActionSound; } - private static HGraphicLook DefaultLook = null; - + private static final String PROPERTY_LOOK = "HToggleButton"; private HToggleGroup toggleGroup = null; private HSound unsetActionSound = null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/havi/ui/HToggleGroup.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,55 +19,147 @@ package org.havi.ui; +import java.util.Enumeration; +import java.util.Vector; + public class HToggleGroup { - private HToggleButton current = null; public HToggleGroup() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), ""); } public HToggleButton getCurrent() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "getCurrent"); return current; } public void setCurrent(HToggleButton selection) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setCurrent"); - current = selection; + // Treat null as unselection + if (selection == null) { + HToggleButton tmp = getCurrent(); + if (tmp != null && getForcedSelection() && buttons.size() > 0) { + // Enforce forced selection (reselect button!) + tmp.setSwitchableState(true); + } else { + // General behavior + current = null; + if (tmp != null) tmp.setSwitchableState(false); + } + } + // Set current only if part of this group + // And isn't the current selection (stops infinite loop) + else if (buttons.contains(selection) && getCurrent() != selection) { + current = selection; + selection.setSwitchableState(true); + unswitch(selection); // Enforce single selection + } } public void setForcedSelection(boolean forceSelection) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setForcedSelection"); + this.forceSelection = forceSelection; + + // Enforce new setting + if (forceSelection && getCurrent() == null && buttons.size() > 0) { + forceSelect(); + } } public boolean getForcedSelection() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "getForcedSelection"); - return false; + return forceSelection; } public void setEnabled(boolean enable) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "setEnabled"); + enabled = enable; + for (Enumeration e = buttons.elements(); e.hasMoreElements();) { + setEnabled((HToggleButton) e.nextElement(), enable); + } } public boolean isEnabled() { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "isEnabled"); - return false; + return enabled; } protected void add(HToggleButton button) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "add"); + // Only add if not already added + if (!buttons.contains(button)) { + buttons.addElement(button); + setEnabled(button, isEnabled()); // Enforce enabled state + + // Enforce forced selection (if first addition) + if (getForcedSelection() && buttons.size() == 1 && getCurrent() != button) { + button.setSwitchableState(true); + current = button; + // Assume that if size()>=1 that it's already enforced! + } + // If currently selected, unselect all others! + else if (button.getSwitchableState()) { + current = button; + if (buttons.size() > 1) unswitch(button); // Enforce single + // selection + } + } } protected void remove(HToggleButton button) { - org.videolan.Logger.unimplemented(HToggleGroup.class.getName(), "remove"); + if (!buttons.removeElement(button)) { + throw new IllegalArgumentException("Not a member of this HToggleGroup"); + } else { + if (button == getCurrent()) { + current = null; + if (getForcedSelection() && buttons.size() > 0) { + current = null; + forceSelect(); + } + } + } + } + + + private void unswitch(HToggleButton button) + { + for (Enumeration e = buttons.elements(); e.hasMoreElements();) { + HToggleButton b = (HToggleButton) e.nextElement(); + if (b != button) b.setSwitchableState(false); + } + } + + private void forceSelect() + { + // assert(getCurrent() == null); + if (buttons.size() > 0) { + HToggleButton b = (HToggleButton) buttons.elementAt(0); + b.setSwitchableState(true); + current = b; + } } + + private void setEnabled(HToggleButton tb, boolean enable) + { + if (false) { // If HAVi 1.1 + tb.setEnabled(enable); + } else { + // HAVI 1.01beta + int state = tb.getInteractionState(); + tb.setInteractionState(enable ? (state & ~HState.DISABLED_STATE_BIT) : (state | HState.DISABLED_STATE_BIT)); + } + } + + /** Whether the buttons in this group are enabled or now. */ + private boolean enabled = true; + + /** Controls whether a selection must always be made or not. */ + private boolean forceSelection = false; + + /** The currently selected {@link HToggleButton}. */ + private HToggleButton current = null; + + /** The buttons currently added to this group. */ + private Vector buttons = new Vector(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAction.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJAction.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAction.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJAction.java 2015-02-28 16:45:26.000000000 +0000 @@ -58,11 +58,18 @@ try { doAction(); } catch (Exception e) { - e.printStackTrace(); + System.err.println("action failed: " + e + "\n" + Logger.dumpStack(e)); } synchronized (this) { state = PROCESSED; this.notifyAll(); + } + } + + public void abort() { + synchronized (this) { + state = PROCESSED; + this.notifyAll(); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJActionManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJActionManager.java 2015-05-15 09:25:06.000000000 +0000 @@ -19,24 +19,29 @@ package org.videolan; public class BDJActionManager { - public static BDJActionManager getInstance() { - synchronized (BDJActionManager.class) { - if (instance == null) - instance = new BDJActionManager(); + protected static void createInstance() { + if (running) { + System.err.println("BDJActionManager: manager already running! " + Logger.dumpStack()); + return; } + instance = new BDJActionManager(); + } + + public static BDJActionManager getInstance() { return instance; } public BDJActionManager() { - commandQueue = new BDJActionQueue(); + commandQueue = new BDJActionQueue("BDJActionManager"); } - protected void finalize() throws Throwable { - commandQueue.finalize(); - synchronized (BDJActionManager.class) { - instance = null; + protected static void shutdown() { + try { + instance.commandQueue.shutdown(); + } catch (Exception t) { + } finally { + running = false; } - super.finalize(); } public void putCommand(BDJAction action) { @@ -46,4 +51,5 @@ private BDJActionQueue commandQueue; private static BDJActionManager instance = null; + private static boolean running = false; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJActionQueue.java 2015-05-15 09:25:06.000000000 +0000 @@ -20,25 +20,39 @@ import java.util.LinkedList; -class BDJActionQueue implements Runnable { - public BDJActionQueue() { - this(null); +public class BDJActionQueue implements Runnable { + public BDJActionQueue(String name) { + this(null, name); } - public BDJActionQueue(BDJThreadGroup threadGroup) { + public BDJActionQueue(BDJThreadGroup threadGroup, String name) { + if (threadGroup == null) { + if (BDJXletContext.getCurrentContext() != null) { + logger.error("BDJActionQueue created from wrong context: " + Logger.dumpStack()); + } + } + /* run all actions in given thread group / xlet context */ - thread = new Thread(threadGroup, this); + thread = new Thread(threadGroup, this, name + ".BDJActionQueue"); thread.setDaemon(true); thread.start(); + + watchdog = new Watchdog(name); } - protected void finalize() throws Throwable { + public void shutdown() { + synchronized (actions) { + terminated = true; actions.addLast(null); actions.notifyAll(); } - thread.join(); - super.finalize(); + watchdog.shutdown(); + try { + thread.join(); + } catch (InterruptedException t) { + logger.error("Error joining thread: " + t); + } } public void run() { @@ -56,9 +70,16 @@ if (action == null) return; try { + watchdog.startAction(action); + ((BDJAction)action).process(); + + watchdog.endAction(); + } catch (ThreadDeath d) { + System.err.println("action failed: " + d + "\n"); + throw d; } catch (Throwable e) { - e.printStackTrace(); + System.err.println("action failed: " + e + "\n" + Logger.dumpStack(e)); } } } @@ -66,12 +87,81 @@ public void put(BDJAction action) { if (action != null) { synchronized (actions) { - actions.addLast(action); - actions.notifyAll(); + if (!terminated) { + actions.addLast(action); + actions.notifyAll(); + } else { + logger.error("Action skipped (queue stopped): " + action); + action.abort(); + } } } } + private boolean terminated = false; private Thread thread; private LinkedList actions = new LinkedList(); + + private static final Logger logger = Logger.getLogger(BDJActionQueue.class.getName()); + + /* + * + */ + + private Watchdog watchdog = null; + + class Watchdog implements Runnable { + + private Object currentAction = null; + private boolean terminate = false; + + Watchdog(String name) { + Thread t = new Thread(null, this, name + ".BDJActionQueue.Monitor"); + t.setDaemon(true); + t.start(); + } + + public synchronized void shutdown() { + terminate = true; + notifyAll(); + } + + public synchronized void startAction(Object action) { + currentAction = action; + notifyAll(); + } + + public synchronized void endAction() { + currentAction = null; + notifyAll(); + } + + public void run() { + Object loggedAction = null; + synchronized (this) { + while (!terminate) { + + if (loggedAction != null && currentAction != loggedAction) { + loggedAction = null; + logger.info("Callback returned (" + thread + ")"); + } + + try { + if (currentAction == null) { + wait(); + } else { + Object cachedAction = currentAction; + wait(5000); + if (currentAction == cachedAction && loggedAction != cachedAction) { + logger.error("Callback timeout in " + thread + ", callback=" + currentAction + "\n" + + PortingHelper.dumpStack(thread)); + loggedAction = cachedAction; + } + } + } catch (InterruptedException e) { + } + } + } + } + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java 2015-05-15 09:25:06.000000000 +0000 @@ -29,11 +29,17 @@ import java.util.LinkedList; import javax.tv.xlet.Xlet; -public class BDJAppProxy implements DVBJProxy, Runnable { - public BDJAppProxy(BDJXletContext context) { - this.context = context; - state = NOT_LOADED; - thread = new Thread(context.getThreadGroup(), this); +class BDJAppProxy implements DVBJProxy, Runnable { + protected static BDJAppProxy newInstance(BDJXletContext context) { + BDJAppProxy proxy = new BDJAppProxy(context); + /* do not create and start thread in constructor. + if constructor fails (exception), thread is left running without BDJAppProxy ... */ + proxy.startThread(); + return proxy; + } + + private void startThread() { + thread = new Thread(context.getThreadGroup(), this, "BDJAppProxy"); thread.setDaemon(true); thread.start(); @@ -46,6 +52,11 @@ } } + private BDJAppProxy(BDJXletContext context) { + this.context = context; + state = NOT_LOADED; + } + public int getState() { return state; } @@ -67,11 +78,7 @@ } public void start() { - AppCommand cmd = new AppCommand(AppCommand.CMD_START, null); - synchronized(cmds) { - cmds.addLast(cmd); - cmds.notifyAll(); - } + start(null); } public void start(String[] args) { @@ -122,15 +129,6 @@ } } - protected void syncStop() { - AppCommand cmd = new AppCommand(AppCommand.CMD_STOP, new Boolean(true)); - synchronized(cmds) { - cmds.addLast(cmd); - cmds.notifyAll(); - } - cmd.waitDone(); - } - protected void release() { AppCommand cmd = new AppCommand(AppCommand.CMD_STOP, new Boolean(true)); synchronized(cmds) { @@ -138,13 +136,20 @@ cmds.addLast(null); cmds.notifyAll(); } - try { - thread.join(); - } catch (InterruptedException e) { + if (!cmd.waitDone(5000)) { + logger.error("release(): STOP timeout, killing Xlet " + context.getThreadGroup().getName()); } + final String persistentOrg = System.getProperty("dvb.persistent.root") + File.separator + + (String)context.getXletProperty("dvb.org.id") + File.separator; + final String persistentApp = persistentOrg + (String)context.getXletProperty("dvb.app.id"); + context.release(); + + if (new File(persistentApp).delete()) { + new File(persistentOrg).delete(); + } } public void addAppStateChangeEventListener(AppStateChangeEventListener listener) { @@ -169,7 +174,7 @@ (AppID)context.getXletProperty("org.dvb.application.appid"), fromState, toState, this, hasFailed); for (int i = 0; i < list.size(); i++) - ((AppStateChangeEventListener)listeners.get(i)).stateChange(event); + ((AppStateChangeEventListener)list.get(i)).stateChange(event); } protected BDJXletContext getXletContext() { @@ -183,8 +188,7 @@ state = LOADED; return true; } catch (Throwable e) { - logger.error("doLoad() failed: " + e); - e.printStackTrace(); + logger.error("doLoad() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; } } @@ -204,8 +208,7 @@ state = PAUSED; return true; } catch (Throwable e) { - logger.error("doInit() failed: " + e); - e.printStackTrace(); + logger.error("doInit() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; } } @@ -223,8 +226,7 @@ state = STARTED; return true; } catch (Throwable e) { - logger.error("doStart() failed: " + e); - e.printStackTrace(); + logger.error("doStart() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; } } @@ -238,19 +240,11 @@ try { xlet.destroyXlet(force); + context.closeSockets(); context.getThreadGroup().waitForShutdown(1000, 1 + context.numEventQueueThreads()); - String persistent = System.getProperty("dvb.persistent.root") + File.separator + - (String)context.getXletProperty("dvb.org.id") + File.separator + - (String)context.getXletProperty("dvb.app.id"); - if (new File(persistent).delete()) { - persistent = System.getProperty("dvb.persistent.root") + File.separator + - (String)context.getXletProperty("dvb.org.id"); - new File(persistent).delete(); - } } catch (Throwable e) { - logger.error("doStop() failed: " + e); - e.printStackTrace(); + logger.error("doStop() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; return false; } @@ -267,8 +261,7 @@ state = PAUSED; return true; } catch (Throwable e) { - logger.error("doPause() failed: " + e); - e.printStackTrace(); + logger.error("doPause() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; } } @@ -282,8 +275,7 @@ state = STARTED; return true; } catch (Throwable e) { - logger.error("doResume() failed: " + e); - e.printStackTrace(); + logger.error("doResume() failed: " + e + "\n" + Logger.dumpStack(e)); state = INVALID; } } @@ -291,7 +283,8 @@ } public void run() { - context.setEventQueue(new EventQueue()); + if (context.getEventQueue() == null) + context.setEventQueue(new EventQueue()); for (;;) { AppCommand cmd; @@ -378,16 +371,21 @@ return arg; } - public void waitDone() { + public boolean waitDone(int timeoutMs) { synchronized(this) { while (!done) { try { - this.wait(); + if (timeoutMs < 1) { + this.wait(); + } else { + this.wait(timeoutMs); + break; + } } catch (InterruptedException e) { - } } } + return done; } public void release() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java 2015-02-28 16:45:26.000000000 +0000 @@ -20,9 +20,14 @@ package org.videolan; import java.net.MalformedURLException; + +import java.io.File; +import java.io.InputStream; +import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Enumeration; import javax.tv.xlet.Xlet; @@ -69,14 +74,16 @@ if (protocol == null) return null; url = protocol + - System.getProperty("bluray.vfs.root") + - "/BDMV/JAR/" + url + path.substring(5); + BDJLoader.getCachedFile(System.getProperty("bluray.vfs.root") + File.separator + + "BDMV" + File.separator + + "JAR" + File.separator + + url) + path.substring(5); //if (!url.endsWith("/")) // url += "/"; try { return new URL(url); } catch (MalformedURLException e) { - e.printStackTrace(); + System.err.println("" + e + "\n" + Logger.dumpStack(e)); return null; } } @@ -110,5 +117,44 @@ this.xletClass = xletClass; } + public Class loadClass(String name) throws java.lang.ClassNotFoundException { + /* hook FileSystem in java.io.File */ + if (name.equals("java.io.File")) { + Class c = super.loadClass(name); + if (c != null) { + java.io.BDFileSystem.init(c); + } + return c; + } + return super.loadClass(name); + } + + public URL getResource(String name) { + name = name.replace('\\', '/'); + return super.getResource(name); + } + + /* final in J2ME + public Enumeration getResources(String name) throws IOException { + name = name.replace('\\', '/'); + return super.getResources(name); + } + */ + + public URL findResource(String name) { + name = name.replace('\\', '/'); + return super.findResource(name); + } + + public Enumeration findResources(String name) throws IOException { + name = name.replace('\\', '/'); + return super.findResources(name); + } + + public InputStream getResourceAsStream(String name) { + name = name.replace('\\', '/'); + return super.getResourceAsStream(name); + } + private String xletClass; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJListeners.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJListeners.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJListeners.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJListeners.java 2015-04-06 16:25:09.000000000 +0000 @@ -18,12 +18,16 @@ */ package org.videolan; +import java.util.EventObject; import java.util.Iterator; import java.util.LinkedList; import javax.media.ControllerEvent; import javax.media.ControllerListener; - +import javax.media.GainChangeEvent; +import javax.media.GainChangeListener; +import javax.tv.media.MediaSelectEvent; +import javax.tv.media.MediaSelectListener; import javax.tv.service.selection.ServiceContextEvent; import javax.tv.service.selection.ServiceContextListener; @@ -31,6 +35,8 @@ import org.bluray.media.AngleChangeEvent; import org.bluray.media.AngleChangeListener; +import org.bluray.media.PanningChangeListener; +import org.bluray.media.PanningChangeEvent; import org.bluray.media.PiPStatusEvent; import org.bluray.media.PiPStatusListener; import org.bluray.media.PlaybackListener; @@ -40,9 +46,16 @@ import org.bluray.media.UOMaskTableChangedEvent; import org.bluray.media.UOMaskedEvent; -import org.dvb.media.SubtitleListener; -import java.util.EventObject; +import org.davic.resources.ResourceStatusEvent; +import org.davic.resources.ResourceStatusListener; +import org.dvb.application.AppsDatabaseEvent; +import org.dvb.application.AppsDatabaseEventListener; +import org.dvb.media.SubtitleAvailableEvent; +import org.dvb.media.SubtitleListener; +import org.dvb.media.SubtitleNotAvailableEvent; +import org.dvb.media.SubtitleNotSelectedEvent; +import org.dvb.media.SubtitleSelectedEvent; public class BDJListeners { private LinkedList listeners = new LinkedList(); @@ -71,18 +84,56 @@ } } + public void clear() { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("clear() from wrong thread: " + Logger.dumpStack()); + return; + } + synchronized (listeners) { + listeners.clear(); + } + } + public void putCallback(Object event) { + boolean mediaQueue = true; + /* + if (event instanceof PlaybackMarkEvent) { + } else if (event instanceof PlaybackPlayItemEvent) { + } else if (event instanceof UOMaskTableChangedEvent) { + } else if (event instanceof UOMaskedEvent) { + } else if (event instanceof PiPStatusEvent) { + } else if (event instanceof PanningChangeEvent) { + } else if (event instanceof AngleChangeEvent) { + } else if (event instanceof MediaSelectEvent) { + } else if (event instanceof GainChangeEvent) { + } else if (event instanceof ControllerEvent) { + } + */ + if (event instanceof ServiceContextEvent) { + mediaQueue = false; + } else if (event instanceof ResourceStatusEvent) { + mediaQueue = false; + } else if (event instanceof AppsDatabaseEvent) { + mediaQueue = false; + } else if (event instanceof PSR102Status) { + mediaQueue = false; + } + putCallback(event, mediaQueue); + } + + public void putCallback(Object event, boolean mediaQueue) { synchronized (listeners) { for (Iterator it = listeners.iterator(); it.hasNext(); ) { BDJListener item = (BDJListener)it.next(); - if (item.ctx == null) { - logger.error("Listener callback: no context: " + item.listener); - it.remove(); - } else if (item.ctx.isDestroyed()) { - logger.error("Listener terminated: " + item.ctx); + if (item.ctx == null || item.ctx.isReleased()) { + logger.info("Listener terminated: " + item.ctx); it.remove(); } else { - item.ctx.putCallback(new Callback(event, item.listener)); + if (mediaQueue) { + item.ctx.putMediaCallback(new Callback(event, item.listener)); + } else { + item.ctx.putCallback(new Callback(event, item.listener)); + } } } } @@ -99,7 +150,7 @@ putCallback(new PSR102Status(value)); } - private class BDJListener { + private static class BDJListener { public BDJXletContext ctx; public Object listener; @@ -109,12 +160,16 @@ } } - private class Callback extends BDJAction { + private static class Callback extends BDJAction { private Callback(Object event, Object listener) { this.event = event; this.listener = listener; } + public String toString() { + return this.getClass().getName() + "[event=" + event + ", listener=" + listener; + } + protected void doAction() { if (event instanceof PlaybackMarkEvent) { ((PlaybackListener)listener).markReached((PlaybackMarkEvent)event); @@ -128,15 +183,41 @@ ((UOMaskTableListener)listener).receiveUOMaskedEvent((UOMaskedEvent)event); } else if (event instanceof PiPStatusEvent) { ((PiPStatusListener)listener).piPStatusChange((PiPStatusEvent)event); + } else if (event instanceof PanningChangeEvent) { + ((PanningChangeListener)listener).panningChange((PanningChangeEvent)event); } else if (event instanceof AngleChangeEvent) { ((AngleChangeListener)listener).angleChange((AngleChangeEvent)event); + } else if (event instanceof MediaSelectEvent) { + ((MediaSelectListener)listener).selectionComplete((MediaSelectEvent)event); + } else if (event instanceof GainChangeEvent) { + ((GainChangeListener)listener).gainChange((GainChangeEvent)event); } else if (event instanceof ControllerEvent) { ((ControllerListener)listener).controllerUpdate((ControllerEvent)event); - /* need to use wrapper if some other callback uses EventObject */ - } else if (event instanceof EventObject && - listener instanceof SubtitleListener) { + } else if (event instanceof ResourceStatusEvent) { + ((ResourceStatusListener)listener).statusChanged((ResourceStatusEvent)event); + + } else if (event instanceof AppsDatabaseEvent) { + AppsDatabaseEvent dbevent = (AppsDatabaseEvent)event; + AppsDatabaseEventListener dblistener = (AppsDatabaseEventListener)listener; + switch (dbevent.getEventId()) { + case AppsDatabaseEvent.APP_ADDED: + dblistener.entryAdded(dbevent); + break; + case AppsDatabaseEvent.APP_CHANGED: + dblistener.entryChanged(dbevent); + break; + case AppsDatabaseEvent.APP_DELETED: + dblistener.entryRemoved(dbevent); + break; + case AppsDatabaseEvent.NEW_DATABASE: + dblistener.newDatabase(dbevent); + break; + } + + } else if (event instanceof SubtitleAvailableEvent || event instanceof SubtitleNotAvailableEvent || + event instanceof SubtitleNotSelectedEvent || event instanceof SubtitleSelectedEvent) { ((SubtitleListener)listener).subtitleStatusChanged((EventObject)event); } else if (event instanceof PSR102Status) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJLoader.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJLoader.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJLoader.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJLoader.java 2015-05-15 09:25:06.000000000 +0000 @@ -19,6 +19,8 @@ package org.videolan; +import java.io.File; +import java.io.InputStream; import java.io.InvalidObjectException; import java.util.Enumeration; import org.videolan.Logger; @@ -32,80 +34,97 @@ import javax.media.Manager; import javax.tv.locator.Locator; -import javax.tv.service.SIManager; import org.videolan.bdjo.AppEntry; import org.videolan.bdjo.Bdjo; import org.videolan.bdjo.GraphicsResolution; import org.videolan.bdjo.PlayListTable; import org.videolan.bdjo.TerminalInfo; +import org.videolan.media.content.PlayerManager; public class BDJLoader { - public static boolean load(int title) { - return load(title, true, null); + + /* called by org.dvb.ui.FontFactory */ + public static File addFont(InputStream is) { + VFSCache localCache = vfsCache; + if (localCache != null) { + return localCache.addFont(is); + } + return null; } - public static boolean load(int title, boolean restart, BDJLoaderCallback callback) { - try { - BDLocator locator = new BDLocator(null, title, -1); - return load((TitleImpl)(SIManager.createInstance().getService(locator)), restart, callback); - } catch (Throwable e) { - logger.error("load() failed: " + e); - e.printStackTrace(); - return false; + /* called by org.dvb.ui.FontFactory */ + public static File addFont(String fontFile) { + VFSCache localCache = vfsCache; + if (localCache != null) { + return localCache.addFont(fontFile); } + return null; } - public static boolean load(Locator locator, boolean restart, BDJLoaderCallback callback) { - try { - return load((TitleImpl)(SIManager.createInstance().getService(locator)), restart, callback); - } catch (Throwable e) { - logger.error("load() failed: " + e); - e.printStackTrace(); - return false; + /* called by BDJSecurityManager */ + protected static void accessFile(String file) { + VFSCache localCache = vfsCache; + if (localCache != null) { + localCache.accessFile(file); + } + } + + public static String getCachedFile(String path) { + VFSCache localCache = vfsCache; + if (localCache != null) { + return localCache.map(path); } + return path; } public static boolean load(TitleImpl title, boolean restart, BDJLoaderCallback callback) { + // This method should be called only from ServiceContextFactory + if (title == null) return false; synchronized (BDJLoader.class) { if (queue == null) - queue = new BDJActionQueue(); + queue = new BDJActionQueue(null, "BDJLoader"); } queue.put(new BDJLoaderAction(title, restart, callback)); return true; } - public static boolean unload() { - return unload(null); - } - public static boolean unload(BDJLoaderCallback callback) { + // This method should be called only from ServiceContextFactory + synchronized (BDJLoader.class) { if (queue == null) - queue = new BDJActionQueue(); + queue = new BDJActionQueue(null, "BDJLoader"); } queue.put(new BDJLoaderAction(null, false, callback)); return true; } - public static void shutdown() { - unload(); + protected static void shutdown() { try { - queue.finalize(); + if (queue != null) { + queue.shutdown(); + } } catch (Throwable e) { - logger.error("shutdown() failed: " + e); - e.printStackTrace(); + logger.error("shutdown() failed: " + e + "\n" + Logger.dumpStack(e)); } + queue = null; + vfsCache = null; } private static boolean loadN(TitleImpl title, boolean restart) { + + if (vfsCache == null) { + vfsCache = VFSCache.createInstance(); + } + TitleInfo ti = title.getTitleInfo(); if (!ti.isBdj()) { logger.info("Not BD-J title - requesting HDMV title start"); unloadN(); - return Libbluray.selectTitle(title); + return Libbluray.selectHdmvTitle(title.getTitleNum()); } try { @@ -115,6 +134,11 @@ throw new InvalidObjectException("bdjo not loaded"); AppEntry[] appTable = bdjo.getAppTable(); + // initialize AppCaches + if (vfsCache != null) { + vfsCache.add(bdjo.getAppCaches()); + } + // reuse appProxys BDJAppProxy[] proxys = new BDJAppProxy[appTable.length]; AppsDatabase db = AppsDatabase.getAppsDatabase(); @@ -126,45 +150,54 @@ for (int i = 0; i < appTable.length; i++) { if (id.equals(appTable[i].getIdentifier()) && entry.getInitialClass().equals(appTable[i].getInitialClass())) { - if (restart && appTable[i].getIsServiceBound()) + if (restart && appTable[i].getIsServiceBound()) { + logger.info("Stopping xlet " + appTable[i].getInitialClass() + " (for restart)"); proxy.stop(true); - proxy.getXletContext().update(appTable[i], bdjo.getAppCaches()); - proxys[i] = proxy; - proxy = null; + } else { + logger.info("Keeping xlet " + appTable[i].getInitialClass()); + proxy.getXletContext().update(appTable[i], bdjo.getAppCaches()); + proxys[i] = proxy; + proxy = null; + } break; } } - if (proxy != null) + if (proxy != null) { + logger.info("Terminating xlet " + (entry == null ? "?" : entry.getInitialClass())); proxy.release(); + } } // start bdj window GUIManager gui = GUIManager.createInstance(); TerminalInfo terminfo = bdjo.getTerminalInfo(); GraphicsResolution res = terminfo.getResolution(); + gui.setDefaultFont(terminfo.getDefaultFont()); gui.setResizable(true); gui.setSize(res.getWidth(), res.getHeight()); gui.setVisible(true); Libbluray.setUOMask(terminfo.getMenuCallMask(), terminfo.getTitleSearchMask()); + Libbluray.setKeyInterest(bdjo.getKeyInterestTable()); // initialize appProxys for (int i = 0; i < appTable.length; i++) { if (proxys[i] == null) { - proxys[i] = new BDJAppProxy( + proxys[i] = BDJAppProxy.newInstance( new BDJXletContext( appTable[i], bdjo.getAppCaches(), gui)); + /* log startup class, startup parameters and jar file */ + String[] params = appTable[i].getParams(); + String p = ""; + if (params != null && params.length > 0) { + p = "(" + StrUtil.Join(params, ",") + ")"; + } + logger.info("Loaded class: " + appTable[i].getInitialClass() + p + " from " + appTable[i].getBasePath() + ".jar"); + } else { + logger.info("Reused class: " + appTable[i].getInitialClass() + " from " + appTable[i].getBasePath() + ".jar"); } - - /* log startup calss, startup parameters and jar file */ - String[] params = appTable[i].getParams(); - String p = ""; - if (params != null && params.length > 0) { - p = "(" + StrUtil.Join(params, ",") + ")"; - } - logger.info("Loaded class: " + appTable[i].getInitialClass() + p + " from " + appTable[i].getBasePath() + ".jar"); } // change psr @@ -201,8 +234,7 @@ return true; } catch (Throwable e) { - logger.error("loadN() failed: " + e); - e.printStackTrace(); + logger.error("loadN() failed: " + e + "\n" + Logger.dumpStack(e)); unloadN(); return false; } @@ -210,22 +242,35 @@ private static boolean unloadN() { try { + try { + GUIManager.getInstance().setVisible(false); + } catch (Error e) { + } + AppsDatabase db = AppsDatabase.getAppsDatabase(); + + /* stop xlets first */ Enumeration ids = db.getAppIDs(new CurrentServiceFilter()); while (ids.hasMoreElements()) { AppID id = (AppID)ids.nextElement(); BDJAppProxy proxy = (BDJAppProxy)db.getAppProxy(id); + proxy.stop(true); + } + + ids = db.getAppIDs(new CurrentServiceFilter()); + while (ids.hasMoreElements()) { + AppID id = (AppID)ids.nextElement(); + BDJAppProxy proxy = (BDJAppProxy)db.getAppProxy(id); proxy.release(); } + ((BDJAppsDatabase)db).newDatabase(null, null); - //GUIManager.shutdown() does not work with J2ME (window can't be opened again) - GUIManager.getInstance().setVisible(false); + PlayerManager.getInstance().releaseAllPlayers(true); return true; } catch (Throwable e) { - logger.error("unloadN() failed: " + e); - e.printStackTrace(); + logger.error("unloadN() failed: " + e + "\n" + Logger.dumpStack(e)); return false; } } @@ -255,4 +300,5 @@ private static final Logger logger = Logger.getLogger(BDJLoader.class.getName()); private static BDJActionQueue queue = null; + private static VFSCache vfsCache = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppCache.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppCache.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppCache.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppCache.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,5 +1,23 @@ -package org.videolan.bdjo; +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ +package org.videolan.bdjo; public class AppCache { public AppCache(int type, String refToName, String language) diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppEntry.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; import java.util.BitSet; @@ -81,6 +100,7 @@ } public Locator getServiceLocator() { + org.videolan.Logger.unimplemented("AppEntry","getServiceLocator"); /* try { String discID = BDJTitleInfoHelper.getCurrent32LengthDiscIDFromC(); @@ -157,6 +177,10 @@ this.classpathExt = classpathExt; this.initialClass = initialClass; this.params = params; + + if ((binding & (DISC_BOUND | TITLE_BOUND)) == 0) { + System.err.println("Disc unbound application: " + initialClass); + } } public int getControlCode() { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppProfile.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppProfile.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/AppProfile.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/AppProfile.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; public class AppProfile { @@ -8,22 +27,22 @@ this.minor = minor; this.micro = micro; } - + public short getProfile() { return profile; } - + public byte getMajor() { return major; } - + public byte getMinor() { return minor; } - + public byte getMicro() { return micro; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/Bdjo.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/Bdjo.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/Bdjo.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/Bdjo.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; import org.videolan.Arrays; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/GraphicsResolution.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/GraphicsResolution.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/GraphicsResolution.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/GraphicsResolution.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; public class GraphicsResolution { @@ -9,7 +28,7 @@ public static final GraphicsResolution QHD_960_540 = new GraphicsResolution(6, 960, 540); GraphicsResolution(int id, int width, int height) -{ + { this.id = id; this.width = width; this.height = height; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/PlayListTable.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/PlayListTable.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/PlayListTable.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/PlayListTable.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; import org.videolan.Arrays; @@ -9,17 +28,17 @@ this.autostartFirst = autostartFirst; this.playLists = playLists; } - + public boolean isAccessToAll() { return accessToAll; } - + public boolean isAutostartFirst() { return autostartFirst; } - + public String[] getPlayLists() { return playLists; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/TerminalInfo.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/TerminalInfo.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/bdjo/TerminalInfo.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/bdjo/TerminalInfo.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + package org.videolan.bdjo; public class TerminalInfo { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java 2015-04-15 08:30:17.000000000 +0000 @@ -0,0 +1,284 @@ +/* + * This file is part of libbluray + * Copyright (C) 2015 Petri Hintukainen + * + * 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 + * . + */ + + +package org.videolan; + +import java.io.FilePermission; +import java.io.File; +import java.util.PropertyPermission; +import java.security.AccessController; +import java.security.Permission; +import java.security.PrivilegedAction; + +final class BDJSecurityManager extends SecurityManager { + + private String discRoot; + private String cacheRoot; + private String budaRoot; + private String persistentRoot; + private boolean usingUdf = false; + + BDJSecurityManager(String discRoot, String persistentRoot, String budaRoot) { + this.discRoot = discRoot; + this.cacheRoot = null; + this.budaRoot = budaRoot; + this.persistentRoot = persistentRoot; + if (discRoot == null) { + usingUdf = true; + } + } + + protected void setCacheRoot(String root) { + if (cacheRoot != null) { + // limit only + if (!root.startsWith(cacheRoot)) { + logger.error("setCacheRoot(" + root + ") denied\n" + Logger.dumpStack()); + throw new SecurityException("cache root already set"); + } + } + cacheRoot = root; + } + + /* + * + */ + + private void deny(Permission perm) { + logger.error("denied " + perm + "\n" + Logger.dumpStack()); + throw new SecurityException("denied " + perm); + } + + public void checkPermission(Permission perm) { + if (perm instanceof RuntimePermission) { + if (perm.implies(new RuntimePermission("createSecurityManager"))) { + deny(perm); + } + if (perm.implies(new RuntimePermission("setSecurityManager"))) { + if (classDepth("org.videolan.Libbluray") == 3) { + return; + } + deny(perm); + } + if (perm.implies(new RuntimePermission("modifyThreadGroup"))) { + /* do check here (no need to log failures) */ + super.checkPermission(perm); + } + } + + else if (perm instanceof PropertyPermission) { + // allow read + if (perm.getActions().equals("read")) { + String prop = perm.getName(); + if (prop.startsWith("bluray.") || prop.startsWith("dvb.") || prop.startsWith("mhp.") || prop.startsWith("aacs.")) { + //logger.info(perm + " granted"); + return; + } + if (prop.startsWith("user.dir")) { + //logger.info(perm + " granted\n" + Logger.dumpStack()); + return; + } + } + try { + super.checkPermission(perm); + } catch (Exception e) { + logger.info(perm + " denied by system"); + throw new SecurityException("denied " + perm); + } + } + + else if (perm instanceof FilePermission) { + /* grant delete for writable files */ + if (perm.getActions().equals("delete")) { + checkWrite(perm.getName()); + return; + } + /* grant read access to BD files */ + if (perm.getActions().equals("read")) { + String file = getCanonPath(perm.getName()); + if (canRead(file)) { + if (usingUdf) { + BDJLoader.accessFile(file); + } + return; + } + } + } + + /* Networking */ + else if (perm instanceof java.net.SocketPermission) { + if (new java.net.SocketPermission("*", "connect,resolve").implies(perm)) { + return; + } + } + + /* Java TV */ + else if (perm instanceof javax.tv.service.ReadPermission) { + return; + } + else if (perm instanceof javax.tv.service.selection.ServiceContextPermission) { + return; + } + else if (perm instanceof javax.tv.service.selection.SelectPermission) { + return; + } + else if (perm instanceof javax.tv.media.MediaSelectPermission) { + return; + } + + /* DVB */ + else if (perm instanceof org.dvb.application.AppsControlPermission) { + return; + } + else if (perm instanceof org.dvb.media.DripFeedPermission) { + return; + } + else if (perm instanceof org.dvb.user.UserPreferencePermission) { + return; + } + + /* bluray */ + else if (perm instanceof org.bluray.vfs.VFSPermission) { + return; + } + + try { + java.security.AccessController.checkPermission(perm); + } catch (java.security.AccessControlException ex) { + System.err.println(" *** caught " + ex + " at\n" + Logger.dumpStack()); + throw ex; + } + } + + /* + * + */ + + public void checkExec(String cmd) { + logger.error("Exec(" + cmd + ") denied\n" + Logger.dumpStack()); + throw new SecurityException("exec denied"); + } + + public void checkExit(int status) { + logger.error("Exit(" + status + ") denied\n" + Logger.dumpStack()); + throw new SecurityException("exit denied"); + } + + /* + * file read access + */ + + private boolean canRead(String file) { + + if (cacheRoot != null && file.startsWith(cacheRoot)) { + return true; + } + if (discRoot != null && file.startsWith(discRoot)) { + return true; + } + if (budaRoot != null && file.startsWith(budaRoot)) { + return true; + } + if (persistentRoot != null && file.startsWith(persistentRoot)) { + return true; + } + + return false; + } + + /* + * File write access + */ + + private boolean canWrite(String file) { + + // Xlet can write to persistent storage and binding unit + + if (budaRoot != null && file.startsWith(budaRoot)) { + return true; + } + if (persistentRoot != null && file.startsWith(persistentRoot)) { + return true; + } + + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx != null) { + logger.error("Xlet write " + file + " denied at\n" + Logger.dumpStack()); + return false; + } + + // BD-J core can write to cache + if (cacheRoot != null && file.startsWith(cacheRoot)) { + return true; + } + + logger.error("BD-J write " + file + " denied at\n" + Logger.dumpStack()); + return false; + } + + public void checkWrite(String file) { + file = getCanonPath(file); + if (canWrite(file)) { + return; + } + + throw new SecurityException("write access denied"); + } + + private String getCanonPath(String origPath) + { + String suffix = ""; + + if (!java.io.BDFileSystem.isAbsolutePath(origPath)) { + String home = BDJXletContext.getCurrentXletHome(); + if (home == null) { + logger.error("Relative path " + origPath + " outside Xlet context\n" + Logger.dumpStack()); + return origPath; + } + origPath = home + origPath; + } + + if (origPath.endsWith(File.separator + "*")) { + suffix = File.separator + "*"; + origPath = origPath.substring(0, origPath.length() - 2); + } + + final String path = origPath; + String cpath = (String)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + return new File(path).getCanonicalPath(); + } catch (Exception ioe) { + logger.error("error canonicalizing " + path + ": " + ioe); + return null; + } + } + }); + if (cpath == null) { + throw new SecurityException("cant canonicalize " + path); + } + return cpath + suffix; + } + + /* + * + */ + + private static final Logger logger = Logger.getLogger(BDJSecurityManager.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSocketFactory.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSocketFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSocketFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSocketFactory.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.io.IOException; + +import java.lang.reflect.Constructor; + +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketImpl; +import java.net.SocketImplFactory; + +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +class BDJSocketFactory implements SocketImplFactory { + + protected static void init() { + try { + Socket.setSocketImplFactory(new BDJSocketFactory(false)); + ServerSocket.setSocketFactory(new BDJSocketFactory(true)); + } catch (IOException e) { + logger.error("Failed to hook SocketFactory: " + e); + } + } + + private BDJSocketFactory(boolean server) { + this.server = server; + } + + private SocketImpl newSocket() { + try { + return (SocketImpl)AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Object run() throws Exception { + Class defaultSocketImpl = Class.forName("java.net.SocksSocketImpl"); + Constructor constructor = defaultSocketImpl.getDeclaredConstructor/*s*/(new Class[0])/*[0]*/; + constructor.setAccessible(true); + return constructor.newInstance(new Object[0]); + } + }); + } catch (PrivilegedActionException e) { + logger.error("Failed to create socket: " + e.getException() + " at " + Logger.dumpStack()); + throw new RuntimeException(e.getException()); + } + } + + public SocketImpl createSocketImpl() { + + if (server) { + logger.error("Xlet tried to create server socket"); + throw new RuntimeException("server sockets disabled"); + } + + SocketImpl socket = newSocket(); + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx != null) { + logger.info("Xlet " + ctx + " created new socket"); + ctx.addSocket(socket); + } else { + logger.error("New socket created outside of Xlet context: " + Logger.dumpStack()); + } + return socket; + } + + private boolean server = false; + + private static final Logger logger = Logger.getLogger(BDJSocketFactory.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSockets.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSockets.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJSockets.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJSockets.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.lang.reflect.Method; + +import java.util.Iterator; +import java.util.LinkedList; + +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +import java.net.Socket; +import java.net.SocketImpl; + +class BDJSockets { + + protected BDJSockets() { + } + + protected synchronized void add(Object obj) { + if (!(obj instanceof SocketImpl)) { + logger.error("expected SocketImpl, got " + obj); + throw new Error("expected SocketImpl"); + } + + if (closed) { + logger.error("Terminated Xlet tried to create socket at " + Logger.dumpStack()); + throw new Error("Terminated Xlet can not create sockets"); + } + + /* drop closed sockets */ + for (Iterator it = sockets.iterator(); it.hasNext(); ) { + SocketImpl socketImpl = (SocketImpl)it.next(); + Socket socket = getSocket(socketImpl); + if (socket != null && socket.isClosed()) { + it.remove(); + } + } + + sockets.addLast(obj); + } + + protected synchronized void closeAll() { + closed = true; + + while (!sockets.isEmpty()) { + SocketImpl socketImpl = (SocketImpl)sockets.removeFirst(); + Socket socket = getSocket(socketImpl); + if (socket != null && !socket.isClosed()) { + logger.warning("Closing " + socket); + try { + socket.close(); + } catch (Exception e) { + logger.error("Failed to close socket: " + e); + } + } + } + } + + private Socket getSocket(SocketImpl socketImpl) { + try { + final SocketImpl si = socketImpl; + return (Socket)AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Object run() throws Exception { + Method getSocket = SocketImpl.class.getDeclaredMethod("getSocket", new Class[0]); + getSocket.setAccessible(true); + return getSocket.invoke(si, new Object[0]); + } + }); + } catch (PrivilegedActionException e) { + logger.error("Failed to get Socket: " + e.getException() + " at " + Logger.dumpStack()); + return null; + } + } + + private LinkedList sockets = new LinkedList(); + private boolean closed = false; + + private static final Logger logger = Logger.getLogger(BDJSockets.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java 2015-02-28 19:23:41.000000000 +0000 @@ -27,6 +27,24 @@ this.context = context; } + public void uncaughtException(Thread t, Throwable e) { + + String stack = ""; + if (e != null) { + StackTraceElement elems[] = e.getStackTrace(); + if (elems != null) { + for (int i = 0; i < elems.length; i++) + stack += "\n\t" + elems[i].toString(); + } + } + + if (e instanceof ThreadDeath) { + logger.error("Thread " + t + " killed" + stack); + } else { + logger.error("Unhandled exception in thread " + t + ": " + e + stack); + } + } + public BDJXletContext getContext() { return context; } @@ -35,9 +53,15 @@ this.context = context; } - public boolean waitForShutdown(int maxThreads, int timeout) { + public boolean waitForShutdown(int timeout, int maxThreads) { + + if (parentOf(Thread.currentThread().getThreadGroup()) && maxThreads < 1) { + logger.error("Current Thread is contained within ThreadGroup to be disposed."); + throw new IllegalThreadStateException("Current Thread is contained within ThreadGroup to be disposed."); + } + long startTime = System.currentTimeMillis(); - long endTime = startTime + 1000; + long endTime = startTime + timeout; while ((activeCount() > maxThreads) && (System.currentTimeMillis() < endTime)) { try { @@ -47,7 +71,7 @@ boolean result = (activeCount() <= maxThreads); if (!result) { - logger.error("waitForShutdown timeout"); + logger.error("waitForShutdown timeout (have " + activeCount() + " threads, expected " + maxThreads + ")"); } return result; } @@ -55,14 +79,14 @@ protected void stopAll(int timeout) { interrupt(); - waitForShutdown(0, timeout); + waitForShutdown(timeout, 0); if (activeCount() > 0) { logger.error("stopAll(): killing threads"); dumpThreads(); PortingHelper.stopThreadGroup(this); - waitForShutdown(0, 500); + waitForShutdown(500, 0); } try { @@ -84,6 +108,10 @@ if (threads[i] == null) continue; logger.info(" " + threads[i]); + /* no getState() in J2ME + logger.info(" state " + threads[i].getState().toString()); + */ + logger.info(" at " + PortingHelper.dumpStack(threads[i])); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJXletContext.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJXletContext.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BDJXletContext.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BDJXletContext.java 2015-05-15 09:25:06.000000000 +0000 @@ -21,7 +21,10 @@ import java.awt.Container; import java.awt.EventQueue; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.LinkedList; +import java.util.HashMap; import java.security.AccessController; import java.security.PrivilegedAction; @@ -51,7 +54,42 @@ entry.getInitialClass(), this); - callbackQueue = new BDJActionQueue(this.threadGroup); + callbackQueue = new BDJActionQueue(this.threadGroup, "CallbackQueue"); + mediaQueue = new BDJActionQueue(this.threadGroup, "MediaQueue"); + userEventQueue = new BDJActionQueue(this.threadGroup, "UserEventQueue"); + + mountHomeDir(entry); + } + + private void mountHomeDir(AppEntry entry) { + String home = entry.getBasePath(); + if (home.length() > 5) { + // TODO: may be located deeper inside jar, not root ? + logger.error("Unhandled home directory: " + home); + } + try { + int homeJarID = Integer.parseInt(home); + long time = System.currentTimeMillis(); + homeMountPoint = MountManager.mount(homeJarID, false) + java.io.File.separator; + time = System.currentTimeMillis() - time; + logger.info("Mounted Xlet home directory from " + home + ".jar " + + "to " + homeMountPoint + "(" + time + "ms)"); + } catch (Exception ex) { + logger.error("Failed mounting " + home + ".jar:" + ex); + } + } + + public String getXletHome() { + return homeMountPoint; + } + + public static String getCurrentXletHome() { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("getCurrentXletHome(): no context: " + Logger.dumpStack()); + return null; + } + return ctx.getXletHome(); } public Object getXletProperty(String key) { @@ -93,22 +131,65 @@ return container; } + /* + * Class loader + */ + public ClassLoader getClassLoader() { return loader; } + public static ClassLoader getCurrentClassLoader() { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("getCurrentClassLoader(): no context: " + Logger.dumpStack()); + return null; + } + + ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); + if (cldr == null) { + logger.error("getCurrentClassLoader(): no class loader: " + Logger.dumpStack()); + return null; + } + + return cldr; + } + + /* + * + */ + protected AppProxy getAppProxy() { return AppsDatabase.getAppsDatabase().getAppProxy(appid); } + public boolean isReleased() { + return released; + } + + /* public boolean isDestroyed() { - return AppsDatabase.getAppsDatabase().getAppProxy(appid).getState() == AppProxy.DESTROYED; + if (released) + return true; + AppProxy proxy = AppsDatabase.getAppsDatabase().getAppProxy(appid); + return proxy == null || proxy.getState() == AppProxy.DESTROYED; } + */ public BDJThreadGroup getThreadGroup() { return threadGroup; } + public String toString() { + BDJThreadGroup localGroup = threadGroup; + String groupName = localGroup == null ? "" : localGroup.getName(); + return super.toString() + "[name=" + groupName + ", released=" + released + "]"; + } + + /* + * Event queues + */ + protected void setEventQueue(EventQueue eq) { eventQueue = eq; } @@ -117,13 +198,40 @@ return eventQueue; } - public boolean putCallback(BDJAction cb) + /* must be called from synchronized (this) {} */ + private boolean putCallbackImpl(BDJAction cb, BDJActionQueue queue) { - if (!isDestroyed()) { - callbackQueue.put(cb); - return true; + if (isReleased()) { + logger.error("callback ignored (xlet destroyed)"); + return false; + } + if (queue == null) { + logger.error("callback ignored (no queue)"); + return false; + } + queue.put(cb); + return true; + } + + protected boolean putCallback(BDJAction cb) + { + synchronized (this) { + return putCallbackImpl(cb, callbackQueue); + } + } + + protected boolean putMediaCallback(BDJAction cb) + { + synchronized (this) { + return putCallbackImpl(cb, mediaQueue); + } + } + + public boolean putUserEvent(BDJAction cb) + { + synchronized (this) { + return putCallbackImpl(cb, userEventQueue); } - return false; } protected int numEventQueueThreads() { @@ -134,9 +242,17 @@ cnt++; } } + if (!released) { + // callbackQueue, userEventQueue, mediaQueue + cnt += 3; + } return cnt; } + /* + * HAVI + */ + public void setSceneFactory(HSceneFactory f) { sceneFactory = f; } @@ -145,6 +261,65 @@ return sceneFactory; } + public static Object getXletDefaultLook(String key, Class defClass) { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("getDefaultLook(): no context: " + Logger.dumpStack()); + return null; + } + return ctx.getDefaultLook(key, defClass); + } + + public static void setXletDefaultLook(String key, Object look) { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx == null) { + logger.error("setDefaultLook(): no context: " + Logger.dumpStack()); + return; + } + ctx.setDefaultLook(key, look); + } + + private Object getDefaultLook(String key, Class defClass) { + Object look = null; + synchronized (defaultLooks) { + look = defaultLooks.get(key); + if (look == null) { + try { + look = defClass.newInstance(); + setDefaultLook(key, look); + } catch (Exception t) { + logger.error("Error creating default look " + defClass.getName() + " for " + key + ": " + t); + } + } + } + return look; + } + + private void setDefaultLook(String key, Object look) { + synchronized (defaultLooks) { + defaultLooks.remove(key); + if (look != null) { + defaultLooks.put(key, look); + } + } + } + + /* + * sockets + */ + + protected void addSocket(Object socket) { + sockets.add(socket); + } + + protected void closeSockets() { + sockets.closeAll(); + } + + /* + * Ixc + */ + protected void addIxcThread(Thread thread) { synchronized (ixcThreads) { ixcThreads.addLast(thread); @@ -155,26 +330,55 @@ ixcThreads.remove(thread); } } - protected void stopIxcThreads() { - synchronized (ixcThreads) { - while (!ixcThreads.isEmpty()) { - Thread thread = (Thread)ixcThreads.removeFirst(); - logger.info("Stopping remote thread " + thread); - thread.interrupt(); - try { - thread.join(500); - } catch (Throwable t) { - } - if (thread.isAlive()) { - PortingHelper.stopThread(thread); - } - if (thread.isAlive()) { - logger.error("Error stopping remote thread " + thread); + + private static boolean waitThread(Thread thread, int timeout) { + long startTime = System.currentTimeMillis(); + long endTime = startTime + timeout; + while (thread.isAlive() && (System.currentTimeMillis() < endTime)) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { } + } + + boolean result = !thread.isAlive(); + if (!result) { + logger.error("waitThread timeout: " + thread); + } + return result; + } + + protected static void stopThread(Thread thread, int timeout, String type) { + if (!waitThread(thread, timeout)) { + thread.interrupt(); + if (!waitThread(thread, 200)) { + PortingHelper.stopThread(thread); + logger.error("killing " + type + " thread " + thread); + } + } + try { + thread.join(); + } catch (InterruptedException e) { } + } + + private void stopIxcThreads() { + while (true) { + Thread thread; + synchronized (ixcThreads) { + if (ixcThreads.isEmpty()) { + break; } + thread = (Thread)ixcThreads.removeFirst(); } + logger.info("Stopping remote thread " + thread); + stopThread(thread, 1000, "Ixc"); + removeIxcThread(thread); } } + /* + * Frame-accurate animations + */ + public void addFAA(FrameAccurateAnimation faa) { synchronized (faaList) { faaList.add(faa); @@ -187,7 +391,7 @@ } } - public void removeAllFAA() { + private void removeAllFAA() { Object[] faaArray; synchronized (faaList) { faaArray = faaList.toArray(); @@ -198,6 +402,10 @@ } } + /* + * + */ + public static BDJXletContext getCurrentContext() { Object obj = AccessController.doPrivileged( new PrivilegedAction() { @@ -229,8 +437,10 @@ protected void release() { + closeSockets(); removeAllFAA(); stopIxcThreads(); + defaultLooks.clear(); org.dvb.io.ixc.IxcRegistry.unbindAll(this); @@ -239,12 +449,9 @@ sceneFactory = null; } - try { - callbackQueue.finalize(); - } catch (Throwable t) { - } finally { - //callbackQueue = null; - } + callbackQueue.shutdown(); + userEventQueue.shutdown(); + mediaQueue.shutdown(); EventQueue eq = eventQueue; eventQueue = null; @@ -254,13 +461,36 @@ threadGroup.stopAll(1000); - threadGroup = null; - loader = null; - container = null; + try { + Method m; + m = loader.getClass().getMethod("close", new Class[0]); + m.invoke(loader, new Object[0]); + } catch (NoSuchMethodException e) { + } catch (IllegalAccessException e) { + } catch (IllegalArgumentException e) { + } catch (InvocationTargetException e) { + } + + synchronized (this) { + threadGroup = null; + loader = null; + container = null; + callbackQueue = null; + userEventQueue = null; + mediaQueue = null; + defaultLooks = null; + released = true; + } + + // Do not unmount home directory here, it is likely to be used multiple times during disc playback. + // All .jars are unmounted at BD-J shutdown. + //MountManager.unmount(homeJarID); } + private boolean released = false; private String[] args; private AppID appid; + private String homeMountPoint = null; private BDJClassLoader loader; private Container container; private EventQueue eventQueue = null; @@ -268,6 +498,10 @@ private BDJThreadGroup threadGroup = null; private LinkedList ixcThreads = new LinkedList(); private LinkedList faaList = new LinkedList(); + private BDJSockets sockets = new BDJSockets(); + private HashMap defaultLooks = new HashMap(); private BDJActionQueue callbackQueue; + private BDJActionQueue userEventQueue; + private BDJActionQueue mediaQueue; private static final Logger logger = Logger.getLogger(BDJXletContext.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BUMFAsset.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BUMFAsset.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BUMFAsset.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BUMFAsset.java 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +public class BUMFAsset { + public BUMFAsset(String vpFile, String budaFile) { + this.vpFile = vpFile; + this.budaFile = budaFile; + } + + public String getVpFile() { + return vpFile; + } + + public String getBudaFile() { + return budaFile; + } + + private String vpFile; + private String budaFile; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BUMFParser.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BUMFParser.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/BUMFParser.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/BUMFParser.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.io.FileInputStream; +import java.util.LinkedList; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class BUMFParser extends DefaultHandler { + + public static BUMFAsset[] parse(String manifestFile) { + try { + return new BUMFParser(manifestFile).getAssets(); + } catch (Exception e) { + } + return null; + } + + /* + * + */ + + private BUMFAsset[] getAssets() { + return (BUMFAsset[])assets.toArray(new BUMFAsset[assets.size()]); + } + + private BUMFParser(String manifestFile) throws Exception { + + FileInputStream stream = null; + try { + stream = new FileInputStream(manifestFile); + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + parser.parse(stream, this); + } catch (Exception e) { + logger.error("Binding unit manifest file parsing failed: " + e); + throw e; + } finally { + if (stream != null) { + try { + stream.close(); + } catch (Exception e) { + } + } + } + } + + private LinkedList assets = new LinkedList(); + + /* + * + */ + + public void startElement (String uri, String localName, String qName, Attributes attributes) + throws SAXException { + + if (qName.equalsIgnoreCase("bumf:manifest")) { + inBudaFile = true; + return; + } + + if (!inBudaFile) { + logger.error("invalid start element: " + qName); + throw new SAXException("element not supported"); + } + + if (qName.equalsIgnoreCase("Assets")) { + inDocument = true; + return; + } + + if (!inDocument) { + logger.error("unknown element: " + qName + " (expected Assets)"); + throw new SAXException("element not supported"); + } + + if (qName.equalsIgnoreCase("Asset")) { + vpFile = null; + budaFile = null; + element = ELEMENT_ASSET; + } else if (qName.equalsIgnoreCase("BUDAFile")) { + element = ELEMENT_BUDA_FILE; + } else { + logger.error("unknown element: " + qName); + throw new SAXException("element not supported"); + } + + if (element == ELEMENT_ASSET) { + for (int i = 0; i < attributes.getLength(); i++) { + String attrName = attributes.getQName(i); + if (attrName.equals("VPFilename")) { + vpFile = attributes.getValue(i); + } else { + logger.error("unknown VPFilename attribute: " + attrName); + throw new SAXException("invalid attribute name: " + attrName); + } + } + } else if (element == ELEMENT_BUDA_FILE) { + for (int i = 0; i < attributes.getLength(); i++) { + String attrName = attributes.getQName(i); + if (attrName.equals("name")) { + budaFile = attributes.getValue(i); + } else { + logger.error("unknown BUDAFile attribute: " + attrName); + throw new SAXException("invalid attribute name: " + attrName); + } + } + } + } + + public void endElement (String uri, String localName, String qName) + throws SAXException { + + if (qName.equalsIgnoreCase("Assets")) { + inDocument = false; + return; + } + + if (inDocument) { + if (qName.equalsIgnoreCase("Asset")) { + logger.info("Asset: " + vpFile + " <- " + budaFile); + if (vpFile != null && budaFile != null) { + assets.add(new BUMFAsset(vpFile, budaFile)); + } + vpFile = null; + budaFile = null; + } + } + element = ELEMENT_NONE; + } + + private static final int ELEMENT_NONE = 0; + private static final int ELEMENT_ASSET = 1; + private static final int ELEMENT_BUDA_FILE = 2; + + private boolean inBudaFile = false; + private boolean inDocument = false; + private int element = ELEMENT_NONE; + + private String vpFile = null; + private String budaFile = null; + + private static final Logger logger = Logger.getLogger(BUMFParser.class.getName()); +} + + + + diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/CacheDir.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/CacheDir.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/CacheDir.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/CacheDir.java 2015-03-20 10:51:10.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.io.File; +import java.io.IOException; + +import java.io.BDFileSystem; + +class CacheDir { + + private static LockFile lockCache(String path) { + return LockFile.create(path + File.separator + "lock"); + } + + private static void InitializeBaseDir() throws IOException { + if (baseDir == null) { + try { + File tmpDir = new File(System.getProperty("java.io.tmpdir"), "libbluray-bdj-cache"); + baseDir = new File(tmpDir.getCanonicalPath()); + } + catch (IOException e) { + logger.error("Error in initializing baseDir " + e); + throw e; + } + } + } + + private static void cleanupCache() throws IOException { + InitializeBaseDir(); + String[] files = BDFileSystem.nativeList(baseDir); + if (files != null) { + for (int i = 0; i < files.length; i++) { + File dir = new File(baseDir, files[i]); + if (dir.isDirectory()) { + LockFile lock = lockCache(dir.getPath()); + if (lock != null) { + lock.release(); + removeImpl(dir); + } + } + } + } + } + + private static synchronized File getCacheRoot() throws IOException { + + if (cacheRoot != null) { + return cacheRoot; + } + + BDJSecurityManager sm = (BDJSecurityManager)System.getSecurityManager(); + if (sm != null) { + InitializeBaseDir(); + File tmpDir = new File(System.getProperty("java.io.tmpdir")); + sm.setCacheRoot(tmpDir.getCanonicalPath()); + baseDir.mkdirs(); + sm.setCacheRoot(baseDir.getCanonicalPath()); + } + + cleanupCache(); + + for (int i = 0; i < 100; i++) { + File tmpDir = new File(baseDir, "" + System.nanoTime()); + tmpDir = new File(tmpDir.getCanonicalPath()); + + if (tmpDir.mkdirs()) { + cacheRoot = tmpDir; + lockFile = lockCache(cacheRoot.getPath()); + logger.info("Created cache in " + tmpDir.getPath()); + + if (sm != null) { + sm.setCacheRoot(cacheRoot.getPath()); + } + + return cacheRoot; + } + logger.error("error creating " + tmpDir.getPath()); + } + + logger.error("failed to create temporary cache directory"); + throw new IOException(); + } + + public static synchronized File create(String domain) throws IOException { + + File tmpDir = new File(getCacheRoot(), domain); + if (!tmpDir.exists() && !tmpDir.mkdirs()) { + logger.error("Error creating " + tmpDir.getPath()); + throw new IOException(); + } + + return tmpDir; + } + + public static File create(String domain, String name) throws IOException { + return create(domain + File.separator + name); + } + + private static void removeImpl(File dir) { + String[] files = BDFileSystem.nativeList(dir); + if (files != null) { + for (int i = 0; i < files.length; i++) { + File file = new File(dir, files[i]); + if (file.isDirectory()) { + removeImpl(file); + } else { + if (!file.delete()) { + logger.info("Error removing " + file.getPath()); + } + } + } + } + + if (!dir.delete()) { + logger.error("Error removing " + dir.getPath()); + } + } + + public static synchronized void remove(File dir) { + String path = dir.getPath(); + if (path.indexOf(cacheRoot.getPath()) != 0) { + logger.error("Error removing " + dir.getPath() + ": not inside cache !"); + return; + } + if (path.indexOf("..") >= 0) { + logger.error("Error removing " + dir.getPath() + ": not canonical path !"); + return; + } + + removeImpl(dir); + } + + public static synchronized void remove() { + + if (lockFile != null) { + lockFile.release(); + lockFile = null; + } + + if (cacheRoot != null) { + remove(cacheRoot); + cacheRoot = null; + } + } + + private static File cacheRoot = null; + private static LockFile lockFile = null; + private static File baseDir = null; + private static final Logger logger = Logger.getLogger(CacheDir.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Copy.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Copy.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Copy.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Copy.java 2015-05-15 09:25:06.000000000 +0000 @@ -41,7 +41,9 @@ } ClObjectInputStream ios = new ClObjectInputStream(cl, new ByteArrayInputStream(bos.toByteArray())); - return (Serializable)ios.readObject(); + Serializable s = (Serializable)ios.readObject(); + ios.close(); + return s; } /* ObjectInputStream with xlet class loader */ @@ -63,10 +65,10 @@ } System.err.println("deepCopy: failed to resolve class " + desc.getName()); throw e; - } catch (Throwable t) { + } catch (Exception t) { System.err.println("deepCopy: failed to resolve class " + desc.getName() + ": " + t); return null; } } } -} \ No newline at end of file +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndexData.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/FontIndexData.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndexData.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/FontIndexData.java 2015-01-26 08:01:57.000000000 +0000 @@ -59,5 +59,5 @@ protected String filename; protected int minSize; protected int maxSize; - protected int style; + protected int style = -1; /* optional */ } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndex.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/FontIndex.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/FontIndex.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/FontIndex.java 2015-02-28 16:45:26.000000000 +0000 @@ -22,30 +22,41 @@ import java.awt.Font; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.StringReader; import java.util.ArrayList; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -public class FontIndex extends DefaultHandler { +public class FontIndex extends DefaultHandler implements EntityResolver{ public static FontIndexData[] parseIndex(String path) { return new FontIndex(path).getFontIndexData(); } private FontIndex(String path) { + FileInputStream stream = null; try { - FileInputStream stream = new FileInputStream(path); + stream = new FileInputStream(path); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(stream, this); } catch (FileNotFoundException e) { } catch (Exception e) { - e.printStackTrace(); + System.err.println("error parsing font index: " + e); } finally { fontData = null; + if (stream != null) { + try { + stream.close(); + } catch (Exception e) { + } + } } } @@ -53,6 +64,15 @@ return (FontIndexData[])fontDatas.toArray(new FontIndexData[fontDatas.size()]); } + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + if (systemId.contains("http://www.dvb.org/mhp/dtd/fontdirectory-1-0.dtd")) { + return new InputSource(new StringReader("")); + } else { + return null; + } + } + public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equalsIgnoreCase("fontdirectory")) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/GUIManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/GUIManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/GUIManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/GUIManager.java 2015-01-26 08:01:57.000000000 +0000 @@ -35,6 +35,7 @@ instance = new GUIManager(); } else { instance.clearOverlay(); + instance.setDefaultFont(null); } return instance; } @@ -80,8 +81,11 @@ } public void dispose() { - super.dispose(); - instance = null; + try { + super.dispose(); + } finally { + instance = null; + } } private static GUIManager instance = null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/IxcRegistryImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -30,6 +30,9 @@ import java.rmi.AlreadyBoundException; import java.rmi.Remote; +import java.security.AccessController; +import java.security.PrivilegedAction; + import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -75,7 +78,7 @@ } } catch (ClassNotFoundException e) { - e.printStackTrace(); + logger.error("" + e); } } @@ -125,7 +128,7 @@ try { return Copy.deepCopy(toContext.getClassLoader(), (Serializable)obj); } catch (Exception e) { - Debug("wrapOrCopy: failed in deepCopy: " + e.getStackTrace()); + Debug("wrapOrCopy: failed in deepCopy:\n" + Logger.dumpStack(e)); throw new RemoteException("serialization/deserialization failed", e); } } @@ -208,7 +211,7 @@ } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (null == remoteObj.context || remoteObj.context.isDestroyed()) { + if (null == remoteObj.context || remoteObj.context.isReleased()) { Debug("invoke(): callee has been destroyed"); throw new RemoteException("callee has been destroyed"); } @@ -226,7 +229,7 @@ RemoteMethod remoteMethod = new RemoteMethod(method, remoteObj.context, args); - if (remoteMethod.callerContext.isDestroyed()) { + if (remoteMethod.callerContext.isReleased()) { Debug("invoke(): caller has been destroyed"); throw new RemoteException("caller has been destroyed"); } @@ -267,7 +270,7 @@ boolean finished = false; Object retInCaller = null; - public RemoteMethod(Method method, BDJXletContext context, Object[] args) + public RemoteMethod(final Method method, BDJXletContext context, Object[] args) throws RemoteException { callerContext = BDJXletContext.getCurrentContext(); @@ -278,7 +281,15 @@ logger.error("callee context is null"); } calleeContext = context; - methodInCallee = findMethodInCallee(method); + + //methodInCallee = findMethodInCallee(method); + methodInCallee = (Method)AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + return findMethodInCallee(method); + } + }); + if (null != args) { argsInCallee = new Object[args.length]; for (int i = 0; i < args.length; i++) { @@ -332,9 +343,9 @@ } TRACE("can't find method in callee"); } catch (SecurityException e) { - TRACE("can't find method in callee: SecurityException: " + e.getStackTrace()); + TRACE("can't find method in callee: " + e + "\n" + Logger.dumpStack(e)); } catch (ClassNotFoundException e) { - TRACE("can't find method in callee: ClassNotFound:" + e.getStackTrace()); + TRACE("can't find method in callee: " + e + "\n" + Logger.dumpStack(e)); } return null; @@ -393,7 +404,7 @@ Debug("bind(): xc not current BDJXletContext"); throw new IllegalArgumentException("xc not current BDJXletContext"); } - if (((BDJXletContext)xc).isDestroyed()) { + if (((BDJXletContext)xc).isReleased()) { Debug("bind(): xc is destroyed"); return; } @@ -473,8 +484,24 @@ return result; } + public void unbindAll() { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("unbindAll() from wrong thread: " + Logger.dumpStack()); + return; + } + + synchronized (remoteObjects) { + remoteObjects.clear(); + } + } + public void unbindAll(XletContext xc) { + if (null != BDJXletContext.getCurrentContext()) { + logger.error("unbindAll(ctx) from wrong thread: " + Logger.dumpStack()); + return; + } + Debug("IxcRegistry.removeBinding(" + xc + ")"); String prefix = "/" + (String)xc.getXletProperty("dvb.org.id") + "/" + (String)xc.getXletProperty("dvb.app.id") + "/"; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Libbluray.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Libbluray.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Libbluray.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Libbluray.java 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,171 +20,326 @@ package org.videolan; +import java.awt.BDFontMetrics; import java.awt.BDToolkit; import java.awt.event.KeyEvent; +import java.io.File; import java.util.Vector; import javax.media.PackageManager; +import javax.tv.service.SIManager; +import javax.tv.service.SIManagerImpl; import javax.tv.service.selection.ServiceContextFactory; - +import javax.tv.service.selection.ServiceContextFactoryImpl; +import org.bluray.bdplus.Status; +import org.bluray.net.BDLocator; import org.bluray.ti.DiscManager; import org.bluray.ti.TitleImpl; import org.bluray.ti.selection.TitleContext; import org.bluray.ui.event.HRcEvent; import org.dvb.event.EventManager; +import org.dvb.io.ixc.IxcRegistry; import org.dvb.ui.FontFactory; import org.videolan.bdjo.Bdjo; -import org.videolan.media.content.BDHandler; +import org.videolan.media.content.PlayerManager; /** * This class allows BDJ to call various libbluray functions. */ public class Libbluray { - protected static void init(long nativePointer, String discID) { - Libbluray.nativePointer = nativePointer; - DiscManager.getDiscManager().setCurrentDisc(discID); + /* hook system properties: make "user.dir" point to current Xlet home directory */ + + private static boolean propertiesHooked = false; + + private static void hookProperties() { + if (propertiesHooked) { + return; + } + propertiesHooked = true; + + java.util.Properties p = new java.util.Properties(System.getProperties()) { + public String getProperty(String key) { + if (key.equals("user.dir")) { + BDJXletContext ctx = BDJXletContext.getCurrentContext(); + if (ctx != null) { + return ctx.getXletHome(); + } + } + return super.getProperty(key); + } + }; + System.setProperties(p); + } + + private static String canonicalize(String path, boolean create) { + try { + File dir = new File(path); + if (create) { + dir.mkdirs(); + } + return dir.getCanonicalPath(); + } catch (Exception ioe) { + System.err.println("error canonicalizing " + path + ": " + ioe); + } + return path; + } - Vector prefix = new Vector(); - prefix.add("org.videolan"); - PackageManager.setContentPrefixList(prefix); - PackageManager.setProtocolPrefixList(prefix); - PackageManager.commitContentPrefixList(); - PackageManager.commitProtocolPrefixList(); + /* called only from native code */ + private static void init(long nativePointer, String discID, String discRoot, + String persistentRoot, String budaRoot) { - java.awt.BDFontMetrics.init(); - FontFactory.loadDiscFonts(); + hookProperties(); + + /* set up directories */ + persistentRoot = canonicalize(persistentRoot, true); + budaRoot = canonicalize(budaRoot, true); + + System.setProperty("dvb.persistent.root", persistentRoot); + System.setProperty("bluray.bindingunit.root", budaRoot); + + if (discRoot != null) { + discRoot = canonicalize(discRoot, false); + System.setProperty("bluray.vfs.root", discRoot); + } else { + System.getProperties().remove("bluray.vfs.root"); + } - System.setProperty("mhp.profile.enhanced_broadcast", "YES"); - System.setProperty("mhp.profile.interactive_broadcast", "YES"); - System.setProperty("mhp.profile.internet_access", "YES"); + Libbluray.nativePointer = nativePointer; + DiscManager.getDiscManager().setCurrentDisc(discID); - System.setProperty("mhp.eb.version.major", "1"); - System.setProperty("mhp.eb.version.minor", "0"); - System.setProperty("mhp.eb.version.micro", "3"); - System.setProperty("mhp.ia.version.major", "1"); - System.setProperty("mhp.ia.version.minor", "0"); - System.setProperty("mhp.ia.version.micro", "3"); - System.setProperty("mhp.ib.version.major", "1"); - System.setProperty("mhp.ib.version.minor", "0"); - System.setProperty("mhp.ib.version.micro", "3"); + BDJActionManager.createInstance(); - System.setProperty("mhp.option.ip.multicast", "UNSUPPORTED"); - System.setProperty("mhp.option.dsmcc.uu", "UNSUPPORTED"); - System.setProperty("mhp.option.dvb.html", "UNSUPPORTED"); + Vector prefix = new Vector(); + prefix.add("org.videolan"); + PackageManager.setContentPrefixList(prefix); + PackageManager.setProtocolPrefixList(prefix); + PackageManager.commitContentPrefixList(); + PackageManager.commitProtocolPrefixList(); - System.setProperty("dvb.returnchannel.timeout", "30"); + BDFontMetrics.init(); - System.setProperty("bluray.profile.1", "YES"); - System.setProperty("bluray.p1.version.major", "1"); - System.setProperty("bluray.p1.version.minor", "1"); - System.setProperty("bluray.p1.version.micro", "0"); + System.setProperty("mhp.profile.enhanced_broadcast", "YES"); + System.setProperty("mhp.profile.interactive_broadcast", "YES"); + System.setProperty("mhp.profile.internet_access", "YES"); - System.setProperty("bluray.profile.2", "YES"); - System.setProperty("bluray.p2.version.major", "1"); - System.setProperty("bluray.p2.version.minor", "0"); - System.setProperty("bluray.p2.version.micro", "0"); + System.setProperty("mhp.eb.version.major", "1"); + System.setProperty("mhp.eb.version.minor", "0"); + System.setProperty("mhp.eb.version.micro", "3"); + System.setProperty("mhp.ia.version.major", "1"); + System.setProperty("mhp.ia.version.minor", "0"); + System.setProperty("mhp.ia.version.micro", "3"); + System.setProperty("mhp.ib.version.major", "1"); + System.setProperty("mhp.ib.version.minor", "0"); + System.setProperty("mhp.ib.version.micro", "3"); - System.setProperty("bluray.disc.avplayback.readcapability", "NO"); + System.setProperty("mhp.option.ip.multicast", "UNSUPPORTED"); + System.setProperty("mhp.option.dsmcc.uu", "UNSUPPORTED"); + System.setProperty("mhp.option.dvb.html", "UNSUPPORTED"); - System.setProperty("bluray.video.fullscreenSD", "YES"); - System.setProperty("bluray.video.fullscreenSDPG", "YES"); + System.setProperty("dvb.returnchannel.timeout", "30"); - System.setProperty("aacs.bluray.online.capability", "YES"); - System.setProperty("aacs.bluray.mc.capability", "NO"); + System.setProperty("bluray.profile.1", "YES"); + System.setProperty("bluray.p1.version.major", "1"); + System.setProperty("bluray.p1.version.minor", "1"); + System.setProperty("bluray.p1.version.micro", "0"); - System.setProperty("bluray.prefetchedplaylistloading", "NO"); - System.setProperty("bluray.video.autoresume", "NO"); + System.setProperty("bluray.profile.2", "YES"); + System.setProperty("bluray.p2.version.major", "1"); + System.setProperty("bluray.p2.version.minor", "0"); + System.setProperty("bluray.p2.version.micro", "0"); - System.setProperty("bluray.mediaselect", "NO"); + System.setProperty("bluray.disc.avplayback.readcapability", "NO"); - System.setProperty("bluray.event.extension", "YES"); + System.setProperty("bluray.video.fullscreenSD", "YES"); + System.setProperty("bluray.video.fullscreenSDPG", "YES"); - System.setProperty("bluray.jmf.subtitlestyle", "YES"); + System.setProperty("aacs.bluray.online.capability", "YES"); + System.setProperty("aacs.bluray.mc.capability", "NO"); - System.setProperty("bluray.rccapability.release", "No"); - System.setProperty("bluray.rccapability.holdandrelease", "NO"); - System.setProperty("bluray.rccapability.repeatonhold", "NO"); + System.setProperty("bluray.prefetchedplaylistloading", "NO"); + System.setProperty("bluray.video.autoresume", "NO"); - System.setProperty("bluray.localstorage.level", "5"); - System.setProperty("bluray.localstorage.maxlevel", "5"); + System.setProperty("bluray.mediaselect", "NO"); - System.setProperty("bluray.localstorage.removable", "NO"); - System.setProperty("bluray.localstorage.upgradable", "NO"); - System.setProperty("bluray.localstorage.name", "HDD"); + System.setProperty("bluray.event.extension", "YES"); - System.setProperty("bluray.memory.images", "65536"); - System.setProperty("bluray.memory.audio", "8192"); - System.setProperty("bluray.memory.audio_plus_img", "73728"); - System.setProperty("bluray.memory.java_heap", "32768"); - System.setProperty("bluray.memory.font_cache", "4096"); + System.setProperty("bluray.jmf.subtitlestyle", "YES"); - System.setProperty("bluray.network.connected", "YES"); + System.setProperty("bluray.rccapability.release", "YES"); + System.setProperty("bluray.rccapability.holdandrelease", "YES"); + System.setProperty("bluray.rccapability.repeatonhold", "NO"); + + System.setProperty("bluray.localstorage.level", "5"); + System.setProperty("bluray.localstorage.maxlevel", "5"); + + System.setProperty("bluray.localstorage.removable", "NO"); + System.setProperty("bluray.localstorage.upgradable", "NO"); + System.setProperty("bluray.localstorage.name", "HDD"); + + System.setProperty("bluray.memory.images", "65536"); + System.setProperty("bluray.memory.audio", "8192"); + System.setProperty("bluray.memory.audio_plus_img", "73728"); + System.setProperty("bluray.memory.java_heap", "32768"); + System.setProperty("bluray.memory.font_cache", "4096"); + + System.setProperty("bluray.network.connected", "YES"); + + BDJSocketFactory.init(); + + try { + System.setSecurityManager(new BDJSecurityManager(discRoot, persistentRoot, budaRoot)); + } catch (Exception ex) { + System.err.println("System.setSecurityManager() failed: " + ex); + throw new SecurityException("Failed initializing SecurityManager"); + } } - public static void shutdown() { + /* called only from native code */ + private static void shutdown() { + if (nativePointer == 0) { + return; + } try { + stopTitle(true); BDJLoader.shutdown(); - BDJActionManager.getInstance().finalize(); + BDJActionManager.shutdown(); + + /* all Xlet contexts (and threads) should be terminated now */ + try { + System.setSecurityManager(null); + } catch (Exception ex) { + System.err.println("System.setSecurityManager(null) failed: " + ex); + } + MountManager.unmountAll(); GUIManager.shutdown(); - BDToolkit.shutdown(); + BDToolkit.shutdownDisc(); + BDFontMetrics.shutdown(); + SIManagerImpl.shutdown(); + IxcRegistry.shutdown(); + EventManager.shutdown(); + Status.shutdown(); + ServiceContextFactoryImpl.shutdown(); + FontFactory.unloadDiscFonts(); + CacheDir.remove(); } catch (Throwable e) { - e.printStackTrace(); + System.err.println("shutdown() failed: " + e + "\n" + Logger.dumpStack(e)); } nativePointer = 0; + titleInfos = null; } - public static byte[] getAacsData(int type) { - return getAacsDataN(nativePointer, type); + /* + * Package private + */ + + /* called by BDJLoader to select HDMV title */ + protected static boolean selectHdmvTitle(int title) { + return selectTitleN(nativePointer, title) == 1 ? true : false; } - public static int getTitles() { - return getTitlesN(nativePointer); + protected static boolean cacheBdRomFile(String path, String cachePath) { + return cacheBdRomFileN(nativePointer, path, cachePath) == 0; } + protected static void setUOMask(boolean menuCallMask, boolean titleSearchMask) { + setUOMaskN(nativePointer, menuCallMask, titleSearchMask); + } + + protected static void setKeyInterest(int mask) { + setKeyInterestN(nativePointer, mask); + } + + protected static int setVirtualPackage(String vpPath, boolean initBackupRegs) { + return setVirtualPackageN(nativePointer, vpPath, initBackupRegs); + } + + /* + * Disc titles + */ + + /* used by javax/tv/service/SIManagerImpl */ + public static int numTitles() { + if (titleInfos == null) { + titleInfos = getTitleInfosN(nativePointer); + if (titleInfos == null) { + return -1; + } + } + return titleInfos.length - 2; + } + + /* used by org/bluray/ti/TitleImpl */ public static TitleInfo getTitleInfo(int titleNum) { - if (titleNum < 0) + int numTitles = numTitles(); + if (numTitles < 0) + return null; + + if (titleNum == 0xffff) { + return titleInfos[titleInfos.length - 1]; + } + + if (titleNum < 0 || titleNum > numTitles) throw new IllegalArgumentException(); - return getTitleInfoN(nativePointer, titleNum); + return titleInfos[titleNum]; + } + + /* used by org/bluray/ti/PlayListImpl */ + public static int getCurrentTitle() { + return readPSR(PSR_TITLE_NUMBER); + } + + + /* + * Disc data + */ + + public static byte[] getAacsData(int type) { + return getAacsDataN(nativePointer, type); } public static PlaylistInfo getPlaylistInfo(int playlist) { return getPlaylistInfoN(nativePointer, playlist); } - public static long seek(long pos) { - return seekN(nativePointer, pos); + public static Bdjo getBdjo(String name) { + return getBdjoN(nativePointer, name + ".bdjo"); } - public static long seekTime(long tick) { - return seekTimeN(nativePointer, tick); + public static String[] listBdFiles(String path, boolean onlyBdRom) { + return listBdFilesN(nativePointer, path, onlyBdRom); } - public static long seekChapter(int chapter) { - if (chapter < 0) - throw new IllegalArgumentException("Chapter cannot be negative"); + /* + * Playback control + */ - return seekChapterN(nativePointer, chapter); + public static boolean selectPlaylist(int playlist, int playitem, int playmark, long time) { + if (playlist < 0) + throw new IllegalArgumentException("Playlist cannot be negative"); + + return selectPlaylistN(nativePointer, playlist, playitem, playmark, time) == 1 ? true : false; } - public static long chapterPos(int chapter) { - if (chapter < 0) - throw new IllegalArgumentException("Chapter cannot be negative"); + public static boolean selectPlaylist(int playlist) { + return selectPlaylist(playlist, -1, -1, -1); + } - return chapterPosN(nativePointer, chapter); + public static void stopPlaylist() { + selectPlaylistN(nativePointer, -1, -1, -1, -1); } - public static int getCurrentChapter(){ - return getCurrentChapterN(nativePointer); + public static long seekTime(long tick) { + return seekN(nativePointer, -1, -1, tick); } public static long seekMark(int mark) { if (mark < 0) throw new IllegalArgumentException("Mark cannot be negative"); - long result = seekMarkN(nativePointer, mark); + long result = seekN(nativePointer, -1, mark, -1); if (result == -1) throw new IllegalArgumentException("Seek error"); return result; @@ -193,76 +349,46 @@ if (clip < 0) throw new IllegalArgumentException("Mark cannot be negative"); - long result = seekPlayItemN(nativePointer, clip); + long result = seekN(nativePointer, clip, -1, -1); if (result == -1) throw new IllegalArgumentException("Seek error"); return result; } - public static boolean selectPlaylist(int playlist) { - if (playlist < 0) - throw new IllegalArgumentException("Playlist cannot be negative"); - - return selectPlaylistN(nativePointer, playlist) == 1 ? true : false; - } - - public static boolean selectTitle(TitleImpl title) { - TitleInfo ti = title.getTitleInfo(); - if (ti.isBdj()) { - try { - ((TitleContext)ServiceContextFactory.getInstance().getServiceContext(null)).select(title); - return true; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - return selectTitleN(nativePointer, title.getTitleNum()) == 1 ? true : false; - } - public static boolean selectAngle(int angle) { - if (angle < 0) + if (angle < 1) throw new IllegalArgumentException("Angle cannot be negative"); return selectAngleN(nativePointer, angle) == 1 ? true : false; } - public static void seamlessAngleChange(int angle) { - if (angle < 0) - throw new IllegalArgumentException("Angle cannot be negative"); - - seamlessAngleChangeN(nativePointer, angle); - } - - public static long getTitleSize() { - return getTitleSizeN(nativePointer); - } - - public static int getCurrentTitle() { - return readPSR(PSR_TITLE_NUMBER); + public static int soundEffect(int id) { + return soundEffectN(nativePointer, id); } public static int getCurrentAngle() { - return getCurrentAngleN(nativePointer); + return readPSR(PSR_ANGLE_NUMBER); } public static long getUOMask() { return getUOMaskN(nativePointer); } - public static long tell() { - return tellN(nativePointer); - } - public static long tellTime() { return tellTimeN(nativePointer); } public static boolean selectRate(float rate) { - return selectRateN(nativePointer, rate) == 1 ? true : false; + return selectRateN(nativePointer, rate, 0) == 1 ? true : false; + } + public static boolean selectRate(float rate, boolean start) { + return selectRateN(nativePointer, rate, start ? 1 : 2) == 1 ? true : false; } + /* + * Register access + */ + public static void writeGPR(int num, int value) { int ret = writeGPRN(nativePointer, num, value); @@ -271,7 +397,11 @@ } public static void writePSR(int num, int value) { - int ret = writePSRN(nativePointer, num, value); + writePSR(num, value, 0xffffffff); + } + + public static void writePSR(int num, int value, int psr_value_mask) { + int ret = writePSRN(nativePointer, num, value, psr_value_mask); if (ret == -1) throw new IllegalArgumentException("Invalid PSR"); @@ -291,9 +421,9 @@ return readPSRN(nativePointer, num); } - public static Bdjo getBdjo(String name) { - return getBdjoN(nativePointer, name); - } + /* + * Graphics + */ public static void updateGraphic(int width, int height, int[] rgbArray) { updateGraphicN(nativePointer, width, height, rgbArray, @@ -306,42 +436,81 @@ x0, y0, x1, y1); } - public static boolean processEvent(int event, int param) { + /* + * Events from native side + */ + + private static boolean startTitle(int titleNumber) { + + TitleContext titleContext = null; + try { + BDLocator locator = new BDLocator(null, titleNumber, -1); + TitleImpl title = (TitleImpl)SIManager.createInstance().getService(locator); + + titleContext = (TitleContext)ServiceContextFactory.getInstance().getServiceContext(null); + titleContext.start(title, true); + return true; + + } catch (Throwable e) { + System.err.println("startTitle() failed: " + e + "\n" + Logger.dumpStack(e)); + return false; + } + } + + private static boolean stopTitle(boolean shutdown) { + TitleContext titleContext = null; + try { + titleContext = (TitleContext)ServiceContextFactory.getInstance().getServiceContext(null); + if (shutdown) { + titleContext.destroy(); + } else { + titleContext.stop(); + } + return true; + } catch (Throwable e) { + System.err.println("stopTitle() failed: " + e + "\n" + Logger.dumpStack(e)); + return false; + } + } + + /* called only from native code */ + private static boolean processEventImpl(int event, int param) { boolean result = true; int key = 0; switch (event) { + + case BDJ_EVENT_START: + return startTitle(param); + case BDJ_EVENT_STOP: + return stopTitle(false); + case BDJ_EVENT_CHAPTER: - BDHandler.onChapterReach(param); - break; case BDJ_EVENT_MARK: - BDHandler.onMarkReach(param); - break; case BDJ_EVENT_PLAYITEM: - BDHandler.onPlayItemReach(param); - break; + case BDJ_EVENT_PLAYLIST: case BDJ_EVENT_ANGLE: - BDHandler.onAngleChange(param); - break; case BDJ_EVENT_SUBTITLE: - BDHandler.onSubtitleChange(param); - break; - case BDJ_EVENT_PIP: - BDHandler.onPiPChange(param); - break; + case BDJ_EVENT_AUDIO_STREAM: + case BDJ_EVENT_SECONDARY_STREAM: case BDJ_EVENT_END_OF_PLAYLIST: - BDHandler.activePlayerEndOfMedia(); + case BDJ_EVENT_PTS: + case BDJ_EVENT_UO_MASKED: + PlayerManager.getInstance().onEvent(event, param); break; + case BDJ_EVENT_RATE: + float rate = (float)param / 90000.0f; + if (rate < 0.0f) rate = -rate; + if (rate < 0.01f) rate = 0.0f; + if (rate > 0.99f && rate < 1.01f) rate = 1.0f; + PlayerManager.getInstance().onRateChange(rate); + break; + case BDJ_EVENT_PSR102: org.bluray.bdplus.Status.getInstance().receive(param); break; - case BDJ_EVENT_PTS: - BDHandler.activePlayerUpdateTime(param); - break; + case BDJ_EVENT_VK_KEY: - //case KeyEvent.KEY_TYPED: - //case KeyEvent.KEY_PRESSED: - //case KeyEvent.KEY_RELEASED: switch (param) { case 0: key = KeyEvent.VK_0; break; case 1: key = KeyEvent.VK_1; break; @@ -359,39 +528,57 @@ case 14: key = KeyEvent.VK_LEFT; break; case 15: key = KeyEvent.VK_RIGHT; break; case 16: key = KeyEvent.VK_ENTER; break; + case 403: key = HRcEvent.VK_COLORED_KEY_0; break; + case 404: key = HRcEvent.VK_COLORED_KEY_1; break; + case 405: key = HRcEvent.VK_COLORED_KEY_2; break; + case 406: key = HRcEvent.VK_COLORED_KEY_3; break; default: key = -1; result = false; break; } if (key > 0) { - result = - EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_PRESSED, 0, key) || - EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_RELEASED, 0, key) || - EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_TYPED, 0, key); + boolean r1 = EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_PRESSED, 0, key); + boolean r2 = EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_TYPED, 0, key); + boolean r3 = EventManager.getInstance().receiveKeyEventN(KeyEvent.KEY_RELEASED, 0, key); + result = r1 || r2 || r3; } break; default: + System.err.println("Unknown event " + event + "." + param); result = false; } return result; } - public static void setUOMask(boolean menuCallMask, boolean titleSearchMask) { - setUOMaskN(nativePointer, menuCallMask, titleSearchMask); + private static boolean processEvent(int event, int param) { + try { + return processEventImpl(event, param); + } catch (Throwable e) { + System.err.println("processEvent() failed: " + e + "\n" + Logger.dumpStack(e)); + return false; + } } - private static final int BDJ_EVENT_CHAPTER = 1; - private static final int BDJ_EVENT_PLAYITEM = 2; - private static final int BDJ_EVENT_ANGLE = 3; - private static final int BDJ_EVENT_SUBTITLE = 4; - private static final int BDJ_EVENT_PIP = 5; - private static final int BDJ_EVENT_END_OF_PLAYLIST = 6; - private static final int BDJ_EVENT_PTS = 7; - private static final int BDJ_EVENT_VK_KEY = 8; - private static final int BDJ_EVENT_MARK = 9; - private static final int BDJ_EVENT_PSR102 = 10; + public static final int BDJ_EVENT_CHAPTER = 1; + public static final int BDJ_EVENT_PLAYITEM = 2; + public static final int BDJ_EVENT_ANGLE = 3; + public static final int BDJ_EVENT_SUBTITLE = 4; + public static final int BDJ_EVENT_END_OF_PLAYLIST = 5; + public static final int BDJ_EVENT_PTS = 6; + private static final int BDJ_EVENT_VK_KEY = 7; + public static final int BDJ_EVENT_MARK = 8; + private static final int BDJ_EVENT_PSR102 = 9; + public static final int BDJ_EVENT_PLAYLIST = 10; + + private static final int BDJ_EVENT_START = 11; + private static final int BDJ_EVENT_STOP = 12; + + public static final int BDJ_EVENT_RATE = 13; + public static final int BDJ_EVENT_AUDIO_STREAM = 14; + public static final int BDJ_EVENT_SECONDARY_STREAM = 15; + public static final int BDJ_EVENT_UO_MASKED = 16; /* TODO: use org/bluray/system/RegisterAccess instead */ public static final int PSR_IG_STREAM_ID = 0; @@ -434,34 +621,29 @@ public static final int AACS_DEVICE_NONCE = 5; private static native byte[] getAacsDataN(long np, int type); - private static native TitleInfo getTitleInfoN(long np, int title); + private static native TitleInfo[] getTitleInfosN(long np); private static native PlaylistInfo getPlaylistInfoN(long np, int playlist); - private static native int getTitlesN(long np); - private static native long seekN(long np, long pos); - private static native long seekTimeN(long np, long tick); - private static native long seekChapterN(long np, int chapter); - private static native long chapterPosN(long np, int chapter); - private static native int getCurrentChapterN(long np); - private static native long seekMarkN(long np, int mark); - private static native long seekPlayItemN(long np, int clip); - private static native int selectPlaylistN(long np, int playlist); + private static native long seekN(long np, int playitem, int playmark, long time); + private static native int selectPlaylistN(long np, int playlist, int playitem, int playmark, long time); private static native int selectTitleN(long np, int title); private static native int selectAngleN(long np, int angle); - private static native void seamlessAngleChangeN(long np, int angle); - private static native long getTitleSizeN(long np); + private static native int soundEffectN(long np, int id); private static native long getUOMaskN(long np); private static native void setUOMaskN(long np, boolean menuCallMask, boolean titleSearchMask); - private static native int getCurrentAngleN(long np); - private static native long tellN(long np); + 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); + 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); + 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 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); private static native void updateGraphicN(long np, int width, int height, int[] rgbArray, int x0, int y0, int x1, int y1); - protected static long nativePointer = 0; + private static long nativePointer = 0; + private static TitleInfo[] titleInfos = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Logger.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Logger.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/Logger.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/Logger.java 2015-02-28 16:45:26.000000000 +0000 @@ -121,15 +121,29 @@ unimplemented(null); } - public static String dumpStack() { - String dump = ""; - StackTraceElement e[] = new Exception("Stack trace").getStackTrace(); + private static String printStackTrace(StackTraceElement[] e, int offset) + { if (e != null && e.length > 1) { - dump = "\t" + e[2].toString(); - for (int i = 3; i < e.length; i++) - dump += "\n\t" + e[i].toString(); + StringBuffer dump = new StringBuffer(); + dump.append("\t"); + dump.append(e[offset].toString()); + for (int i = offset + 1; i < e.length; i++) { + dump.append("\n\t"); + dump.append(e[i].toString()); + } + return dump.toString(); } - return dump; + return ""; + } + + public static String dumpStack() { + StackTraceElement e[] = new Exception("Stack trace").getStackTrace(); + return printStackTrace(e, 2); + } + + public static String dumpStack(Throwable t) { + StackTraceElement e[] = t.getStackTrace(); + return printStackTrace(e, 0); } public void unimplemented(String func) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * 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 + * . + */ + +package org.videolan.media.content.audio; + +import java.io.IOException; + +import javax.media.Control; +import javax.media.ControllerErrorEvent; +import javax.media.IncompatibleSourceException; +import javax.media.Time; +import javax.media.protocol.DataSource; + + +import org.videolan.media.content.playlist.OverallGainControlImpl; +import org.videolan.media.content.playlist.PanningControlImpl; + +import org.videolan.media.content.BDHandler; + + +public class Handler extends BDHandler { + public Handler() { + controls = new Control[3]; + controls[0] = new MediaTimePositionControlImpl(this); + controls[1] = new OverallGainControlImpl(this); + controls[2] = new PanningControlImpl(this); + } + + public void setSource(DataSource source) throws IOException, IncompatibleSourceException { + this.source = new org.videolan.media.protocol.dripfeed.DataSource(source.getLocator()); + if (source.getLocator() == null) + throw new IncompatibleSourceException(); + /* + can be ex. file:/mnt/bluray/BDMV/JAR/00000/Sub_switch.pcm + + try { + locator = new BDLocator(source.getLocator().toExternalForm()); + } catch (org.davic.net.InvalidLocatorException e) { + throw new IncompatibleSourceException(); + } + */ + } + + public Time getDuration() { + org.videolan.Logger.unimplemented("Handler", "getDuration"); + long duration = 1; // pi.getDuration() ; + return new Time(duration * TO_SECONDS); + } + + protected ControllerErrorEvent doPrefetch() { + return super.doPrefetch(); + } + + protected ControllerErrorEvent doStart(Time at) { + return super.doStart(at); + } + + protected ControllerErrorEvent doStop() { + return super.doStop(); + } + + /* + protected BDLocator getLocator() { + return locator; + } + + private BDLocator locator; + */ + private org.videolan.media.protocol.dripfeed.DataSource source = null; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/audio/MediaTimePositionControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/audio/MediaTimePositionControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/audio/MediaTimePositionControlImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/audio/MediaTimePositionControlImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * + * 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 + * . + */ + +package org.videolan.media.content.audio; + +import java.awt.Component; + +import javax.media.Time; + +import org.davic.media.MediaTimePositionControl; + +public class MediaTimePositionControlImpl implements MediaTimePositionControl { + protected MediaTimePositionControlImpl(Handler player) { + this.player = player; + } + + public Component getControlComponent() { + return null; + } + + public Time setMediaTimePosition(Time mediaTime) { + player.setMediaTime(mediaTime); + return player.getMediaTime(); + } + + public Time getMediaTimePosition() { + return player.getMediaTime(); + } + + private Handler player; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java 2015-05-15 09:25:06.000000000 +0000 @@ -20,7 +20,6 @@ import java.awt.Component; import java.io.IOException; -import java.util.LinkedList; import javax.media.Clock; import javax.media.ClockStoppedException; @@ -40,7 +39,9 @@ import javax.media.NotRealizedError; import javax.media.Player; import javax.media.PrefetchCompleteEvent; +import javax.media.RateChangeEvent; import javax.media.RealizeCompleteEvent; +import javax.media.ResourceUnavailableEvent; import javax.media.StartEvent; import javax.media.StopByRequestEvent; import javax.media.Time; @@ -56,12 +57,29 @@ import org.videolan.BDJAction; import org.videolan.BDJActionManager; +import org.videolan.BDJActionQueue; import org.videolan.BDJListeners; import org.videolan.BDJXletContext; +import org.videolan.Libbluray; import org.videolan.Logger; public abstract class BDHandler implements Player, ServiceContentHandler { + public BDHandler() { + ownerContext = BDJXletContext.getCurrentContext(); + + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_INIT, null); + BDJActionManager.getInstance().putCommand(action); + action.waitEnd(); + } + + private void doInitAction() { + commandQueue = new BDJActionQueue("MediaPlayer"); + PlayerManager.getInstance().registerPlayer(this); + } + + protected BDJXletContext getOwnerContext() { + return ownerContext; } private void checkUnrealized() { @@ -97,8 +115,10 @@ if (cls.isInstance(controls[i])) return controls[i]; } + Logger.getLogger("BDHandler").error("getControl(): control not found: " + forName); return null; } catch (ClassNotFoundException e) { + Logger.getLogger("BDHandler").error("getControl(): " + e); return null; } } @@ -187,8 +207,11 @@ public void setMediaTime(Time now) { checkUnrealized(); + + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_SEEK_TIME, now); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); } @@ -211,12 +234,25 @@ public float setRate(float factor) { checkUnrealized(); + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_SET_RATE, new Float(factor)); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); return rate; } + public static final int GAIN_OVERALL = 1; + public static final int GAIN_PRIMARY = 2; + public static final int GAIN_SECONDARY = 3; + + public void setGain(int mixer, boolean mute, float level) { + Logger.unimplemented("BDHandler", "setGain"); + } + + public void setPanning(float x, float y) { + Logger.unimplemented("BDHandler", "setPanning"); + } + public Locator[] getServiceContentLocators() { if (locator == null) return new Locator[0]; @@ -226,13 +262,17 @@ } public void realize() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_REALIZE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void prefetch() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_PREFETCH, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void syncStart(Time at) { @@ -240,105 +280,113 @@ if (state != Prefetched) throw new NotPrefetchedError("syncStart"); } + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_START, at); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void start() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_START, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); } public void stop() { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_STOP, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); } public void deallocate() { + if (isClosed) return; + + if (state == Started) { + } PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_DEALLOCATE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); + + PlayerManager.getInstance().releaseResource(this); } public void close() { + if (isClosed) return; + + stop(); + deallocate(); + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_CLOSE, null); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); action.waitEnd(); - } - protected void endOfMedia() { - PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_END_OF_MEDIA, null); - BDJActionManager.getInstance().putCommand(action); + isClosed = true; + commandQueue.shutdown(); } - protected void updateTime(int time) { - //System.out.println("current time = " + time * TO_SECONDS); - //currentTime = new Time(time * TO_SECONDS); - } + /* + * notifications from app + */ - public static void activePlayerEndOfMedia() { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.endOfMedia(); - } + protected void statusEvent(int event, int param) { + if (isClosed) return; + commandQueue.put(new PlayerAction(this, PlayerAction.ACTION_STATUS, new Integer(event), param)); } - public static void activePlayerUpdateTime(int pts) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.updateTime(pts); - } + protected void rateChanged(float rate) { + if (isClosed) return; + PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_RATE_CHANGED, new Float(rate)); + commandQueue.put(action); } - public static void onChapterReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doChapterReach(param); - } - } + /* + * handling of notifications from app + */ - public static void onMarkReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doMarkReach(param); + /* handle notification from app */ + protected void doRateChanged(float rate) { + if (this.rate != rate) { + this.rate = rate; + notifyListeners(new RateChangeEvent(this, rate)); } } - public static void onPlayItemReach(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doPlayItemReach(param); - } - } - - public static void onAngleChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doAngleChange(param); - } + protected void doTimeChanged(int time) { + //System.out.println("current time = " + time * TO_SECONDS); + //currentTime = new Time(time * TO_SECONDS); + // + // TODO - not handled ! } - public static void onSubtitleChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doSubtitleChange(param); + protected void doEndOfMediaReached(int playlist) { + if (state == Started) { + ControllerErrorEvent error = doStop(); + if (error == null) { + state = Prefetched; + notifyListeners(new EndOfMediaEvent(this, Started, Prefetched, Prefetched, getMediaTime())); + } else { + notifyListeners(error); + } } } - public static void onPiPChange(int param) { - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doPiPChange(param); - } - } - protected abstract void doChapterReach(int param); - protected abstract void doMarkReach(int param); - protected abstract void doPlayItemReach(int param); - protected abstract void doAngleChange(int param); - protected abstract void doSubtitleChange(int param); - protected abstract void doPiPChange(int param); + protected void doPlaylistStarted(int playlist) {}; + protected void doChapterReached(int chapter) {}; + protected void doMarkReached(int playmark) {}; + protected void doPlayItemReached(int playitem) {}; + protected void doAngleChanged(int angle) {}; + protected void doSubtitleChanged(int param) {}; + protected void doAudioStreamChanged(int param) {}; + protected void doUOMasked(int position) {}; + protected void doSecondaryStreamChanged(int param) {}; + + /* + * + */ protected ControllerErrorEvent doRealize() { return null; @@ -350,9 +398,9 @@ protected ControllerErrorEvent doStart(Time at) { if (at != null) - baseMediaTime = at.getNanoseconds(); - baseTime = getTimeBase().getNanoseconds(); - return null; + baseMediaTime = at.getNanoseconds(); + baseTime = getTimeBase().getNanoseconds(); + return null; } protected ControllerErrorEvent doStop() { @@ -373,9 +421,16 @@ } protected void doSetRate(Float factor) { - rate = factor.floatValue(); + if (rate != factor.floatValue()) { + rate = factor.floatValue(); + notifyListeners(new RateChangeEvent(this, rate)); + } } + /* + * + */ + private void notifyListeners(ControllerEvent event) { listeners.putCallback(event); } @@ -412,10 +467,10 @@ state = Prefetching; notifyListeners(new TransitionEvent(this, Realized, Prefetching, Prefetched)); case Prefetching: - synchronized (BDHandler.class) { - if (activePlayer != null) - activePlayer.doDeallocateAction(); - activePlayer = this; + + if (!PlayerManager.getInstance().allocateResource(this)) { + notifyListeners(new ResourceUnavailableEvent(this)); + return false; } ControllerErrorEvent error = doPrefetch(); if (error == null) { @@ -499,10 +554,6 @@ default: error = doDeallocate(); if (error == null) { - synchronized (BDHandler.class) { - if (activePlayer == this) - activePlayer = null; - } int previous = state; state = Realized; notifyListeners(new DeallocateEvent(this, previous, Realized, Realized, getMediaTime())); @@ -518,29 +569,25 @@ private void doCloseAction() { doClose(); notifyListeners(new ControllerClosedEvent(this)); - } - - private void doEndOfMediaAction() { - if (state == Started) { - ControllerErrorEvent error = doStop(); - if (error == null) { - state = Prefetched; - notifyListeners(new EndOfMediaEvent(this, Started, Prefetched, Prefetched, getMediaTime())); - } else { - notifyListeners(error); - } - } + PlayerManager.getInstance().unregisterPlayer(this); } private class PlayerAction extends BDJAction { private PlayerAction(BDHandler player, int action, Object param) { + this(player, action, param, -1); + } + private PlayerAction(BDHandler player, int action, Object param, int param2) { this.player = player; this.action = action; this.param = param; + this.param2 = param2; } protected void doAction() { switch (action) { + case ACTION_INIT: + player.doInitAction(); + break; case ACTION_REALIZE: player.doRealizeAction(); break; @@ -559,31 +606,81 @@ case ACTION_CLOSE: player.doCloseAction(); break; - case ACTION_END_OF_MEDIA: - player.doEndOfMediaAction(); - break; + case ACTION_SEEK_TIME: player.doSeekTime((Time)param); break; case ACTION_SET_RATE: player.doSetRate((Float)param); break; + + case ACTION_RATE_CHANGED: + player.doRateChanged(((Float)param).floatValue()); + break; + case ACTION_STATUS: + switch (((Integer)param).intValue()) { + case Libbluray.BDJ_EVENT_CHAPTER: + player.doChapterReached(param2); + break; + case Libbluray.BDJ_EVENT_MARK: + player.doMarkReached(param2); + break; + case Libbluray.BDJ_EVENT_PLAYITEM: + player.doPlayItemReached(param2); + break; + case Libbluray.BDJ_EVENT_PLAYLIST: + player.doPlaylistStarted(param2); + break; + case Libbluray.BDJ_EVENT_ANGLE: + player.doAngleChanged(param2); + break; + case Libbluray.BDJ_EVENT_SUBTITLE: + player.doSubtitleChanged(param2); + break; + case Libbluray.BDJ_EVENT_END_OF_PLAYLIST: + player.doEndOfMediaReached(param2); + break; + case Libbluray.BDJ_EVENT_PTS: + player.doTimeChanged(param2); + break; + case Libbluray.BDJ_EVENT_AUDIO_STREAM: + player.doAudioStreamChanged(param2); + break; + case Libbluray.BDJ_EVENT_SECONDARY_STREAM: + player.doSecondaryStreamChanged(param2); + break; + case Libbluray.BDJ_EVENT_UO_MASKED: + player.doUOMasked(param2); + break; + default: + System.err.println("Unknown ACTION_STATUS: id " + param + ", value " + param2); + break; + } + break; + default: + System.err.println("Unknown action " + action); + break; } } private BDHandler player; private int action; private Object param; + private int param2; + + public static final int ACTION_INIT = 1; + public static final int ACTION_REALIZE = 2; + public static final int ACTION_PREFETCH = 3; + public static final int ACTION_START = 4; + public static final int ACTION_STOP = 5; + public static final int ACTION_DEALLOCATE = 6; + public static final int ACTION_CLOSE = 7; - public static final int ACTION_REALIZE = 1; - public static final int ACTION_PREFETCH = 2; - public static final int ACTION_START = 3; - public static final int ACTION_STOP = 4; - public static final int ACTION_DEALLOCATE = 5; - public static final int ACTION_CLOSE = 6; - public static final int ACTION_END_OF_MEDIA = 7; public static final int ACTION_SEEK_TIME = 8; public static final int ACTION_SET_RATE = 9; + + public static final int ACTION_STATUS = 10; + public static final int ACTION_RATE_CHANGED = 11; } protected int state = Unrealized; @@ -595,10 +692,13 @@ protected Control[] controls = null; protected BDLocator locator = null; private BDJListeners listeners = new BDJListeners(); + private BDJXletContext ownerContext; + boolean isClosed = false; + + protected BDJActionQueue commandQueue; public static final double TO_SECONDS = 1 / 90000.0d; public static final double FROM_SECONDS = 90000.0d; public static final double TO_NAROSECONDS = 1000000 / 90.0d; public static final double FROM_NAROSECONDS = 0.00009d; - public static BDHandler activePlayer = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * 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 + * . + */ + +package org.videolan.media.content; + +import java.util.ArrayList; + +public class PlayerManager { + + private static PlayerManager instance = new PlayerManager(); + + public static PlayerManager getInstance() { + return instance; + } + + /* + * + */ + + private ArrayList registeredPlayers = new ArrayList(1); + + private BDHandler playlistPlayer = null; + private BDHandler videoDripPlayer = null; + //private ArrayList audioPlayerList = new ArrayList(8); + + private Object playlistPlayerLock = new Object(); + private Object videoDripPlayerLock = new Object(); + //private Object audioPlayerLock = new Object(); + private Object stoppingLock = new Object(); + private boolean stopping = false; + + public void releaseAllPlayers(boolean unconditional) { + BDHandler[] players = null; + synchronized (registeredPlayers) { + players = (BDHandler[])registeredPlayers.toArray(new BDHandler[0]); + } + + for (int i = 0; i < players.length; i++) { + if (unconditional) { + players[i].close(); + } else if (players[i].getOwnerContext() != null && players[i].getOwnerContext().isReleased()) { + players[i].close(); + } + } + } + + public BDHandler getPlaylistPlayer() { + synchronized (playlistPlayerLock) { + return playlistPlayer; + } + } + + protected void releaseResource(BDHandler player) { + if (player instanceof org.videolan.media.content.playlist.Handler) { + synchronized (playlistPlayerLock) { + if (player == playlistPlayer) { + playlistPlayer = null; + } + } + return; + } + if (player instanceof org.videolan.media.content.sound.Handler) { + return; + } + if (player instanceof org.videolan.media.content.audio.Handler) { + return; + } + + System.err.println("unknown player type: " + player.getClass().getName()); + } + + protected boolean allocateResource(BDHandler player) { + if (player instanceof org.videolan.media.content.playlist.Handler) { + synchronized (stoppingLock) { + stopping = true; + } + synchronized (playlistPlayerLock) { + if (playlistPlayer != null && player != playlistPlayer) { + playlistPlayer.stop(); + playlistPlayer.deallocate(); + } + playlistPlayer = player; + } + synchronized (stoppingLock) { + stopping = false; + } + return true; + } + if (player instanceof org.videolan.media.content.sound.Handler) { + return true; + } + if (player instanceof org.videolan.media.content.audio.Handler) { + return true; + } + + System.err.println("unknown player type: " + player.getClass().getName()); + return false; + } + + protected void unregisterPlayer(BDHandler player) + { + synchronized (registeredPlayers) { + if (registeredPlayers.contains(player)) { + registeredPlayers.remove(player); + } + } + } + + protected void registerPlayer(BDHandler player) + { + synchronized (registeredPlayers) { + if (!registeredPlayers.contains(player)) { + registeredPlayers.add(player); + } + } + } + + /* + * + */ + + public void onEvent(int event, int param) { + synchronized (stoppingLock) { + if (stopping) return; + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.statusEvent(event, param); + } + } + } + + public void onRateChange(float rate) { + synchronized (stoppingLock) { + if (stopping) return; + synchronized (playlistPlayerLock) { + if (playlistPlayer != null) + playlistPlayer.rateChanged(rate); + } + } + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/AngleControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/AngleControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/AngleControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/AngleControlImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -50,7 +50,7 @@ } public void selectDefaultAngle() { - Libbluray.selectAngle(0); + Libbluray.selectAngle(1); } public void selectAngle(int angle) throws InvalidAngleException { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/BackgroundVideoPresentationControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/BackgroundVideoPresentationControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/BackgroundVideoPresentationControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/BackgroundVideoPresentationControlImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -122,7 +122,7 @@ sr.x = 0; sr.width = 0; } - } + } if (sr.y < 0) sr.y = 0; if ((sr.y + sr.height) > vd.height) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/DVBMediaSelectControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/DVBMediaSelectControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/DVBMediaSelectControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/DVBMediaSelectControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -25,6 +25,8 @@ import javax.media.Control; import javax.tv.locator.InvalidLocatorException; import javax.tv.locator.Locator; +import javax.tv.media.MediaSelectFailedEvent; +import javax.tv.media.MediaSelectSucceededEvent; import javax.tv.media.MediaSelectListener; import javax.tv.service.selection.InsufficientResourcesException; import javax.tv.service.selection.InvalidServiceComponentException; @@ -32,6 +34,8 @@ import org.bluray.media.AsynchronousPiPControl; import org.bluray.net.BDLocator; import org.dvb.media.DVBMediaSelectControl; +import org.videolan.BDJListeners; +import org.videolan.Logger; import org.videolan.PlaylistInfo; import org.videolan.TIClip; @@ -55,7 +59,8 @@ try { control.selectStreamNumber(locator.getSecondaryVideoStreamNumber()); } catch (Exception e) { - e.printStackTrace(); + System.err.println("" + e + "\n" + Logger.dumpStack(e)); + postMediaSelectFailedEvent(new Locator[] { component }); } } @@ -71,7 +76,12 @@ player.getControl("org.bluray.media.AsynchronousPiPControl"); if (control.getCurrentStreamNumber() != locator.getSecondaryVideoStreamNumber()) throw new InvalidLocatorException(component); - control.stop(); + try { + control.stop(); + } catch (Exception e) { + System.err.println("" + e + "\n" + Logger.dumpStack(e)); + postMediaSelectFailedEvent(new Locator[] { component }); + } } public void select(Locator component) @@ -90,6 +100,7 @@ try { ((StreamControl)control).selectStreamNumber(stream); } catch (Exception e) { + postMediaSelectFailedEvent(new Locator[] { component }); throw new InvalidLocatorException(component); } } @@ -125,22 +136,25 @@ try { ((StreamControl)fromControl).selectStreamNumber(toStream); } catch (Exception e) { + postMediaSelectFailedEvent(new Locator[] { toComponent }); throw new InvalidLocatorException(toComponent); } } public void addMediaSelectListener(MediaSelectListener listener) { - org.videolan.Logger.unimplemented("DVBMediaSelectControlImpl", "addMediaSelectListener"); - // callback is never triggered ? - synchronized(listeners) { - listeners.add(listener); - } + listeners.add(listener); } public void removeMediaSelectListener(MediaSelectListener listener) { - synchronized(listeners) { - listeners.remove(listener); - } + listeners.remove(listener); + } + + private void postMediaSelectFailedEvent(Locator[] selection) { + listeners.putCallback(new MediaSelectFailedEvent(player, selection)); + } + + protected void postMediaSelectSucceededEvent(Locator[] selection) { + listeners.putCallback(new MediaSelectSucceededEvent(player, selection)); } public Locator[] getCurrentSelection() { @@ -218,7 +232,7 @@ BDLocator bdLocator = (BDLocator)locator; if (bdLocator.getComponentTagsCount() != 1) return false; - if (bdLocator.getPlayListId() != pi.getPlaylist()) + if (bdLocator.getPlayListId() != -1 && bdLocator.getPlayListId() != pi.getPlaylist()) return false; TIClip ci = player. getCurrentClipInfo(); if (ci == null) @@ -254,6 +268,6 @@ return null; } - private LinkedList listeners = new LinkedList(); + private BDJListeners listeners = new BDJListeners(); private Handler player; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/GainControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/GainControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/GainControlImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/GainControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * This file is part of libbluray + * Copyright (C) 2015 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan.media.content.playlist; + +import java.awt.Component; +import javax.media.GainControl; + +import javax.media.GainChangeEvent; +import javax.media.GainChangeListener; + +/* +http://docs.oracle.com/cd/E17802_01/j2se/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/GainControl.html +*/ + +import org.videolan.BDJListeners; + +abstract class GainControlImpl { + + public void setMute(boolean mute) { + this.mute = mute; + setGain(this.mute, this.level); + } + + public boolean getMute() { + return this.mute; + } + + public float setDB(float gain) { + this.level = Math.max(1.0f, Math.min(0.0f, (float)Math.pow(10.0f, gain / 10.0f))); + this.gain = gain; + setGain(this.mute, this.level); + return this.gain; + } + + public float getDB() { + return gain; + } + + public float setLevel(float level) { + this.level = Math.max(1.0f, Math.min(0.0f, level)); + this.gain = 10.0f * (float)(Math.log(this.level) / Math.log(10.0f)); + + setGain(this.mute, this.level); + return this.level; + } + + public float getLevel() { + return level; + } + + public void addGainChangeListener(GainChangeListener listener) { + listeners.add(listener); + } + + public void removeGainChangeListener(GainChangeListener listener) { + listeners.remove(listener); + } + + protected abstract void setGain(boolean mute, float level); + + protected void valueChanged() { + listeners.putCallback(new GainChangeEvent((GainControl)this, mute, gain, level)); + } + + public Component getControlComponent() { + return null; + } + + private boolean mute = false; + private float gain = 0.0f; + private float level = 1.0f; + private BDJListeners listeners = new BDJListeners(); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,14 +29,18 @@ import javax.media.IncompatibleSourceException; import javax.media.Time; import javax.media.protocol.DataSource; +import javax.tv.locator.Locator; import javax.tv.locator.InvalidLocatorException; +import javax.tv.service.selection.ServiceContextFactory; import org.bluray.media.InvalidPlayListException; import org.bluray.net.BDLocator; import org.bluray.system.RegisterAccess; +import org.bluray.ti.selection.TitleContextImpl; import org.videolan.BDJAction; import org.videolan.BDJActionManager; import org.videolan.Libbluray; +import org.videolan.Logger; import org.videolan.PlaylistInfo; import org.videolan.TIClip; import org.videolan.media.content.BDHandler; @@ -49,15 +54,15 @@ controls[3] = new DVBMediaSelectControlImpl(this); controls[4] = new MediaTimeEventControlImpl(); controls[5] = new MediaTimePositionControlImpl(this); - controls[6] = new OverallGainControlImpl(); - controls[7] = new PanningControlImpl(); + controls[6] = new OverallGainControlImpl(this); + controls[7] = new PanningControlImpl(this); controls[8] = new PiPControlImpl(this); controls[9] = new PlaybackControlImpl(this); controls[10] = new PlayListChangeControlImpl(this); controls[11] = new PrimaryAudioControlImpl(this); - controls[12] = new PrimaryGainControlImpl(); + controls[12] = new PrimaryGainControlImpl(this); controls[13] = new SecondaryAudioControlImpl(this); - controls[14] = new SecondaryGainControlImpl(); + controls[14] = new SecondaryGainControlImpl(this); controls[15] = new SubtitlingControlImpl(this); controls[16] = new UOMaskTableControlImpl(this); controls[17] = new VideoFormatControlImpl(this); @@ -89,37 +94,42 @@ protected ControllerErrorEvent doPrefetch() { synchronized (this) { try { - if (!Libbluray.selectPlaylist(locator.getPlayListId())) - return new ConnectionErrorEvent(this); - - if (baseMediaTime != 0) { - Libbluray.seekTime((long)(baseMediaTime * FROM_NAROSECONDS)); - } else if (locator.getMarkId() >= 0) { - ((PlaybackControlImpl)controls[9]).skipToMark(locator.getMarkId()); - } else if (locator.getPlayItemId() >= 0) { - ((PlaybackControlImpl)controls[9]).skipToPlayItem(locator.getPlayItemId()); - } - int stream; stream = locator.getPrimaryAudioStreamNumber(); if (stream > 0) Libbluray.writePSR(Libbluray.PSR_PRIMARY_AUDIO_ID, stream); stream = locator.getPGTextStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0xFFFFF000; - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | stream); + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, stream, 0x00000fff); } stream = locator.getSecondaryVideoStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0xFFFF00FF; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | (stream << 8)); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream << 8, 0x0000ff00); } stream = locator.getSecondaryAudioStreamNumber(); if (stream > 0) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0xFFFFFF00; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | stream); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, stream, 0x000000ff); + } + + int pl = locator.getPlayListId(); + long time = -1; + int pi = -1, mark = -1; + if (baseMediaTime != 0) { + time = (long)(baseMediaTime * FROM_NAROSECONDS); + } /*else*/ if (locator.getMarkId() > 0) { + mark = locator.getMarkId(); + } /*else*/ if (locator.getPlayItemId() > 0) { + pi = locator.getPlayItemId(); + } + + if (!Libbluray.selectPlaylist(pl, pi, mark, time)) { + return new ConnectionErrorEvent(this); } - } catch (Throwable e) { + + updateTime(new Time(Libbluray.tellTime() * TO_SECONDS)); + + currentLocator = new BDLocator(locator.toExternalForm()); + } catch (Exception e) { return new ConnectionErrorEvent(this); } return super.doPrefetch(); @@ -131,14 +141,14 @@ if (at != null) { try { Libbluray.seekTime((long)(at.getSeconds() * FROM_SECONDS)); - } catch (Throwable e) { + } catch (Exception e) { return new ConnectionErrorEvent(this); } } try { - Libbluray.selectRate(rate); - } catch (Throwable e) { + Libbluray.selectRate(rate, true); + } catch (Exception e) { return new ConnectionErrorEvent(this); } @@ -148,7 +158,7 @@ } protected ControllerErrorEvent doStop() { - Libbluray.selectRate(0.0f); + Libbluray.selectRate(0.0f, false); return super.doStop(); } @@ -157,7 +167,7 @@ if ((state == Prefetched) || (state == Started)) { try { Libbluray.seekTime((long)(at.getSeconds() * FROM_SECONDS)); - } catch (Throwable e) { + } catch (Exception e) { return; } at = new Time(Libbluray.tellTime() * TO_SECONDS); @@ -171,7 +181,7 @@ if (state == Started) { try { Libbluray.selectRate(factor.floatValue()); - } catch (Throwable e) { + } catch (Exception e) { return; } if (state == Started) { @@ -183,28 +193,114 @@ } } - protected void doChapterReach(int param) { + /* notification from app */ + + private void postMediaSelectSucceeded(BDLocator locator) { + ((DVBMediaSelectControlImpl)controls[3]).postMediaSelectSucceededEvent(new Locator[] { locator }); + } + + protected void doRateChanged(float rate) { + synchronized (this) { + if (state == Started) { + baseMediaTime = getMediaNanoseconds(); + baseTime = getTimeBase().getNanoseconds(); + } + super.doRateChanged(rate); + } + } + + protected void doChapterReached(int param) { ((PlaybackControlImpl)controls[9]).onChapterReach(param); } - protected void doMarkReach(int param) { + + protected void doMarkReached(int param) { ((PlaybackControlImpl)controls[9]).onMarkReach(param); + + if (currentLocator != null) + currentLocator.setMarkId(param); } - protected void doPlayItemReach(int param) { + protected void doPlaylistStarted(int param) { + } + + protected void doPlayItemReached(int param) { ((PlaybackControlImpl)controls[9]).onPlayItemReach(param); ((UOMaskTableControlImpl)controls[16]).onPlayItemReach(param); + + + if (currentLocator != null) { + currentLocator.setPlayItemId(param); + postMediaSelectSucceeded(currentLocator); + } + + try { + ((TitleContextImpl)ServiceContextFactory.getInstance().getServiceContext(null)).presentationChanged(); + } catch (Exception e) { + System.err.println("" + e + "\n" + Logger.dumpStack(e)); + } + + if (pi != null) { + TIClip[] clips = pi.getClips(); + if (clips != null && param >= 0 && param < clips.length) { + ((SubtitlingControlImpl)controls[15]).onSubtitleAvailable(clips[param].getPgStreamCount() > 0); + } + } } - protected void doAngleChange(int param) { + protected void doUOMasked(int position) { + ((UOMaskTableControlImpl)controls[16]).onUOMasked(position); + } + + protected void doAngleChanged(int param) { ((AngleControlImpl)controls[0]).onAngleChange(param); } - protected void doSubtitleChange(int param) { + protected void doSubtitleChanged(int param) { ((SubtitlingControlImpl)controls[15]).onSubtitleChange(param); + + if (currentLocator != null) { + currentLocator.setPGTextStreamNumber(param & 0xfff); + postMediaSelectSucceeded(currentLocator); + } + } + + protected void doAudioStreamChanged(int param) { + if (currentLocator != null) { + locator.setPrimaryAudioStreamNumber(param); + postMediaSelectSucceeded(currentLocator); + } } - protected void doPiPChange(int param) { - ((PiPControlImpl)controls[8]).onPiPChange(param); + private void doSecondaryVideoChanged(int stream, boolean enable) { + if (currentLocator != null) { + locator.setSecondaryVideoStreamNumber(stream); + postMediaSelectSucceeded(currentLocator); + } + + ((PiPControlImpl)controls[8]).onPiPStatusChange(enable); + } + + private void doSecondaryAudioChanged(int stream, boolean enable) { + if (currentLocator != null) { + locator.setSecondaryAudioStreamNumber(stream); + postMediaSelectSucceeded(currentLocator); + } + } + + protected void doSecondaryStreamChanged(int param) { + doSecondaryVideoChanged((param & 0xff00) >> 8, (param & 0x80000000) != 0); + doSecondaryAudioChanged(param & 0xff, (param & 0x40000000) != 0); + } + + protected void doEndOfMediaReached(int playlist) { + synchronized (this) { + if (locator == null || locator.getPlayListId() != playlist) { + System.err.println("endOfMedia ignored: playlist does not match (" + playlist + " != " + locator.getPlayListId()); + return; + } + } + + super.doEndOfMediaReached(playlist); } protected BDLocator getLocator() { @@ -251,7 +347,8 @@ throw new IllegalArgumentException(); PlaylistPlayerAction action = new PlaylistPlayerAction( this, PlaylistPlayerAction.ACTION_SEEK_MARK, mark); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); + action.waitEnd(); } protected void seekPlayItem(int item) throws IllegalArgumentException { @@ -259,7 +356,8 @@ throw new IllegalArgumentException(); PlaylistPlayerAction action = new PlaylistPlayerAction( this, PlaylistPlayerAction.ACTION_SEEK_PLAYITEM, item); - BDJActionManager.getInstance().putCommand(action); + commandQueue.put(action); + action.waitEnd(); } private class PlaylistPlayerAction extends BDJAction { @@ -301,4 +399,5 @@ } private PlaylistInfo pi = null; + private BDLocator currentLocator = null; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/OverallGainControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/OverallGainControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/OverallGainControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/OverallGainControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2015 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,45 +21,19 @@ package org.videolan.media.content.playlist; import java.awt.Component; -import javax.media.GainChangeListener; import org.bluray.media.OverallGainControl; -public class OverallGainControlImpl implements OverallGainControl { - public void setMute(boolean mute) { - // TODO Not implemented - } - - public boolean getMute() { - return false; // TODO Not implemented - } - - public float setDB(float gain) { - return 0; // TODO Not implemented - } - - public float getDB() { - return 0; // TODO Not implemented - } - - public float setLevel(float level) { - return 0; - } - - public float getLevel() { - return 0; // TODO Not implemented - } - - public void addGainChangeListener(GainChangeListener listener) { - // TODO Not implemented - org.videolan.Logger.unimplemented("OverallGainControlImpl", "addGainChangeListener"); - } +import org.videolan.media.content.BDHandler; - public void removeGainChangeListener(GainChangeListener listener) { - // TODO Not implemented +public class OverallGainControlImpl extends GainControlImpl implements OverallGainControl { + public OverallGainControlImpl(BDHandler player) { + this.player = player; } - public Component getControlComponent() { - return null; + protected void setGain(boolean mute, float level) { + player.setGain(BDHandler.GAIN_OVERALL, mute, level); + super.valueChanged(); } + private BDHandler player; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PanningControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PanningControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PanningControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PanningControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2015 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,42 +22,66 @@ import java.awt.Component; +import org.bluray.media.PanningChangeEvent; import org.bluray.media.PanningChangeListener; import org.bluray.media.PanningControl; -// TODO Figure out why the hell this is needed +import org.videolan.BDJListeners; +import org.videolan.media.content.BDHandler; + +/* + set audio source location in 2D space +*/ public class PanningControlImpl implements PanningControl { + public PanningControlImpl(BDHandler player) { + this.player = player; + } + public Component getControlComponent() { return null; } public void addPanningChangeListener(PanningChangeListener listener) { - org.videolan.Logger.unimplemented("PanningControlImpl", "addPanningVChangeListener"); - // TODO Not implemented + listeners.add(listener); } public void removePanningChangeListener(PanningChangeListener listener) { - // TODO Not implemented + listeners.remove(listener); } public float getLeftRight() { - return 0; // TODO Not implemented + return balance; } public float getFrontRear() { - return 0; // TODO Not implemented + return fading; } public void setLeftRight(float balance) { - // TODO Not implemented + setPosition(balance, this.fading); } - public void setFrontRear(float fade) { - // TODO Not implemented + public void setFrontRear(float panning) { + setPosition(this.balance, panning); } public void setPosition(float x, float y) { - // TODO Not implemented + this.balance = clip(x); + this.fading = clip(y); + + player.setPanning(balance, fading); + + listeners.putCallback(new PanningChangeEvent(this, this.balance, this.fading)); + } + + private float clip(float val) { + if (val != val) /* NaN */ + return 0.0f; + return Math.min(-1.0f, Math.max(1.0f, val)); } + private BDHandler player; + private BDJListeners listeners = new BDJListeners(); + private float fading = 0.0f; + private float balance = 0.0f; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PiPControlImpl.java 2015-05-15 09:25:06.000000000 +0000 @@ -48,8 +48,7 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO)& 0xFFFF00FF; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr | (num << 8)); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num << 8, 0x0000ff00); } public int getCurrentStreamNumber() { @@ -57,10 +56,7 @@ } public void setDisplay(boolean value) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO) & 0x7FFFFFFF; - if (value) - psr |= 0x80000000; - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, psr); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, value ? 0x80000000 : 0, 0x80000000); } public boolean getDisplay() { @@ -87,8 +83,8 @@ return false; } - protected void onPiPChange(int param) { - listeners.putCallback(new PiPStatusEvent(param > 0, this)); + protected void onPiPStatusChange(boolean enable) { + listeners.putCallback(new PiPStatusEvent(enable, this)); } public void addPiPStatusListener(PiPStatusListener listener) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryGainControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryGainControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryGainControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/PrimaryGainControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2015 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,46 +21,19 @@ package org.videolan.media.content.playlist; import java.awt.Component; - -import javax.media.GainChangeListener; - import org.bluray.media.PrimaryGainControl; -public class PrimaryGainControlImpl implements PrimaryGainControl { - public void setMute(boolean mute) { - // TODO Not implemented - } - - public boolean getMute() { - return false; // TODO Not implemented - } - - public float setDB(float gain) { - return 0; // TODO Not implemented - } - - public float getDB() { - return 0; // TODO Not implemented - } - - public float setLevel(float level) { - return 0; - } +import org.videolan.media.content.BDHandler; - public float getLevel() { - return 0; // TODO Not implemented +public class PrimaryGainControlImpl extends GainControlImpl implements PrimaryGainControl { + PrimaryGainControlImpl(BDHandler player) { + this.player = player; } - public void addGainChangeListener(GainChangeListener listener) { - // TODO Not implemented - org.videolan.Logger.unimplemented("PrimaryGainControlImpl", "addGainChangeListener"); + protected void setGain(boolean mute, float level) { + player.setGain(BDHandler.GAIN_PRIMARY, mute, level); + super.valueChanged(); } - public void removeGainChangeListener(GainChangeListener listener) { - // TODO Not implemented - } - - public Component getControlComponent() { - return null; - } + private BDHandler player; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryAudioControlImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -45,7 +45,6 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO); - Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, (psr & 0xFFFFFF00) | num); + Libbluray.writePSR(Libbluray.PSR_SECONDARY_AUDIO_VIDEO, num, 0x000000ff); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryGainControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryGainControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryGainControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SecondaryGainControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2015 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,46 +21,19 @@ package org.videolan.media.content.playlist; import java.awt.Component; - -import javax.media.GainChangeListener; - import org.bluray.media.SecondaryGainControl; -public class SecondaryGainControlImpl implements SecondaryGainControl { - public void setMute(boolean mute) { - // TODO Not implemented - } - - public boolean getMute() { - return false; // TODO Not implemented - } - - public float setDB(float gain) { - return 0; // TODO Not implemented - } - - public float getDB() { - return 0; // TODO Not implemented - } - - public float setLevel(float level) { - return 0; - } +import org.videolan.media.content.BDHandler; - public float getLevel() { - return 0; // TODO Not implemented +public class SecondaryGainControlImpl extends GainControlImpl implements SecondaryGainControl { + SecondaryGainControlImpl(BDHandler player) { + this.player = player; } - public void addGainChangeListener(GainChangeListener listener) { - // TODO Not implemented - org.videolan.Logger.unimplemented("SecondaryGainControlImpl", "addGainChangeListener"); + protected void setGain(boolean mute, float level) { + player.setGain(BDHandler.GAIN_SECONDARY, mute, level); + super.valueChanged(); } - public void removeGainChangeListener(GainChangeListener listener) { - // TODO Not implemented - } - - public Component getControlComponent() { - return null; - } + BDHandler player; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/StreamControl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/StreamControl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/StreamControl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/StreamControl.java 2015-01-26 08:01:57.000000000 +0000 @@ -51,9 +51,9 @@ protected String languageFromInteger(int value) { char[] language = new char[3]; - language[0] = (char)(value >> 16); - language[1] = (char)(value >> 8); - language[2] = (char)value; + language[0] = (char)((value >> 16) & 0xff); + language[1] = (char)((value >> 8) & 0xff); + language[2] = (char)(value & 0xff); return String.valueOf(language); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/SubtitlingControlImpl.java 2015-04-06 15:44:26.000000000 +0000 @@ -26,7 +26,11 @@ import org.bluray.media.SubtitlingControl; import org.bluray.media.TextSubtitleNotAvailableException; import org.bluray.ti.CodingType; +import org.dvb.media.SubtitleAvailableEvent; import org.dvb.media.SubtitleListener; +import org.dvb.media.SubtitleNotAvailableEvent; +import org.dvb.media.SubtitleNotSelectedEvent; +import org.dvb.media.SubtitleSelectedEvent; import org.videolan.BDJListeners; import org.videolan.Libbluray; import org.videolan.StreamInfo; @@ -53,8 +57,7 @@ } protected void setStreamNumber(int num) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, (psr & 0xFFFFF000) | num); + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, num, 0x00000fff); } public boolean isSubtitlingOn() { @@ -62,14 +65,8 @@ } public boolean setSubtitling(boolean mode) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - boolean oldMode = (psr & 0x80000000) != 0; - if (mode != oldMode) { - if (mode) - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | 0x80000000); - else - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr & ~0x80000000); - } + boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x80000000) != 0; + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x80000000 : 0, 0x80000000); return oldMode; } @@ -82,14 +79,8 @@ } public boolean setPipSubtitleMode(boolean mode) { - int psr = Libbluray.readPSR(Libbluray.PSR_PG_STREAM); - boolean oldMode = (psr & 0x40000000) != 0; - if (mode != oldMode) { - if (mode) - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr | 0x40000000); - else - Libbluray.writePSR(Libbluray.PSR_PG_STREAM, psr & ~0x40000000); - } + boolean oldMode = (Libbluray.readPSR(Libbluray.PSR_PG_STREAM) & 0x40000000) != 0; + Libbluray.writePSR(Libbluray.PSR_PG_STREAM, mode ? 0x40000000 : 0, 0x40000000); return oldMode; } @@ -131,8 +122,21 @@ } protected void onSubtitleChange(int param) { - listeners.putCallback(new EventObject(this)); + if ((param & 0x80000000) != 0) { + listeners.putCallback(new SubtitleSelectedEvent(this)); + } else { + listeners.putCallback(new SubtitleNotSelectedEvent(this)); + } } + protected void onSubtitleAvailable(boolean param) { + if (param) { + listeners.putCallback(new SubtitleAvailableEvent(this)); + } else { + listeners.putCallback(new SubtitleNotAvailableEvent(this)); + } + } + + private BDJListeners listeners = new BDJListeners(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/UOMaskTableControlImpl.java 2015-05-15 09:25:06.000000000 +0000 @@ -21,7 +21,6 @@ package org.videolan.media.content.playlist; import java.awt.Component; -import java.util.LinkedList; import org.bluray.media.UOMaskTableControl; import org.bluray.media.UOMaskTableListener; @@ -34,7 +33,6 @@ public class UOMaskTableControlImpl implements UOMaskTableControl { protected UOMaskTableControlImpl(Handler player) { - this.player = player; } public Component getControlComponent() { @@ -62,7 +60,6 @@ } protected void onUOMasked(int position) { - // TODO: this method is not called listeners.putCallback(new UOMaskedEvent(this, position)); } @@ -72,5 +69,4 @@ } private BDJListeners listeners = new BDJListeners(); - private Handler player; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoControl.java 2015-01-26 08:01:57.000000000 +0000 @@ -37,10 +37,10 @@ protected HScreenRectangle getNormalizedRectangle(Dimension dimension, Rectangle rectangle) { if ((dimension.width == 0) || (dimension.height == 0)) return new HScreenRectangle(0, 0, 0, 0); - float x = rectangle.x / dimension.width; - float y = rectangle.y / dimension.height; - float w = rectangle.width / dimension.width; - float h = rectangle.height / dimension.height; + float x = (float)rectangle.x / dimension.width; + float y = (float)rectangle.y / dimension.height; + float w = (float)rectangle.width / dimension.width; + float h = (float)rectangle.height / dimension.height; return new HScreenRectangle(x, y, w, h); } @@ -74,6 +74,7 @@ } protected void setVideoArea(HScreenRectangle rectangle) { + org.videolan.Logger.unimplemented("VideoControl", "setVideoArea"); dstArea = rectangle; // TODO } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/playlist/VideoFormatControlImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -43,10 +43,12 @@ if ((ci == null) ||(ci.getVideoStreamCount() <= 0)) return ASPECT_RATIO_UNKNOWN; Dimension aspect = ci.getVideoStreams()[0].getVideoAspectRatio(); - if ((aspect.width == 4) && (aspect.height == 3)) - return ASPECT_RATIO_4_3; - if ((aspect.width == 16) && (aspect.height == 9)) - return ASPECT_RATIO_16_9; + if (aspect != null) { + if ((aspect.width == 4) && (aspect.height == 3)) + return ASPECT_RATIO_4_3; + if ((aspect.width == 16) && (aspect.height == 9)) + return ASPECT_RATIO_16_9; + } return ASPECT_RATIO_UNKNOWN; } @@ -59,6 +61,7 @@ } public VideoTransformation getVideoTransformation(int dfc) { + org.videolan.Logger.unimplemented("VideoFormatControlImpl", "getVideoTransformation"); return null; // TODO: implement } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java 2015-05-15 09:25:06.000000000 +0000 @@ -18,9 +18,7 @@ package org.videolan.media.content.sound; -import java.awt.Component; import java.io.IOException; -import java.util.ArrayList; import javax.media.ClockStartedError; import javax.media.ClockStoppedException; @@ -37,166 +35,75 @@ import javax.media.TimeBase; import javax.media.protocol.DataSource; +import org.bluray.net.BDLocator; + //import org.videolan.media.content.playlist.MediaTimePositionControlImpl; import org.videolan.media.content.playlist.OverallGainControlImpl; import org.videolan.media.content.playlist.PanningControlImpl; -public class Handler implements Player { +import org.videolan.media.content.BDHandler; + +import org.videolan.BDJListeners; +import org.videolan.Libbluray; + +public class Handler extends BDHandler { public Handler() { controls = new Control[3]; controls[0] = new MediaTimePositionControlImpl(this); - controls[1] = new OverallGainControlImpl(); - controls[2] = new PanningControlImpl(); + controls[1] = new OverallGainControlImpl(this); + controls[2] = new PanningControlImpl(this); } public void setSource(DataSource source) throws IOException, IncompatibleSourceException { this.source = new org.videolan.media.protocol.dripfeed.DataSource(source.getLocator()); if (source.getLocator() == null) throw new IncompatibleSourceException(); - } - public int getState() { - synchronized (this) { - return state; - } - } - - public int getTargetState() { - synchronized (this) { - return targetState; - } + try { + locator = new BDLocator(source.getLocator().toExternalForm()); + } catch (org.davic.net.InvalidLocatorException e) { + throw new IncompatibleSourceException(); + } } - public Time getStartLatency() { - return null; + public Time getDuration() { + org.videolan.Logger.unimplemented("Handler", "getDuration"); + long duration = 1; // pi.getDuration() ; + return new Time(duration * TO_SECONDS); } - public Control[] getControls() { - return controls; + protected ControllerErrorEvent doPrefetch() { + return super.doPrefetch(); } - public Control getControl(String forName) { - try { - Class cls = Class.forName(forName); - for (int i = 0; i < controls.length; i++) { - if (cls.isInstance(controls[i])) - return controls[i]; - } - return null; - } catch (ClassNotFoundException e) { - return null; - } - } + protected ControllerErrorEvent doStart(Time at) { - public void addControllerListener(ControllerListener listener) { - synchronized (listeners) { - listeners.add(listener); + ControllerErrorEvent err = super.doStart(at); + if (err != null) { + return err; } - } - public void removeControllerListener(ControllerListener listener) { - synchronized (listeners) { - listeners.remove(listener); + if (!locator.isSoundItem()) { + System.err.println("no sound effect in " + locator); + } else { + int id = locator.getSoundId(); + Libbluray.soundEffect(id); + + // Trigger end of media event + // XXX should use some other event name ... + statusEvent(Libbluray.BDJ_EVENT_END_OF_PLAYLIST, id); } - } - - public void setTimeBase(TimeBase master) - throws IncompatibleTimeBaseException { - throw new IncompatibleTimeBaseException(); - } - - public void realize() { - // TODO Auto-generated method stub - } - - public void prefetch() { - // TODO Auto-generated method stub - } - - public void start() { - // TODO Auto-generated method stub - } - - public void syncStart(Time at) { - // TODO Auto-generated method stub - } - - public void deallocate() { - // TODO Auto-generated method stub - } - - public void close() { - // TODO Auto-generated method stub - } - - public void stop() { - // TODO Auto-generated method stub - } - - public void setStopTime(Time stopTime) { - } - - public Time getStopTime() { return null; } - public void setMediaTime(Time now) { - } - - public Time getMediaTime() { - return new Time(0); - } - - public long getMediaNanoseconds() { - return 0; + protected ControllerErrorEvent doStop() { + return super.doStop(); } - public Time getSyncTime() { - return null; - } - - public TimeBase getTimeBase() { - return null; - } - - public Time mapToTimeBase(Time t) throws ClockStoppedException { - return null; - } - - public float getRate() { - return 1.0f; - } - - public float setRate(float factor) { - return 1.0f; - } - - public Component getVisualComponent() { - return null; - } - - public GainControl getGainControl() { - return null; - } - - public Component getControlPanelComponent() { - return null; - } - - public void addController(Controller newController) - throws IncompatibleTimeBaseException { - } - - public void removeController(Controller oldController) { - } - - public Time getDuration() { - return null; + protected BDLocator getLocator() { + return locator; } - protected int state = Unrealized; - protected int targetState = Unrealized; - protected Control[] controls = null; + private BDLocator locator; private org.videolan.media.protocol.dripfeed.DataSource source = null; - private ArrayList listeners = new ArrayList(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/video/dvb/mpeg/drip/VideoControl.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/video/dvb/mpeg/drip/VideoControl.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/media/content/video/dvb/mpeg/drip/VideoControl.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/media/content/video/dvb/mpeg/drip/VideoControl.java 2015-01-26 08:01:57.000000000 +0000 @@ -36,10 +36,10 @@ protected HScreenRectangle getNormalizedRectangle(Dimension dimension, Rectangle rectangle) { if ((dimension.width == 0) || (dimension.height == 0)) return new HScreenRectangle(0, 0, 0, 0); - float x = rectangle.x / dimension.width; - float y = rectangle.y / dimension.height; - float w = rectangle.width / dimension.width; - float h = rectangle.height / dimension.height; + float x = (float)rectangle.x / dimension.width; + float y = (float)rectangle.y / dimension.height; + float w = (float)rectangle.width / dimension.width; + float h = (float)rectangle.height / dimension.height; return new HScreenRectangle(x, y, w, h); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountException.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/MountException.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountException.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/MountException.java 2015-01-26 08:01:57.000000000 +0000 @@ -23,10 +23,10 @@ public MountException() { super(); } - + public MountException(String message) { super(message); } - + private static final long serialVersionUID = 4108254994972237877L; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountManager.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/MountManager.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/MountManager.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/MountManager.java 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,7 @@ /* * This file is part of libbluray * Copyright (C) 2010 William Hahne + * Copyright (C) 2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,14 +25,15 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.Collections; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.Enumeration; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import org.videolan.Logger; /** * This class handle mounting jar files so that their contents can be accessed. @@ -40,7 +42,15 @@ * */ public class MountManager { + + /* called from org/dvb/dsmcc/ServiceDomain */ public static String mount(int jarId) throws MountException { + /* dispatch mount request to privileged thread */ + return new MountAction(jarId).execute(); + } + + /* package private, called from BDJXletContext */ + protected static String mount(int jarId, boolean classFiles) throws MountException { String jarStr = jarIdToString(jarId); logger.info("Mounting JAR: " + jarStr); @@ -48,90 +58,172 @@ if (jarStr == null) throw new IllegalArgumentException(); - String oldPath = getMount(jarId); - if (oldPath != null) { - logger.error("JAR " + jarId + " already mounted"); - return oldPath; - } - - String path = System.getProperty("bluray.vfs.root") + "/BDMV/JAR/" + jarStr + ".jar"; - - JarFile jar = null; - File tmpDir = null; - try { - jar = new JarFile(path); - tmpDir = File.createTempFile("bdj-", ""); - } catch (IOException e) { - e.printStackTrace(); - throw new MountException(); - } - - // create temporary directory - tmpDir.delete(); - tmpDir.mkdir(); - - try { - byte[] buffer = new byte[32*1024]; - Enumeration entries = jar.entries(); - while (entries.hasMoreElements()) { - JarEntry entry = (JarEntry)entries.nextElement(); - File out = new File(tmpDir + File.separator + entry.getName()); + synchronized (mountPoints) { - logger.info(" mount: " + entry.getName()); + // already mounted ? + MountPoint mountPoint = (MountPoint)mountPoints.get(new Integer(jarId)); + if (mountPoint != null) { + logger.info("JAR " + jarId + " already mounted"); + mountPoint.incRefCount(); - if (entry.isDirectory()) { - out.mkdirs(); + if (classFiles && !mountPoint.classFiles()) { + logger.info("JAR " + jarId + " not complete, remounting"); } else { - /* make sure path exists */ - out.getParentFile().mkdirs(); + return mountPoint.getMountPoint(); + } + } - InputStream inStream = jar.getInputStream(entry); - OutputStream outStream = new FileOutputStream(out); + String path = BDJLoader.getCachedFile(System.getProperty("bluray.vfs.root") + relJarDir + jarStr + ".jar"); - int length; - while ((length = inStream.read(buffer)) > 0) { - outStream.write(buffer, 0, length); + JarFile jar = null; + try { + jar = new JarFile(path, false); + if (mountPoint == null) { + mountPoint = new MountPoint(jarStr, classFiles); + } + } catch (IOException e) { + logger.error("Error opening " + path + ": " + e); + if (jar != null) { + try { + jar.close(); + } catch (IOException e1) { } + } + throw new MountException(); + } - inStream.close(); - outStream.close(); + InputStream inStream = null; + OutputStream outStream = null; + try { + byte[] buffer = new byte[32 * 1024]; + Enumeration entries = jar.entries(); + while (entries.hasMoreElements()) { + JarEntry entry = (JarEntry)entries.nextElement(); + File out = new File(mountPoint.getMountPoint() + File.separator + entry.getName()); + + if (entry.isDirectory()) { + out.mkdirs(); + } else if (!classFiles && entry.getName().endsWith(".class")) { + // logger.info("skip " + entry.getName()); + } else { + /* make sure path exists */ + out.getParentFile().mkdirs(); + + logger.info(" mount: " + entry.getName()); + + try { + inStream = jar.getInputStream(entry); + } catch (SecurityException se) { + logger.error("Error uncompressing " + entry.getName() + " from " + path + ": " + se + "\n" + Logger.dumpStack(se)); + continue; + } + outStream = new FileOutputStream(out); + + int length; + while ((length = inStream.read(buffer)) > 0) { + outStream.write(buffer, 0, length); + } + + inStream.close(); + outStream.close(); + } + } + } catch (IOException e) { + logger.error("Error uncompressing " + path + ": " + e); + mountPoint.remove(); + throw new MountException(); + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException e) { + } + } + if (outStream != null) { + try { + outStream.close(); + } catch (IOException e) { + } + } + try { + jar.close(); + } catch (IOException e) { } } - } catch (IOException e) { - e.printStackTrace(); - recursiveDelete(tmpDir); - throw new MountException(); - } - logger.info("Mounting JAR " + jarId + " complete."); + if (mountPoint.classFiles() != classFiles) { + if (mountPoint.classFiles()) { + logger.error("assertion failed"); + } else { + logger.info("Remounting FULL JAR " + jarId + " complete."); + mountPoint.setClassFiles(); + } + } else { + logger.info("Mounting " + (classFiles ? "FULL" : "PARTIAL") + " JAR " + jarId + " complete."); + + mountPoints.put(new Integer(jarId), mountPoint); + } - mountPoints.put(new Integer(jarId), tmpDir); - return tmpDir.getAbsolutePath(); + return mountPoint.getMountPoint(); + } } - public static void unmount(int jarId) { + private static void unmount(int jarId) { logger.info("Unmounting JAR: " + jarId); - Integer id = new Integer(jarId); - File mountPoint = (File)mountPoints.get(id); - if (mountPoint != null) { - recursiveDelete(mountPoint); - mountPoints.remove(id); + + final Integer id = new Integer(jarId); + final MountPoint mountPoint; + + synchronized (mountPoints) { + mountPoint = (MountPoint)mountPoints.get(id); + if (mountPoint == null) { + logger.info("JAR " + jarId + " not mounted"); + return; + } + + AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + if (mountPoint.decRefCount() < 1) { + mountPoints.remove(id); + } + return null; + } + }); } } - public static void unmountAll() { - Iterator iterator = mountPoints.keySet().iterator(); - while (iterator.hasNext()) - unmount(((Integer)iterator.next()).intValue()); + /* package private, called from Libbluray.shutdown() */ + protected static void unmountAll() { + logger.info("Unmounting all JARs"); + + Object[] dirs; + + synchronized (mountPoints) { + dirs = mountPoints.values().toArray(); + mountPoints.clear(); + } + if (dirs != null) { + for (int i = 0; i < dirs.length; i++) { + ((MountPoint)dirs[i]).remove(); + } + } } + /* called from org/dvb/dsmcc/ServiceDomain */ public static String getMount(int jarId) { Integer id = new Integer(jarId); - if (mountPoints.containsKey(id)) { - return ((File)mountPoints.get(id)).getAbsolutePath(); + MountPoint mountPoint; + + synchronized (mountPoints) { + mountPoint = (MountPoint)mountPoints.get(id); + } + if (mountPoint != null) { + return mountPoint.getMountPoint(); } else { - return null; + logger.info("JAR " + jarId + " not mounted"); } + return null; } private static String jarIdToString(int jarId) { @@ -140,20 +232,86 @@ return BDJUtil.makeFiveDigitStr(jarId); } - private static void recursiveDelete(File dir) { - File[] files = dir.listFiles(); - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (file.isDirectory()) { - recursiveDelete(file); - } else { - file.delete(); + private static final String relJarDir = new String(File.separator + "BDMV" + File.separator + "JAR" + File.separator); + private static Map mountPoints = new HashMap(); + private static final Logger logger = Logger.getLogger(MountManager.class.getName()); + + private static class MountPoint { + public MountPoint(String id, boolean classFiles) throws IOException { + this.dir = CacheDir.create("mount", id); + this.refCount = 1; + this.classFiles = classFiles; + } + + public synchronized String getMountPoint() { + if (dir != null) { + return dir.getAbsolutePath(); } + return null; } - dir.delete(); - } + public synchronized void remove() { + if (dir != null) { + CacheDir.remove(dir); + dir = null; + refCount = 0; + } + } - private static Map mountPoints = Collections.synchronizedMap(new HashMap()); - private static final Logger logger = Logger.getLogger(MountManager.class.getName()); + public synchronized int incRefCount() { + return ++refCount; + } + + public synchronized int decRefCount() { + refCount--; + if (refCount < 1) { + remove(); + } + return refCount; + } + + public boolean classFiles() { + return classFiles; + } + + public boolean setClassFiles() { + return classFiles == true; + } + + private File dir; + private int refCount; + private boolean classFiles; + }; + + private static class MountAction extends BDJAction { + public MountAction(int jarId) { + this.jarId = jarId; + } + + protected void doAction() { + try { + this.mountPoint = (String)AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Object run() throws MountException { + return mount(jarId, true); + } + }); + } catch (PrivilegedActionException e) { + this.exception = (MountException) e.getException(); + } + } + + public String execute() throws MountException { + BDJActionManager.getInstance().putCommand(this); + waitEnd(); + if (exception != null) { + throw exception; + } + return mountPoint; + } + + private final int jarId; + private String mountPoint = null; + private MountException exception = null; + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/TitleInfo.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/TitleInfo.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/TitleInfo.java 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/TitleInfo.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,22 +19,20 @@ package org.videolan; public class TitleInfo { - public TitleInfo(int title, int objType, int playbackType, String bdjoName, int hdmvOID) { + public TitleInfo(int title, int objType, int playbackType, int idRef) { this.title = title; this.objType = objType; this.playbackType = playbackType; - this.bdjoName = bdjoName; - this.hdmvOID = hdmvOID; + if (objType == OBJ_TYPE_BDJ) + this.bdjoName = (new java.text.DecimalFormat("00000")).format(idRef); + else + this.hdmvOID = idRef; } public int getTitleNum() { return title; } - public int getObjType() { - return objType; - } - public int getPlaybackType() { return playbackType; } @@ -58,8 +56,8 @@ private int title; private int objType; private int playbackType; - private String bdjoName; - private int hdmvOID; + private String bdjoName = null; + private int hdmvOID = -1; public static final int OBJ_TYPE_HDMV = 1; public static final int OBJ_TYPE_BDJ = 2; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/VFSCache.java libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/VFSCache.java --- libbluray-0.5.0/src/libbluray/bdj/java/org/videolan/VFSCache.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/org/videolan/VFSCache.java 2015-04-06 16:13:40.000000000 +0000 @@ -0,0 +1,357 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.AccessController; +import java.security.PrivilegedAction; + +import java.io.BDFileSystem; +import org.videolan.bdjo.AppCache; + +class VFSCache { + + protected static VFSCache createInstance() { + VFSCache cache = new VFSCache(); + try { + cache.init(); + } catch (IOException e) { + return null; + } + return cache; + } + + private VFSCache() {} + + private void init() throws IOException { + + String disable = System.getProperty("org.videolan.vfscache"); + if (disable != null && disable.equals("NO")) { + logger.error ("Cache disabled !"); + throw new IOException(); + } + + cacheRoot = CacheDir.create("VFSCache").getPath() + File.separator; + fontRoot = CacheDir.create("Font").getPath() + File.separator; + vfsRoot = System.getProperty("bluray.vfs.root"); + + if (vfsRoot == null) { + System.err.println("disc root is in UDF"); + System.setProperty("bluray.vfs.root", cacheRoot); + vfsRoot = cacheRoot; + cacheAll = true; + } + + if (!vfsRoot.endsWith(File.separator)) { + vfsRoot = vfsRoot + File.separator; + } + vfsRootLength = vfsRoot.length(); + } + + /* + * + */ + + private boolean copyStream(InputStream inStream, String dstPath) { + OutputStream outStream = null; + byte[] buffer = new byte[64*1024]; + IOException exception = null; + + try { + int length; + outStream = new FileOutputStream(dstPath); + while ((length = inStream.read(buffer)) > 0) { + outStream.write(buffer, 0, length); + } + + } catch (IOException e) { + exception = e; + + } finally { + if (outStream != null) { + try { + outStream.close(); + } catch (IOException e) { + if (exception == null) + exception = e; + } + } + } + + if (exception != null) { + logger.error("Error caching to " + dstPath + ": " + exception); + new File(dstPath).delete(); + return false; + } + + //logger.info("Cached file " + srcPath + " to " + dstPath); + return true; + } + + private boolean copyFile(String srcPath, String dstPath) { + InputStream inStream = null; + IOException exception = null; + boolean result = false; + + try { + inStream = new FileInputStream(srcPath); + result = copyStream(inStream, dstPath); + + } catch (IOException e) { + exception = e; + + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException e) { + if (exception == null) + exception = e; + } + } + } + + if (exception != null) { + logger.error("Error caching " + srcPath + ": " + exception); + new File(dstPath).delete(); + return false; + } + + //logger.info("Cached file " + srcPath + " to " + dstPath); + return result; + } + + private void copyJarFile(String name) { + /* copy file from BDMV/JAR/ */ + + String relPath = jarDir + name; + String dstPath = cacheRoot + relPath; + + if (BDFileSystem.nativeFileExists(dstPath)) { + //logger.info(dstPath + " already cached"); + return; + } + + Libbluray.cacheBdRomFile(relPath, dstPath); + + logger.info("cached " + relPath); + } + + private void copyJarDir(String name, String[] files) { + + for (int i = 0; i < files.length; i++) { + String relPath = name + File.separator + files[i]; + String[] subFiles = Libbluray.listBdFiles(relPath, true); + if (subFiles != null) { + copyJarDir(relPath, subFiles); + } else { + Libbluray.cacheBdRomFile(relPath, cacheRoot + relPath); + } + } + } + + private void copyJarDir(String name) { + /* copy directory from BDMV/JAR/ */ + + String relPath = jarDir + name; + String[] files = Libbluray.listBdFiles(relPath, true); + if (files == null) { + return; + } + copyJarDir(relPath, files); + logger.info("cached " + relPath); + } + + /* + * Add files from BD-ROM filesystem to cache + * Called by BDJLoader when starting the title + */ + protected synchronized void add(AppCache[] appCaches) { + + for (int i = 0; i < appCaches.length; i++) { + if (appCaches[i].getType() == AppCache.JAR_FILE) { + copyJarFile(appCaches[i].getRefToName() + ".jar"); + } else if (appCaches[i].getType() == AppCache.DIRECTORY) { + copyJarDir(appCaches[i].getRefToName()); + } else { + logger.error("unknown AppCache type " + appCaches[i].getType()); + } + } + } + + protected synchronized File addFont(String fontFile) { + + String relPath = fontDir + fontFile; + String dstPath = fontRoot + relPath; + File dstFile = new File(dstPath); + + if (BDFileSystem.nativeFileExists(dstPath)) { + //logger.info(dstPath + " already cached"); + return dstFile; + } + + if (!Libbluray.cacheBdRomFile(relPath, dstPath)) { + return null; + } + + logger.info("cached font " + fontFile); + return dstFile; + } + + protected synchronized File addFont(InputStream is) { + + new File(fontRoot).mkdirs(); + + // 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"); + try { + tmpFile = new File(tmpFile.getCanonicalPath()); + if (!tmpFile.exists()) { + break; + } + } catch (IOException ex) { + logger.error("got " + ex); + } + tmpFile = null; + } + if (tmpFile == null) { + logger.error("error creating temporary font file"); + return null; + } + + if (!copyStream(is, tmpFile.getPath())) { + return null; + } + + logger.info("cached font stream to file " + tmpFile.getPath()); + return tmpFile; + } + + /* + * Accessing any file triggers security manager checks. + * -> we cache the file (on demand) so that it will be accessible by standard Java I/O. + */ + boolean inAccessFile = false; + protected void accessFile(String absPath) { + if (!cacheAll) { + /* BD-ROM filesystem is accessible with standard I/O */ + return; + } + + if (!absPath.startsWith(vfsRoot)) { + /* path does not map to VFS */ + return; + } + + accessFileSynced(absPath); + } + + protected synchronized void accessFileSynced(String absPath) { + + if (inAccessFile) { + /* avoid recursion from SecurityManager checks */ + return; + } + + inAccessFile = true; + accessFileImp(absPath); + inAccessFile = false; + } + + private void accessFileImp(String absPath) { + + if (BDFileSystem.nativeFileExists(absPath)) { + /* file is already cached */ + return; + } + + String relPath = absPath.substring(vfsRootLength); + String[] names = Libbluray.listBdFiles(relPath, true); + if (names != null) { + /* this is directory */ + return; + } + + /* do not cache .m2ts streams */ + if (relPath.startsWith("BDMV" + File.separator + "STREAM" + File.separator)) { + return; + } + + /* finally, copy the file to cache */ + Libbluray.cacheBdRomFile(relPath, cacheRoot + relPath); + } + + + /* + * Add file from binding unit data area to cache + */ + protected synchronized boolean add(String vpFile, String budaFile) { + + String srcPath = System.getProperty("bluray.bindingunit.root") + File.separator + budaFile; + String dstPath = cacheRoot + vpFile; + + return copyFile(srcPath, dstPath); + } + + /* + * Check if file is cached. + * + * absPath: path in BD VFS. + * return: path of cached file, absPath if file is not in cache. + */ + public synchronized String map(String absPath) { + + if (cacheAll) { + return absPath; + } + + if (!absPath.startsWith(vfsRoot)) { + //logger.info(absPath + " not in BDMV/JAR"); + return absPath; + } + + String cachePath = cacheRoot + absPath.substring(vfsRootLength); + if (!BDFileSystem.nativeFileExists(cachePath)) { + //logger.info(cachePath + " not in VFS cache"); + return absPath; + } + + logger.info("using cached " + cachePath); + return cachePath; + } + + private String cacheRoot = null; + private String vfsRoot = null; + private String fontRoot = null; + private int vfsRootLength = 0; + private boolean cacheAll = false; + + private static final String jarDir = "BDMV" + File.separator + "JAR" + File.separator; + private static final String fontDir = "BDMV" + File.separator + "AUXDATA" + File.separator; + + private static final Logger logger = Logger.getLogger(VFSCache.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java/sun/font/FontDesignMetrics.java libbluray-0.8.1/src/libbluray/bdj/java/sun/font/FontDesignMetrics.java --- libbluray-0.5.0/src/libbluray/bdj/java/sun/font/FontDesignMetrics.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java/sun/font/FontDesignMetrics.java 2015-03-20 10:51:10.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * This file is part of libbluray + * Copyright (C) 2015 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 + * . + */ + +package sun.font; + +import java.awt.FontMetrics; +import java.awt.Font; + +/* + * This class is used to "fix" Java 7 java.awt.Component.getFontMetrics() + * + * one disc calls directly (new java.awt.Component() { ... } ).getFontMetrics(font) + * + */ + +public class FontDesignMetrics extends FontMetrics { + + protected interface GetFontMetricsAccess { + public abstract FontDesignMetrics getFontMetrics(Font font); + } + + private static GetFontMetricsAccess access; + + protected static void setGetFontMetricsAccess(GetFontMetricsAccess a) { + access = a; + } + + /* + * + */ + + public static FontDesignMetrics getMetrics(Font font) { + return access.getFontMetrics(font); + } + + protected FontDesignMetrics(Font font) { + super(font); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDGraphicsConfiguration.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,46 +19,8 @@ package java.awt; -import java.awt.color.ColorSpace; -import java.awt.image.BufferedImage; -import java.awt.image.ColorModel; -import java.awt.image.DataBuffer; -import java.awt.image.DirectColorModel; -import java.awt.image.VolatileImage; - -class BDGraphicsConfiguration extends GraphicsConfiguration { - private BDGraphicsDevice device; - +class BDGraphicsConfiguration extends BDGraphicsConfigurationBase { BDGraphicsConfiguration(BDGraphicsDevice device) { - this.device = device; - } - - public GraphicsDevice getDevice() { - return device; - } - - public Rectangle getBounds() { - return device.getBounds(); - } - - int getCompatibleImageType() { - return BufferedImage.TYPE_INT_ARGB; - } - - public synchronized ColorModel getColorModel() { - return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), - 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, - DataBuffer.TYPE_INT); - } - - public BufferedImage createCompatibleImage(int width, int height) { - if (width <= 0 || height <= 0) - return null; - return BDImage.getBuffededImage(width, height, this); - } - - public VolatileImage createCompatibleVolatileImage(int width, int height) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); - return null; + super(device); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,671 +19,17 @@ package java.awt; -import java.lang.reflect.Field; -import java.text.AttributedCharacterIterator; -import java.util.Arrays; -import java.awt.image.AreaAveragingScaleFilter; -import java.awt.image.BufferedImage; -import java.awt.image.ImageConsumer; -import java.awt.image.ImageObserver; - -import org.dvb.ui.DVBBufferedImage; - -import sun.awt.ConstrainableGraphics; - -import org.videolan.Logger; - -class BDGraphics extends Graphics2D implements ConstrainableGraphics { - private static final Color DEFAULT_COLOR = Color.BLACK; - private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); - - private int width; - private int height; - private int[] backBuffer; - private Area dirty; - private GraphicsConfiguration gc; - private Color foreground; - private Color background; - private Font font; - private BDFontMetrics fontMetrics; - private AlphaComposite composite; - - /** The current xor color. If null then we are in paint mode. */ - private Color xorColor; - - /** Translated X, Y offset from native offset. */ - private int originX; - private int originY; - - /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ - private Rectangle actualClip; - - /** The current user clip rectangle or null if no clip has been set. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. */ - private Rectangle clip; - - /** The rectangle this graphics object has been constrained too. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. - If it is null then this graphics has not been constrained. The constrained rectangle - is another layer of clipping independant of the user clip. */ - private Rectangle constrainedRect; - +class BDGraphics extends BDGraphicsBase { BDGraphics(BDGraphics g) { - backBuffer = g.backBuffer; - dirty = g.dirty; - width = g.width; - height = g.height; - gc = g.gc; - foreground = g.foreground; - background = g.background; - composite = g.composite; - font = g.font; - fontMetrics = g.fontMetrics; - originX = g.originX; - originY = g.originY; - actualClip = g.clip; - clip = g.clip; - constrainedRect = g.constrainedRect; + super(g); } BDGraphics(BDRootWindow window) { - width = window.getWidth(); - height = window.getHeight(); - backBuffer = window.getBdBackBuffer(); - dirty = window.getDirtyArea(); - gc = window.getGraphicsConfiguration(); - foreground = window.getForeground(); - background = window.getBackground(); - font = window.getFont(); - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = DEFAULT_COLOR; - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); + super(window); } BDGraphics(BDImage image) { - width = image.getWidth(); - height = image.getHeight(); - backBuffer = image.getBdBackBuffer(); - dirty = image.getDirtyArea(); - gc = image.getGraphicsConfiguration(); - Component component = image.getComponent(); - if (component != null) { - foreground = component.getForeground(); - background = component.getBackground(); - font = component.getFont(); - } - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = new Color(0, 0, 0, 0); - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); - } - - public Graphics create() { - return new BDGraphics(this); - } - - public void translate(int x, int y) { - originX += x; - originY += y; - } - - public void setFont(Font font) { - if (font != null && !font.equals(this.font)) { - this.font = font; - fontMetrics = BDFontMetrics.getFontMetrics(font); - } - } - - public Font getFont() { - return font; - } - - public FontMetrics getFontMetrics() { - return fontMetrics; - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - - public void setColor(Color c) { - if ((c != null) && (c != foreground)) - foreground = c; - } - - public Color getColor() { - return foreground; - } - - public Composite getComposite() { - return composite; - } - - public GraphicsConfiguration getDeviceConfiguration() { - return gc; - } - - public void setComposite(Composite comp) { - if ((comp != null) && (comp != composite)) { - if (!(comp instanceof AlphaComposite)) - throw new IllegalArgumentException("Only AlphaComposite is supported"); - composite = (AlphaComposite) comp; - } - } - - public void setPaintMode() { - xorColor = null; - } - - public void setXORMode(Color color) { - xorColor = color; - } - - /** Gets the current clipping area. */ - public Rectangle getClipBounds() { - if (clip != null) - return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); - return null; - } - - public void constrain(int x, int y, int w, int h) { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); - originX = constrainedRect.x; - originY = constrainedRect.y; - setupClip(); - } - - /** Returns a Shape object representing the clip. */ - public Shape getClip() { - return getClipBounds(); - } - - /** Crops the clipping rectangle. */ - public void clipRect(int x, int y, int w, int h) { - Rectangle rect = new Rectangle(x + originX, y + originY, w, h); - if (clip != null) - clip = clip.intersection(rect); - else - clip = rect; - setupClip(); - } - - /** Sets the clipping rectangle. */ - public void setClip(int x, int y, int w, int h) { - clip = new Rectangle (x + originX, y + originY, w, h); - setupClip(); - } - - /** Sets the clip to a Shape (only Rectangle allowed). */ - public void setClip(Shape clip) { - if (clip == null) { - this.clip = null; - setupClip(); - } else if (clip instanceof Rectangle) { - Rectangle rect = (Rectangle) clip; - setClip(rect.x, rect.y, rect.width, rect.height); - } else - throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); - } - - private void setupClip() { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - if (clip != null) - actualClip = clip.intersection(rect); - else - actualClip = rect; - } - - private int alphaBlend(int dest, int src) { - int As = src >>> 24; - if (As == 0) - return dest; - if (As == 255) - return src; - int Ad = (dest >>> 24); - if (Ad == 0) - return src; - int R, G, B; - R = ((src >>> 16) & 255) * As * 255; - G = ((src >>> 8) & 255) * As * 255; - B = (src & 255) * As * 255; - Ad = Ad * (255 - As); - As = As * 255 + Ad; - R = (R + ((dest >>> 16) & 255) * Ad) / As; - G = (G + ((dest >>> 8) & 255) * Ad) / As; - B = (B + (dest & 255) * Ad) / As; - R = Math.min(255, R); - G = Math.min(255, G); - B = Math.min(255, B); - Ad = As / 255; - Ad = Math.min(255, Ad); - return (Ad << 24) | (R << 16) | (G << 8) | B; - } - - private void drawPointN(int x, int y, int rgb) { - - dirty.add(x, y); - - if (xorColor != null) { - backBuffer[y * width + x] ^= xorColor.getRGB() ^ rgb; - return; - } - int rule; - if (composite != null) { - rule = composite.getRule(); - rgb = ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); - } else { - rule = AlphaComposite.SRC_OVER; - } - switch (rule) { - case AlphaComposite.CLEAR: - backBuffer[y * width + x] = 0; - break; - case AlphaComposite.SRC: - backBuffer[y * width + x] = rgb; - break; - case AlphaComposite.SRC_OVER: - backBuffer[y * width + x] = alphaBlend(backBuffer[y * width + x], rgb); - break; - } - } - - private void drawGlyph(int[] rgbArray, int x0, int y0, int w, int h) { - for (int y = 0; y < h; y++) - for (int x = 0; x < w; x++) - drawPoint(x + x0, y + y0, rgbArray[y * w + x]); - } - - private void drawPoint(int x, int y, int rgb) { - x += originX; - y += originY; - if (actualClip.contains(x, y)) - drawPointN(x, y, rgb); - } - - public void clearRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = background.getRGB(); - for (int i = 0; i < h; i++) - Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); - - dirty.add(rect); - } - - public void fillRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = foreground.getRGB(); - for (int Y = y; Y < (y + h); Y++) - for (int X = x; X < (x + w); X++) - drawPointN(X, Y, rgb); - } - - public void drawRect(int x, int y, int w, int h) { - drawLineN(x, y, x + w, y); - drawLineN(x, y + h, x + w, y + h); - drawLineN(x, y, x, y + h); - drawLineN(x + w, y, x + w, y + h); + super(image); } - - public void drawLineN(int x1, int y1, int x2, int y2) { - int rgb = foreground.getRGB(); - int dy = y2 - y1; - int dx = x2 - x1; - int stepx, stepy; - int fraction; - if (dy < 0) { - dy = -dy; - stepy = -1; - } else { - stepy = 1; - } - if (dx < 0) { - dx = -dx; - stepx = -1; - } else { - stepx = 1; - } - dy <<= 1; - dx <<= 1; - - drawPointN(x1, y1, rgb); - - if (dx > dy) { - fraction = dy - (dx >> 1); - while (x1 != x2) { - if (fraction >= 0) { - y1 += stepy; - fraction -= dx; - } - x1 += stepx; - fraction += dy; - drawPointN(x1, y1, rgb); - } - } else { - fraction = dx - (dy >> 1); - while (y1 != y2) { - if (fraction >= 0) { - x1 += stepx; - fraction -= dy; - } - y1 += stepy; - fraction += dx; - drawPointN(x1, y1, rgb); - } - } - } - - public void drawLine(int x1, int y1, int x2, int y2) { - drawLineN(x1, y1, x2, y2); - } - - /** - * Copies an area of the canvas that this graphics context paints to. - * @param X the x-coordinate of the source. - * @param Y the y-coordinate of the source. - * @param W the width. - * @param H the height. - * @param dx the horizontal distance to copy the pixels. - * @param dy the vertical distance to copy the pixels. - */ - public void copyArea(int X, int Y, int W, int H, int dx, int dy) { - X += originX; - Y += originY; - logger.unimplemented("copyArea"); - } - - /** Draws lines defined by an array of x points and y points */ - public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - } - } - - /** Draws a polygon defined by an array of x points and y points */ - public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - if (nPoints > 2) - drawLineN(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); - } - } - - /** Fills a polygon with the current fill mask */ - public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { - logger.unimplemented("fillPolygon"); - } - - /** Draws an oval to fit in the given rectangle */ - public void drawOval(int x, int y, int w, int h) { - logger.unimplemented("drawOval"); - } - - /** Fills an oval to fit in the given rectangle */ - public void fillOval(int x, int y, int w, int h) { - logger.unimplemented("fillOval"); - } - - /** - * Draws an arc bounded by the given rectangle from startAngle to - * endAngle. 0 degrees is a vertical line straight up from the - * center of the rectangle. Positive start angle indicate clockwise - * rotations, negative angle are counter-clockwise. - */ - public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("drawArc"); - } - - /** fills an arc. arguments are the same as drawArc. */ - public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("fillArc"); - } - - /** Draws a rounded rectangle. */ - public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("drawRoundRect"); - } - - /** Draws a filled rounded rectangle. */ - public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("fillRoundRect"); - } - - protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); - - /** Draws the given string. */ - public void drawString(String string, int x, int y) { - drawStringN(fontMetrics.ftFace, string, x, y, foreground.getRGB()); - } - - /** Draws the given character array. */ - public void drawChars(char chars[], int offset, int length, int x, int y) { - drawStringN(fontMetrics.ftFace, new String(chars, offset, length), x, y, foreground.getRGB()); - } - - public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { - logger.unimplemented("drawString"); - } - - /** - * Draws an image at x,y in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return drawImage(img, x, y, null, observer); - } - - /** - * Draws an image at x,y in nonblocking mode with a solid background - * color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, Color bg, - ImageObserver observer) { - return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - ImageObserver observer) { - return drawImage(img, x, y, w, h, null, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * solid background color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - Color bg, ImageObserver observer) { - return drawImageN(img, x, y, w, h, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle - * in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - ImageObserver observer) { - return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bg, ImageObserver observer) { - if ((dx1 >= dx2) || (dy1 >= dy2)) - return false; - return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, - sx1, sy1, sx2 - sx1, sy2 - sy1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - protected boolean drawImageN(Image img, - int dx, int dy, int dw, int dh, - int sx, int sy, int sw, int sh, - Color bg, ImageObserver observer) { - if ((sx < 0) || (sy < 0) || - (sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) - return false; - - BDImage bdImage; - if (img instanceof BDImage) { - bdImage = (BDImage)img; - } else if (img instanceof DVBBufferedImage) { - bdImage = (BDImage)getBufferedImagePeer( - (BufferedImage)(((DVBBufferedImage)img).getImage())); - } else if (img instanceof BufferedImage) { - bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); - } else { - logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); - return false; - } - - if (bdImage instanceof BDImageConsumer) { - BDImageConsumer consumer = (BDImageConsumer)bdImage; - if (!consumer.isComplete(observer)) { - return false; - } - } - - if(sx + sw > bdImage.width) { - int n = sx + sw - bdImage.width; - dw -= dw * n / sw; - sw -= n; - } - - if(sy + sh > bdImage.height) { - int n = sy + sh - bdImage.height; - dh -= dh * n / sh; - sh -= n; - } - - if ((sw > 0) && (sh > 0) && - ((sx != 0) || (sy != 0) || (sw != bdImage.width) || (sh != bdImage.height))) { - BDImage subImage = new BDImage(null, sw, sh, null); - bdImage.getRGB(sx, sy, sw, sh, subImage.getBdBackBuffer(), 0, sw); - bdImage = subImage; - } - if ((dw > 0) && (dh > 0) && - ((dw != bdImage.width) || (dh != bdImage.height))) { - BDImageConsumer scaledImage = new BDImageConsumer(null); - AreaAveragingScaleFilter scaleFilter = - new AreaAveragingScaleFilter(dw, dh); - scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage); - scaleFilter.setDimensions(bdImage.width, bdImage.height); - scaleFilter.setPixels(0, 0, bdImage.width, bdImage.height, - bdImage.getColorModel(), bdImage.getBdBackBuffer(), - 0, bdImage.width); - scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE); - bdImage = scaledImage; - } - int[] rgbArray = bdImage.getBdBackBuffer(); - int bgColor; - if (bg != null) - bgColor = bg.getRGB(); - else - bgColor = 0; - // TODO: optimize this - for (int y = dy; y < (dy + bdImage.height); y++) - for (int x = dx; x < (dx + bdImage.width); x++) { - if (bg != null) - drawPoint(x, y, bgColor); - drawPoint(x, y, rgbArray[(y - dy) * bdImage.width + (x - dx)]); - } - return true; - } - - public Stroke getStroke() { - logger.unimplemented("getStroke"); - throw new Error(); - } - - public void setStroke(Stroke stroke) { - logger.unimplemented("setStroke"); - } - - public void dispose() { - } - - public String toString() { - return getClass().getName() + "[" + originX + "," + originY + "]"; - } - - private static Image getBufferedImagePeer(BufferedImage image) { - try { - return (Image)bufferedImagePeer.get(image); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return null; - } - - private static Field bufferedImagePeer; - - static { - try { - Class c = Class.forName("java.awt.image.BufferedImage"); - bufferedImagePeer = c.getDeclaredField("peer"); - bufferedImagePeer.setAccessible(true); - } catch (ClassNotFoundException e) { - throw new AWTError("java.awt.image.BufferedImage not found"); - } catch (SecurityException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); - } catch (NoSuchFieldException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not found"); - } - } - - private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); } + diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,226 +19,23 @@ package java.awt; -import java.awt.image.ColorModel; -import java.awt.image.ImageObserver; -import java.awt.image.ImageProducer; -import java.io.File; -import java.net.URL; -import java.util.Collections; -import java.util.Hashtable; -import java.util.WeakHashMap; -import java.util.Map; -import java.util.Iterator; - import sun.awt.NullGraphics; -import sun.awt.image.ByteArrayImageSource; -import sun.awt.image.FileImageSource; -import sun.awt.image.URLImageSource; - -import org.videolan.BDJXletContext; -import org.videolan.Logger; - -public class BDToolkit extends Toolkit { - private EventQueue eventQueue = new EventQueue(); - private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); - private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); - private static Hashtable cachedImages = new Hashtable(); - private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); - - public BDToolkit () {} - - public static void setFocusedWindow(Window window) { - /* nothing to do */ - } - public static void shutdown() { - Toolkit toolkit = getDefaultToolkit(); - if (toolkit instanceof BDToolkit) { - ((BDToolkit)toolkit).dispose(); - } - } +public class BDToolkit extends BDToolkitBase { - public void dispose() { - if (eventQueue != null) { - BDJHelper.stopEventQueue(eventQueue); - eventQueue = null; - } - cachedImages = null; - } - - public Dimension getScreenSize() { - Rectangle dims = defaultGC.getBounds(); - return new Dimension(dims.width, dims.height); + public BDToolkit () { } Graphics getGraphics(Window window) { - if (!(window instanceof BDRootWindow)) + if (!(window instanceof BDRootWindow)) { return new NullGraphics(window); + } return new BDWindowGraphics((BDRootWindow)window); } - GraphicsEnvironment getLocalGraphicsEnvironment() { - return localEnv; - } - - public int getScreenResolution() { - return 72; - } - - public ColorModel getColorModel() { - return defaultGC.getColorModel(); - } - - public String[] getFontList() { - return BDFontMetrics.getFontList(); - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - public void sync() { - Window window = ((BDGraphicsDevice)localEnv.getDefaultScreenDevice()).getWindow(); + Window window = ((BDGraphicsDevice)getLocalGraphicsEnvironment().getDefaultScreenDevice()).getWindow(); if (window instanceof BDRootWindow) ((BDRootWindow)window).sync(); } - - static void clearCache(BDImage image) { - synchronized (cachedImages) { - Iterator i = cachedImages.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry entry = (Map.Entry) i.next(); - if (entry.getValue() == image) { - i.remove(); - return; - } - } - } - } - - public Image getImage(String filename) { - if (cachedImages.containsKey(filename)) - return (Image)cachedImages.get(filename); - Image newImage = createImage(filename); - if (newImage != null) - cachedImages.put(filename, newImage); - return newImage; - } - - public Image getImage(URL url) { - if (cachedImages.containsKey(url)) - return (Image)cachedImages.get(url); - Image newImage = createImage(url); - if (newImage != null) - cachedImages.put(url, newImage); - return newImage; - } - - public Image createImage(String filename) { - if (!new File(filename).exists()) { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); - URL url = cldr.getResource(filename); - if (url != null) { - logger.warning("" + filename + " translated to " + url); - return createImage(url); - } else { - logger.error("ClassLoader failed to translate " + filename); - } - } else { - logger.error("createImage(" + filename + "): no XletContext available!\n" + logger.dumpStack()); - } - } - - ImageProducer ip = new FileImageSource(filename); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(URL url) { - ImageProducer ip = new URLImageSource(url); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(byte[] imagedata, - int imageoffset, - int imagelength) { - ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(ImageProducer producer) { - return new BDImageConsumer(producer); - } - - public Image createImage(Component component, int width, int height) { - return new BDImage(component, width, height, defaultGC); - } - - public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) - return true; - BDImageConsumer img = (BDImageConsumer)image; - return img.prepareImage(observer); - } - - public int checkImage(Image image, int width, int height, - ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) { - return ImageObserver.ALLBITS; - } - BDImageConsumer img = (BDImageConsumer)image; - return img.checkImage(observer); - } - - public void beep() { - } - - // mapping of Components to AppContexts, WeakHashMap - private static final Map contextMap = - Collections.synchronizedMap(new WeakHashMap()); - - public static void addComponent(Component component) { - - BDJXletContext context = BDJXletContext.getCurrentContext(); - if (context == null) { - logger.warning("addComponent() outside of app context"); - return; - } - contextMap.put(component, context); - } - - public static EventQueue getEventQueue(Component component) { - if (component != null) { - do { - BDJXletContext ctx = (BDJXletContext)contextMap.get(component); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq == null) { - logger.warning("getEventQueue() failed: no context event queue"); - } - return eq; - } - - component = component.getParent(); - } while (component != null); - - logger.warning("getEventQueue() failed: no context"); - } - return null; - } - - protected EventQueue getSystemEventQueueImpl() { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq != null) { - return eq; - } - } - return eventQueue; - } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/io/BDFileSystemImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * 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 + * . + */ + +package java.io; + +class BDFileSystemImpl extends BDFileSystem { + + public BDFileSystemImpl(FileSystem fs) { + super(fs); + } + + /* Different in SE */ + public boolean checkAccess(File f, boolean write) { + return fs.checkAccess(f, write); + } + + /* Not in SE */ + public boolean deleteOnExit(File f) { + return fs.deleteOnExit(f); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/Closeable.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/io/Closeable.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/java/io/Closeable.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/java/io/Closeable.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * 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 + * . + */ + +package java.io; + +public interface Closeable { + public abstract void close() throws IOException; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/dvb/ui/FontFactory.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/dvb/ui/FontFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/dvb/ui/FontFactory.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/dvb/ui/FontFactory.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -package org.dvb.ui; - -import java.awt.Font; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -import java.net.URL; -import java.net.URLConnection; - -import org.videolan.BDJUtil; -import org.videolan.FontIndex; -import org.videolan.FontIndexData; -import org.videolan.Logger; - -import sun.net.www.ParseUtil; - -public class FontFactory { - public static void loadDiscFonts() { - unloadDiscFonts(); - - fonts = FontIndex.parseIndex(BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/dvb.fontindex")); - - if (fonts != null) { - logger.trace("Disc fonts:"); - for (int i = 0; i < fonts.length; i++) - System.err.println(" "+(i+1)+": " + fonts[i].toString()); - } else { - logger.trace("No fonts loaded from disc"); - } - } - - public static void unloadDiscFonts() { - if (fonts != null) { - fonts = null; - } - } - - public FontFactory() throws FontFormatException, IOException { - if (fonts == null) - throw new IOException("There is no font data"); - } - - public FontFactory(URL u) throws IOException, FontFormatException { - String path = u.getPath().replace('/', File.separatorChar); - path = ParseUtil.decode(path); - if (u.getProtocol().equals("file")) { - path = path.replace('/', File.separatorChar); - file = new File(path); - } else { - int index = path.lastIndexOf('/'); - if (index >= 0) - path = path.substring(index + 1); - path = System.getProperty("bluray.vfs.root") + File.separator + path; - - URLConnection uc = u.openConnection(); - InputStream is = uc.getInputStream(); - FileOutputStream os = null; - try { - os = new FileOutputStream(path); - byte[] buf = new byte[1024]; - int len; - while ((len = is.read(buf)) > 0) - os.write(buf, 0, len); - file = new File(path); - } finally { - try { - is.close(); - os.close(); - } catch (Throwable e) { - file = null; - } - } - } - if (file == null) - throw new IOException(); - } - - public Font createFont(String name, int style, int size) - throws FontNotAvailableException, FontFormatException, IOException { - logger.info("Creating font: " + name + " " + style + " " + size); - - return new Font(name, style, size); - } - - private File file = null; - private static FontIndexData[] fonts = null; - - private static final Logger logger = Logger.getLogger(FontFactory.class.getName()); -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/LockFile.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/videolan/LockFile.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/LockFile.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/videolan/LockFile.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +class LockFile { + + /* no support for file channels */ + + public static LockFile create(String path) { + return null; + } + + public void release() { + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java 2015-01-26 08:01:57.000000000 +0000 @@ -26,4 +26,8 @@ public static void stopThreadGroup(ThreadGroup t) { } + + public static String dumpStack(Thread t) { + return ""; + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDGraphicsConfiguration.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,30 +19,11 @@ package java.awt; -import java.awt.color.ColorSpace; -import java.awt.image.BufferedImage; -import java.awt.image.ColorModel; -import java.awt.image.DataBuffer; -import java.awt.image.DirectColorModel; import java.awt.image.VolatileImage; -class BDGraphicsConfiguration extends GraphicsConfiguration { - private BDGraphicsDevice device; - +class BDGraphicsConfiguration extends BDGraphicsConfigurationBase { BDGraphicsConfiguration(BDGraphicsDevice device) { - this.device = device; - } - - public GraphicsDevice getDevice() { - return device; - } - - public Rectangle getBounds() { - return device.getBounds(); - } - - int getCompatibleImageType() { - return BufferedImage.TYPE_INT_ARGB; + super(device); } public java.awt.geom.AffineTransform getNormalizingTransform() { @@ -50,36 +31,14 @@ return null; } public java.awt.geom.AffineTransform getDefaultTransform() { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "getDefaultTransform"); - return null; + // return Identity transformation + return new java.awt.geom.AffineTransform(); } public java.awt.image.ColorModel getColorModel(int transparency) { org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "getColorModel"); return null; } - public synchronized ColorModel getColorModel() { - return new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), - 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, true, - DataBuffer.TYPE_INT); - } - - public BufferedImage createCompatibleImage(int width, int height, int trans) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleImage"); - return null; - } - - public BufferedImage createCompatibleImage(int width, int height) { - if (width <= 0 || height <= 0) - return null; - return BDImage.getBuffededImage(width, height, this); - } - - public VolatileImage createCompatibleVolatileImage(int width, int height) { - org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); - return null; - } - public VolatileImage createCompatibleVolatileImage(int width, int height, int trans) { org.videolan.Logger.unimplemented("BDGraphicsConfiguration", "createCompatibleVolatileImage"); return null; diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java 2015-01-26 08:01:57.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,98 +19,23 @@ package java.awt; -import java.lang.reflect.Field; -import java.text.AttributedCharacterIterator; -import java.util.Arrays; -import java.awt.image.AreaAveragingScaleFilter; -import java.awt.image.BufferedImage; -import java.awt.image.ImageConsumer; -import java.awt.image.ImageObserver; import java.awt.font.*; import java.awt.image.renderable.RenderableImage; import java.awt.image.RenderedImage; import java.awt.geom.AffineTransform; - -import org.dvb.ui.DVBBufferedImage; - -import sun.awt.ConstrainableGraphics; +import java.text.AttributedCharacterIterator; import org.videolan.Logger; -class BDGraphics extends Graphics2D implements ConstrainableGraphics { - private static final Color DEFAULT_COLOR = Color.BLACK; - private static final Font DEFAULT_FONT = new Font("Dialog", Font.PLAIN, 12); - - private int width; - private int height; - private int[] backBuffer; - private Area dirty; - private GraphicsConfiguration gc; - private Color foreground; - private Color background; +class BDGraphics extends BDGraphicsBase { private Paint paint; - private Font font; - private BDFontMetrics fontMetrics; - private AlphaComposite composite; - - /** The current xor color. If null then we are in paint mode. */ - private Color xorColor; - - /** Translated X, Y offset from native offset. */ - private int originX; - private int originY; - - /** The actual clip rectangle that is intersection of user clip and constrained rectangle. */ - private Rectangle actualClip; - - /** The current user clip rectangle or null if no clip has been set. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. */ - private Rectangle clip; - - /** The rectangle this graphics object has been constrained too. This is stored in the - native coordinate system and not the (possibly) translated Java coordinate system. - If it is null then this graphics has not been constrained. The constrained rectangle - is another layer of clipping independant of the user clip. */ - private Rectangle constrainedRect; BDGraphics(BDGraphics g) { - backBuffer = g.backBuffer; - dirty = g.dirty; - width = g.width; - height = g.height; - gc = g.gc; - foreground = g.foreground; - background = g.background; - composite = g.composite; - font = g.font; - fontMetrics = g.fontMetrics; - originX = g.originX; - originY = g.originY; - actualClip = g.actualClip; - clip = g.clip; - constrainedRect = g.constrainedRect; - if (clip == null) - setupClip(); + super(g); } BDGraphics(BDRootWindow window) { - width = window.getWidth(); - height = window.getHeight(); - backBuffer = window.getBdBackBuffer(); - dirty = window.getDirtyArea(); - gc = window.getGraphicsConfiguration(); - foreground = window.getForeground(); - background = window.getBackground(); - font = window.getFont(); - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = DEFAULT_COLOR; - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); + super(window); } public Color getBackground() { @@ -123,72 +48,15 @@ } BDGraphics(BDImage image) { - width = image.getWidth(); - height = image.getHeight(); - backBuffer = image.getBdBackBuffer(); - dirty = image.getDirtyArea(); - - gc = image.getGraphicsConfiguration(); - Component component = image.getComponent(); - if (component != null) { - foreground = component.getForeground(); - background = component.getBackground(); - font = component.getFont(); - } - if (foreground == null) - foreground = DEFAULT_COLOR; - if (background == null) - background = new Color(0, 0, 0, 0); - if (font == null) - font = DEFAULT_FONT; - fontMetrics = BDFontMetrics.getFontMetrics(font); - composite = AlphaComposite.SrcOver; - setupClip(); - } - - public Graphics create() { - return new BDGraphics(this); + super(image); } public java.awt.font.FontRenderContext getFontRenderContext() { return null; } - - public void translate(int x, int y) { - originX += x; - originY += y; - } - - public void setFont(Font font) { - if (font != null && !font.equals(this.font)) { - this.font = font; - fontMetrics = BDFontMetrics.getFontMetrics(font); - } - } - - public Font getFont() { - return font; - } - - public FontMetrics getFontMetrics() { - return fontMetrics; - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); - } - - public void setColor(Color c) { - if ((c != null) && (c != foreground)) - foreground = c; - } - - public Color getColor() { - return foreground; - } - public void setPaint(Paint p) { + logger.unimplemented("setPaint"); paint = p; } public Paint getPaint() { @@ -249,336 +117,15 @@ logger.unimplemented("getRenderingHints"); return null; } - public Composite getComposite() { - return composite; - } - - public GraphicsConfiguration getDeviceConfiguration() { - return gc; - } - - public void setComposite(Composite comp) { - if ((comp != null) && (comp != composite)) { - if (!(comp instanceof AlphaComposite)) - throw new IllegalArgumentException("Only AlphaComposite is supported"); - composite = (AlphaComposite) comp; - } - } - - public void setPaintMode() { - xorColor = null; - composite = AlphaComposite.SrcOver; - } - - public void setXORMode(Color color) { - xorColor = color; - } - - /** Gets the current clipping area. */ - public Rectangle getClipBounds() { - if (clip != null) - return new Rectangle (clip.x - originX, clip.y - originY, clip.width, clip.height); - return null; - } - public void constrain(int x, int y, int w, int h) { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + y, w, h)); - originX = constrainedRect.x; - originY = constrainedRect.y; - setupClip(); - } - - /** Returns a Shape object representing the clip. */ - public Shape getClip() { - return getClipBounds(); - } - - /** Crops the clipping rectangle. */ - public void clipRect(int x, int y, int w, int h) { - Rectangle rect = new Rectangle(x + originX, y + originY, w, h); - if (clip != null) - clip = clip.intersection(rect); - else - clip = rect; - setupClip(); - } - - /** Sets the clipping rectangle. */ - public void setClip(int x, int y, int w, int h) { - clip = new Rectangle (x + originX, y + originY, w, h); - setupClip(); - } public void clip(Shape s) { setClip(s); } - /** Sets the clip to a Shape (only Rectangle allowed). */ - public void setClip(Shape clip) { - if (clip == null) { - this.clip = null; - setupClip(); - } else if (clip instanceof Rectangle) { - Rectangle rect = (Rectangle) clip; - setClip(rect.x, rect.y, rect.width, rect.height); - } else - throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects"); - } - - private void setupClip() { - Rectangle rect; - if (constrainedRect != null) - rect = constrainedRect; - else - rect = new Rectangle(0, 0, width, height); - if (clip != null) - actualClip = clip.intersection(rect); - else - actualClip = rect; - } - - private int alphaBlend(int dest, int src) { - int As = src >>> 24; - if (As == 0) - return dest; - if (As == 255) - return src; - int Ad = (dest >>> 24); - if (Ad == 0) - return src; - int R, G, B; - R = ((src >>> 16) & 255) * As * 255; - G = ((src >>> 8) & 255) * As * 255; - B = (src & 255) * As * 255; - Ad = Ad * (255 - As); - As = As * 255 + Ad; - R = (R + ((dest >>> 16) & 255) * Ad) / As; - G = (G + ((dest >>> 8) & 255) * Ad) / As; - B = (B + (dest & 255) * Ad) / As; - R = Math.min(255, R); - G = Math.min(255, G); - B = Math.min(255, B); - Ad = As / 255; - Ad = Math.min(255, Ad); - return (Ad << 24) | (R << 16) | (G << 8) | B; - } - - private void drawPointN(int x, int y, int rgb) { - - dirty.add(x, y); - - if (xorColor != null) { - backBuffer[y * width + x] ^= xorColor.getRGB() ^ rgb; - return; - } - int rule; - if (composite != null) { - rule = composite.getRule(); - rgb = ((int)((rgb >>> 24) * composite.getAlpha()) << 24) | (rgb & 0x00FFFFFF); - } else { - rule = AlphaComposite.SRC_OVER; - } - switch (rule) { - case AlphaComposite.CLEAR: - backBuffer[y * width + x] = 0; - break; - case AlphaComposite.SRC: - backBuffer[y * width + x] = rgb; - break; - case AlphaComposite.SRC_OVER: - backBuffer[y * width + x] = alphaBlend(backBuffer[y * width + x], rgb); - break; - } - } - - private void drawPoint(int x, int y, int rgb) { - x += originX; - y += originY; - if (actualClip.contains(x, y)) - drawPointN(x, y, rgb); - } - - public void clearRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = background.getRGB(); - for (int i = 0; i < h; i++) - Arrays.fill(backBuffer, (y + i) * width + x, (y + i) * width + x + w, rgb); - - dirty.add(rect); - } - - public void fillRect(int x, int y, int w, int h) { - x += originX; - y += originY; - Rectangle rect = new Rectangle(x, y, w, h); - rect = actualClip.intersection(rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - int rgb = foreground.getRGB(); - for (int Y = y; Y < (y + h); Y++) - for (int X = x; X < (x + w); X++) - drawPointN(X, Y, rgb); - } - - public void drawRect(int x, int y, int w, int h) { - drawLineN(x, y, x + w, y); - drawLineN(x, y + h, x + w, y + h); - drawLineN(x, y, x, y + h); - drawLineN(x + w, y, x + w, y + h); - } - - public void drawLineN(int x1, int y1, int x2, int y2) { - int rgb = foreground.getRGB(); - int dy = y2 - y1; - int dx = x2 - x1; - int stepx, stepy; - int fraction; - if (dy < 0) { - dy = -dy; - stepy = -1; - } else { - stepy = 1; - } - if (dx < 0) { - dx = -dx; - stepx = -1; - } else { - stepx = 1; - } - dy <<= 1; - dx <<= 1; - - drawPointN(x1, y1, rgb); - - if (dx > dy) { - fraction = dy - (dx >> 1); - while (x1 != x2) { - if (fraction >= 0) { - y1 += stepy; - fraction -= dx; - } - x1 += stepx; - fraction += dy; - drawPointN(x1, y1, rgb); - } - } else { - fraction = dx - (dy >> 1); - while (y1 != y2) { - if (fraction >= 0) { - x1 += stepx; - fraction -= dy; - } - y1 += stepy; - fraction += dx; - drawPointN(x1, y1, rgb); - } - } - } - - public void drawLine(int x1, int y1, int x2, int y2) { - drawLineN(x1, y1, x2, y2); - } - - /** - * Copies an area of the canvas that this graphics context paints to. - * @param X the x-coordinate of the source. - * @param Y the y-coordinate of the source. - * @param W the width. - * @param H the height. - * @param dx the horizontal distance to copy the pixels. - * @param dy the vertical distance to copy the pixels. - */ - public void copyArea(int X, int Y, int W, int H, int dx, int dy) { - X += originX; - Y += originY; - logger.unimplemented("copyArea"); - } - - /** Draws lines defined by an array of x points and y points */ - public void drawPolyline(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - } - } - - /** Draws a polygon defined by an array of x points and y points */ - public void drawPolygon(int xPoints[], int yPoints[], int nPoints) { - if (nPoints == 1) { - drawPointN(xPoints[0], yPoints[0], foreground.getRGB()); - } else { - for (int i = 0; i < (nPoints - 1); i++) - drawLineN(xPoints[i], xPoints[i], xPoints[i + 1], xPoints[i + 1]); - if (nPoints > 2) - drawLineN(xPoints[0], xPoints[0], xPoints[nPoints - 1], xPoints[nPoints - 1]); - } - } - - /** Fills a polygon with the current fill mask */ - public void fillPolygon(int xPoints[], int yPoints[], int nPoints) { - logger.unimplemented("fillPolygon"); - } - - /** Draws an oval to fit in the given rectangle */ - public void drawOval(int x, int y, int w, int h) { - logger.unimplemented("drawOval"); - } - - /** Fills an oval to fit in the given rectangle */ - public void fillOval(int x, int y, int w, int h) { - logger.unimplemented("fillOval"); - } - - /** - * Draws an arc bounded by the given rectangle from startAngle to - * endAngle. 0 degrees is a vertical line straight up from the - * center of the rectangle. Positive start angle indicate clockwise - * rotations, negative angle are counter-clockwise. - */ - public void drawArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("drawArc"); - } - - /** fills an arc. arguments are the same as drawArc. */ - public void fillArc(int x, int y, int w, int h, int startAngle, int endAngle) { - logger.unimplemented("fillArc"); - } - - /** Draws a rounded rectangle. */ - public void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("drawRoundRect"); - } - - /** Draws a filled rounded rectangle. */ - public void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight) { - logger.unimplemented("fillRoundRect"); - } - - protected native void drawStringN(long ftFace, String string, int x, int y, int rgb); - - /** Draws the given string. */ - public void drawString(String string, int x, int y) { - drawStringN(fontMetrics.ftFace, string, x, y, foreground.getRGB()); - } public void drawString(String string, float x, float y) { - drawStringN(fontMetrics.ftFace, string, (int)x, (int)y, foreground.getRGB()); + drawString(string, (int)x, (int)y); } public void drawRenderableImage(RenderableImage img, AffineTransform xform) { @@ -589,11 +136,6 @@ logger.unimplemented("drawRenaeredImage"); } - /** Draws the given character array. */ - public void drawChars(char chars[], int offset, int length, int x, int y) { - drawStringN(fontMetrics.ftFace, new String(chars, offset, length), x, y, foreground.getRGB()); - } - public void drawString(AttributedCharacterIterator arg0, int arg1, int arg2) { logger.unimplemented("drawString"); } @@ -611,184 +153,5 @@ return true; } - /** - * Draws an image at x,y in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, int x, int y, ImageObserver observer) { - return drawImage(img, x, y, null, observer); - } - - /** - * Draws an image at x,y in nonblocking mode with a solid background - * color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, Color bg, - ImageObserver observer) { - return drawImageN(img, x, y, -1, -1, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - ImageObserver observer) { - return drawImage(img, x, y, w, h, null, observer); - } - - /** - * Draws an image scaled to x,y,w,h in nonblocking mode with a - * solid background color and a callback object. - */ - public boolean drawImage(Image img, int x, int y, int w, int h, - Color bg, ImageObserver observer) { - return drawImageN(img, x, y, w, h, 0, 0, -1, -1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle - * in nonblocking mode with a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - ImageObserver observer) { - return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - public boolean drawImage(Image img, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bg, ImageObserver observer) { - if ((dx1 >= dx2) || (dy1 >= dy2)) - return false; - return drawImageN(img, dx1, dy1, dx2 - dx1, dy2 - dy1, - sx1, sy1, sx2 - sx1, sy2 - sy1, bg, observer); - } - - /** - * Draws a subrectangle of an image scaled to a destination rectangle in - * nonblocking mode with a solid background color and a callback object. - */ - protected boolean drawImageN(Image img, - int dx, int dy, int dw, int dh, - int sx, int sy, int sw, int sh, - Color bg, ImageObserver observer) { - if ((sx < 0) || (sy < 0) || - (sw == 0) || (sh == 0) || (dw == 0) || (dh == 0)) - return false; - - BDImage bdImage; - if (img instanceof BDImage) { - bdImage = (BDImage)img; - } else if (img instanceof DVBBufferedImage) { - bdImage = (BDImage)getBufferedImagePeer( - (BufferedImage)(((DVBBufferedImage)img).getImage())); - } else if (img instanceof BufferedImage) { - bdImage = (BDImage)getBufferedImagePeer((BufferedImage)img); - } else { - logger.unimplemented("drawImageN: unsupported image type " + img.getClass().getName()); - return false; - } - if (bdImage instanceof BDImageConsumer) { - BDImageConsumer consumer = (BDImageConsumer)bdImage; - if (!consumer.isComplete(observer)) { - return false; - } - } - - if(sx + sw > bdImage.width) { - int n = sx + sw - bdImage.width; - dw -= dw * n / sw; - sw -= n; - } - - if(sy + sh > bdImage.height) { - int n = sy + sh - bdImage.height; - dh -= dh * n / sh; - sh -= n; - } - - if ((sw > 0) && (sh > 0) && - ((sx != 0) || (sy != 0) || (sw != bdImage.width) || (sh != bdImage.height))) { - BDImage subImage = new BDImage(null, sw, sh, null); - bdImage.getRGB(sx, sy, sw, sh, subImage.getBdBackBuffer(), 0, sw); - bdImage = subImage; - } - if ((dw > 0) && (dh > 0) && - ((dw != bdImage.width) || (dh != bdImage.height))) { - BDImageConsumer scaledImage = new BDImageConsumer(null); - AreaAveragingScaleFilter scaleFilter = - new AreaAveragingScaleFilter(dw, dh); - scaleFilter = (AreaAveragingScaleFilter)scaleFilter.getFilterInstance(scaledImage); - scaleFilter.setDimensions(bdImage.width, bdImage.height); - scaleFilter.setPixels(0, 0, bdImage.width, bdImage.height, - bdImage.getColorModel(), bdImage.getBdBackBuffer(), - 0, bdImage.width); - scaleFilter.imageComplete(ImageConsumer.STATICIMAGEDONE); - bdImage = scaledImage; - } - int[] rgbArray = bdImage.getBdBackBuffer(); - int bgColor; - if (bg != null) - bgColor = bg.getRGB(); - else - bgColor = 0; - for (int y = dy; y < (dy + bdImage.height); y++) - for (int x = dx; x < (dx + bdImage.width); x++) { - if (bg != null) - drawPoint(x, y, bgColor); - drawPoint(x, y, rgbArray[(y - dy) * bdImage.width + (x - dx)]); - } - return true; - } - - public Stroke getStroke() { - logger.unimplemented("getStroke"); - throw new Error(); - } - - public void setStroke(Stroke stroke) { - logger.unimplemented("setStroke"); - } - - public void dispose() { - } - - public String toString() { - return getClass().getName() + "[" + originX + "," + originY + "]"; - } - - private static Image getBufferedImagePeer(BufferedImage image) { - try { - return (Image)bufferedImagePeer.get(image); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return null; - } - - private static Field bufferedImagePeer; - - static { - try { - Class c = Class.forName("java.awt.image.BufferedImage"); - bufferedImagePeer = c.getDeclaredField("peer"); - bufferedImagePeer.setAccessible(true); - } catch (ClassNotFoundException e) { - throw new AWTError("java.awt.image.BufferedImage not found"); - } catch (SecurityException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not accessible"); - } catch (NoSuchFieldException e) { - throw new AWTError("java.awt.image.BufferedImage.peer not found"); - } - } - private static final Logger logger = Logger.getLogger(BDGraphics.class.getName()); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java 2015-01-26 08:01:57.000000000 +0000 @@ -20,51 +20,19 @@ package java.awt; -import java.awt.image.ColorModel; -import java.awt.image.ImageObserver; -import java.awt.image.ImageProducer; import java.awt.peer.KeyboardFocusManagerPeer; -import java.io.File; -import java.net.URL; -import java.util.Collections; -import java.util.Hashtable; -import java.util.WeakHashMap; -import java.util.Map; -import java.util.Iterator; - -import sun.awt.image.ByteArrayImageSource; -import sun.awt.image.FileImageSource; -import sun.awt.image.URLImageSource; + import sun.awt.KeyboardFocusManagerPeerProvider; import java.awt.peer.BDFramePeer; import java.awt.peer.BDKeyboardFocusManagerPeer; -import org.videolan.BDJXletContext; -import org.videolan.Logger; - -public class BDToolkit extends Toolkit implements KeyboardFocusManagerPeerProvider { - private EventQueue eventQueue = new EventQueue(); - private BDGraphicsEnvironment localEnv = new BDGraphicsEnvironment(); - private BDGraphicsConfiguration defaultGC = (BDGraphicsConfiguration)localEnv.getDefaultScreenDevice().getDefaultConfiguration(); - private static Hashtable cachedImages = new Hashtable(); - private static final Logger logger = Logger.getLogger(BDToolkit.class.getName()); - +public class BDToolkit extends BDToolkitBase implements KeyboardFocusManagerPeerProvider { public BDToolkit () { } - public static void shutdown() { - Toolkit toolkit = getDefaultToolkit(); - if (toolkit instanceof BDToolkit) { - ((BDToolkit)toolkit).dispose(); - } - } - - public void dispose() { - if (eventQueue != null) { - BDJHelper.stopEventQueue(eventQueue); - eventQueue = null; - } + protected void shutdown() { + super.shutdown(); KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); KeyboardFocusManager.getCurrentKeyboardFocusManager().setGlobalCurrentFocusCycleRoot(null); @@ -82,192 +50,22 @@ BDKeyboardFocusManagerPeer.init(window); } + // required by older Java 7 versions public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager kfm) { - return BDKeyboardFocusManagerPeer.getInstance(); - } - - public Dimension getScreenSize() { - Rectangle dims = defaultGC.getBounds(); - return new Dimension(dims.width, dims.height); - } - - Graphics getGraphics(Window window) { - if (!(window instanceof BDRootWindow)) { - System.err.println("getGraphics(): not BDRootWindow"); - throw new Error("Not implemented"); - } - return new BDWindowGraphics((BDRootWindow)window); - } - - GraphicsEnvironment getLocalGraphicsEnvironment() { - return localEnv; + return getKeyboardFocusManagerPeer(); } - public int getScreenResolution() { - return 72; - } - - public ColorModel getColorModel() { - return defaultGC.getColorModel(); - } - - public String[] getFontList() { - return BDFontMetrics.getFontList(); - } - - public FontMetrics getFontMetrics(Font font) { - return BDFontMetrics.getFontMetrics(font); + public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() + { + return BDKeyboardFocusManagerPeer.getInstance(); } public void sync() { org.videolan.GUIManager.getInstance().sync(); } - static void clearCache(BDImage image) { - synchronized (cachedImages) { - Iterator i = cachedImages.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry entry = (Map.Entry) i.next(); - if (entry.getValue() == image) { - i.remove(); - return; - } - } - } - } - - public Image getImage(String filename) { - if (cachedImages.containsKey(filename)) - return (Image)cachedImages.get(filename); - Image newImage = createImage(filename); - if (newImage != null) - cachedImages.put(filename, newImage); - return newImage; - } - - public Image getImage(URL url) { - if (cachedImages.containsKey(url)) - return (Image)cachedImages.get(url); - Image newImage = createImage(url); - if (newImage != null) - cachedImages.put(url, newImage); - return newImage; - } - - public Image createImage(String filename) { - if (!new File(filename).exists()) { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - ClassLoader cldr = (ClassLoader)ctx.getClassLoader(); - URL url = cldr.getResource(filename); - if (url != null) { - logger.warning("" + filename + " translated to " + url); - return createImage(url); - } else { - logger.error("ClassLoader failed to translate " + filename); - } - } else { - logger.error("createImage(" + filename + "): no XletContext available!\n" + logger.dumpStack()); - } - } - - ImageProducer ip = new FileImageSource(filename); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(URL url) { - ImageProducer ip = new URLImageSource(url); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(byte[] imagedata, - int imageoffset, - int imagelength) { - ImageProducer ip = new ByteArrayImageSource(imagedata, imageoffset, imagelength); - Image newImage = createImage(ip); - return newImage; - } - - public Image createImage(ImageProducer producer) { - return new BDImageConsumer(producer); - } - - public Image createImage(Component component, int width, int height) { - return new BDImage(component, width, height, defaultGC); - } - - public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) - return true; - BDImageConsumer img = (BDImageConsumer)image; - return img.prepareImage(observer); - } - - public int checkImage(Image image, int width, int height, - ImageObserver observer) { - if (!(image instanceof BDImageConsumer)) { - return ImageObserver.ALLBITS; - } - BDImageConsumer img = (BDImageConsumer)image; - return img.checkImage(observer); - } - - public void beep() { - } - - // mapping of Components to AppContexts, WeakHashMap - private static final Map contextMap = - Collections.synchronizedMap(new WeakHashMap()); - - public static void addComponent(Component component) { - - BDJXletContext context = BDJXletContext.getCurrentContext(); - if (context == null) { - logger.warning("addComponent() outside of app context"); - return; - } - contextMap.put(component, context); - } - - public static EventQueue getEventQueue(Component component) { - if (component != null) { - do { - BDJXletContext ctx = (BDJXletContext)contextMap.get(component); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq == null) { - logger.warning("getEventQueue() failed: no context event queue"); - } - return eq; - } - - component = component.getParent(); - } while (component != null); - - logger.warning("getEventQueue() failed: no context"); - } - - logger.warning("getEventQueue() failed: no component"); - return null; - } - - protected EventQueue getSystemEventQueueImpl() { - BDJXletContext ctx = BDJXletContext.getCurrentContext(); - if (ctx != null) { - EventQueue eq = ctx.getEventQueue(); - if (eq != null) { - return eq; - } - } - - logger.warning("getSystemEventQueue(): no context"); - return eventQueue; - } - - public Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight h) { + public java.util.Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight h) { throw new Error("Not implemented"); } public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType) { diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/image/BufferedImage.java 2015-01-26 08:01:57.000000000 +0000 @@ -96,7 +96,7 @@ return peer.getWidth(observer); } - public synchronized void setRGB(int x, int y, int rgb) { + public void setRGB(int x, int y, int rgb) { peer.setRGB(x, y, rgb); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java 2015-01-26 08:01:57.000000000 +0000 @@ -114,7 +114,10 @@ public Graphics getGraphics() { Component parent = component.getParent(); if (parent != null) { - return parent.getGraphics().create(location.x, location.y, size.width, size.height); + Graphics g = parent.getGraphics(); + if (g != null) { + return g.create(location.x, location.y, size.width, size.height); + } } logger.error("getGraphics(): no parent !"); throw new Error(); diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java 2015-02-28 16:45:26.000000000 +0000 @@ -23,6 +23,9 @@ import java.awt.event.*; import java.awt.image.BufferedImage; +import java.security.AccessController; +import java.security.PrivilegedAction; + import org.videolan.Logger; public class BDFramePeer extends BDComponentPeer implements FramePeer @@ -58,6 +61,10 @@ public void setTitle(String title) { } + /* Java 8 */ + public void emulateActivation(boolean doActivate) { + } + // // ContainerPeer // @@ -170,14 +177,23 @@ if (c == null) { return true; } - Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new FocusEvent(c, FocusEvent.FOCUS_GAINED)); + final FocusEvent focusEvent = new FocusEvent(c, FocusEvent.FOCUS_GAINED); + AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(focusEvent); + return null; + } + }); return true; } public void setVisible(boolean b) { //Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((Frame)component, WindowEvent.WINDOW_ACTIVATED)); if (b == true) { - component.paint(getGraphics()); + Graphics g = getGraphics(); + component.paint(g); + g.dispose(); } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * 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 + * . + */ + +package java.io; + +class BDFileSystemImpl extends BDFileSystem { + + public BDFileSystemImpl(FileSystem fs) { + super(fs); + } + + /* different in ME */ + public boolean checkAccess(File f, int access) { + return fs.checkAccess(f, access); + } + + /* Not in ME */ + public boolean setPermission(File f, int access, boolean enable, boolean owneronly) { + return fs.setPermission(f, access, enable, owneronly); + } + + /* Not in ME */ + public long getSpace(File f, int t) { + return fs.getSpace(f, t); + } +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/DVBGraphicsImpl.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/dvb/ui/DVBGraphicsImpl.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/DVBGraphicsImpl.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/dvb/ui/DVBGraphicsImpl.java 2015-01-26 08:01:57.000000000 +0000 @@ -19,6 +19,7 @@ package org.dvb.ui; +import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Composite; import java.awt.Font; @@ -225,10 +226,12 @@ gfx.fillRoundRect(x, y, width, height, arcWidth, arcHeight); } + /* public void finalize() { gfx.finalize(); } + */ public Shape getClip() { @@ -313,25 +316,43 @@ /* * DVBGraphics methods */ + public int[] getAvailableCompositeRules() { + /* int[] rules = { DVBAlphaComposite.CLEAR, DVBAlphaComposite.SRC, DVBAlphaComposite.SRC_OVER, DVBAlphaComposite.DST_OVER, DVBAlphaComposite.SRC_IN, DVBAlphaComposite.DST_IN, DVBAlphaComposite.SRC_OUT, DVBAlphaComposite.DST_OUT }; + */ + int[] rules = { + DVBAlphaComposite.CLEAR, + DVBAlphaComposite.SRC, + DVBAlphaComposite.SRC_OVER }; return rules; } public DVBAlphaComposite getDVBComposite() { - return alphaComposite; + Composite comp = gfx.getComposite(); + if (!(comp instanceof AlphaComposite)) + return null; + return DVBAlphaComposite.getInstance( + ((AlphaComposite)comp).getRule(), + ((AlphaComposite)comp).getAlpha()); } public void setDVBComposite(DVBAlphaComposite comp) throws UnsupportedDrawingOperationException { - this.alphaComposite = comp; + if ((comp.getRule() < DVBAlphaComposite.CLEAR) || + (comp.getRule() > DVBAlphaComposite.SRC_OVER)) { + org.videolan.Logger.getLogger("DVBGraphics").error("setDVBComposite() FAILED: unsupported rule " + comp.getRule()); + throw new UnsupportedDrawingOperationException("Unsupported composition rule: " + comp.getRule()); + } + + gfx.setComposite(AlphaComposite.getInstance(comp.getRule(), comp.getAlpha())); } /* @@ -507,6 +528,4 @@ { gfx.translate(tx, ty); } - - private DVBAlphaComposite alphaComposite = DVBAlphaComposite.Clear; } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * - * 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 - * . - */ - -package org.dvb.ui; - -import java.awt.Font; -import java.awt.FontFormatException; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import org.videolan.BDJException; -import org.videolan.BDJUtil; -import org.videolan.FontIndex; -import org.videolan.FontIndexData; -import org.videolan.Logger; - -public class FontFactory { - public static void loadDiscFonts() { - unloadDiscFonts(); - } - - public static void unloadDiscFonts() { - } - - public FontFactory() throws FontFormatException, IOException { - String path = BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/dvb.fontindex"); - - FontIndexData fontIndexData[] = FontIndex.parseIndex(path); - - fonts = new HashMap(fontIndexData.length); - for (int i = 0; i < fontIndexData.length; i++) { - FontIndexData data = fontIndexData[i]; - FileInputStream inStream = new FileInputStream(BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/" + data.getFileName())); - - Font font = Font.createFont(Font.TRUETYPE_FONT, inStream); - font = font.deriveFont(data.getStyle(), data.getMaxSize()); - - fonts.put(data.getName(), font); - } - } - - public FontFactory(URL u) throws IOException, FontFormatException { - FileInputStream inStream = new FileInputStream(u.getPath()); - - urlFont = Font.createFont(Font.TRUETYPE_FONT, inStream); - } - - public Font createFont(String name, int style, int size) - throws FontNotAvailableException, FontFormatException, IOException { - logger.info("Creating font: " + name + " " + style + " " + size); - - if (urlFont != null && name.equals(urlFont.getName())) - { - return urlFont.deriveFont(style, size); - } - - Font font = (Font)fonts.get(name); - - if (font == null) - throw new FontNotAvailableException(); - - return font.deriveFont(style, size); - } - - private Font urlFont = null; - private Map fonts = null; - - private static final Logger logger = Logger.getLogger(FontFactory.class.getName()); -} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +package org.videolan; + +import java.io.IOException; +import java.io.RandomAccessFile; + +class LockFile { + + private LockFile(RandomAccessFile lockFile) { + this.lockFile = lockFile; + } + + public static LockFile create(String path) { + + RandomAccessFile os = null; + try { + os = new RandomAccessFile(path, "rw"); + if (os.getChannel().tryLock() != null) { + /* Test if locking works: second tryLock() should fail */ + try { + if (os.getChannel().tryLock() != null) { + try { + os.close(); + } catch (Exception e) { + } + logger.error("File locking is unreliable !"); + return null; + } + } catch (Exception e) { + } + return new LockFile(os); + } else { + os.close(); + logger.info("Failed locking " + path); + } + } catch (Exception e) { + if (os != null) { + try { + os.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + logger.error("Failed creating lock file: " + e); + } + return null; + } + + public void release() { + try { + if (lockFile != null) { + lockFile.close(); + } + } catch (Exception e) { + } + } + + private RandomAccessFile lockFile; + + private static final Logger logger = Logger.getLogger(LockFile.class.getName()); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java 2015-01-26 08:01:57.000000000 +0000 @@ -28,4 +28,14 @@ public static void stopThreadGroup(ThreadGroup t) { t.stop(); } + + public static String dumpStack(Thread t) { + String dump = ""; + StackTraceElement e[] = t.getStackTrace(); + if (e != null) { + for (int i = 0; i < e.length; i++) + dump += "\n\t" + e[i].toString(); + } + return dump; + } } diff -Nru libbluray-0.5.0/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java libbluray-0.8.1/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java --- libbluray-0.5.0/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/java-j2se/sun/awt/KeyboardFocusManagerPeerProvider.java 2015-01-26 08:01:57.000000000 +0000 @@ -23,5 +23,8 @@ import java.awt.peer.KeyboardFocusManagerPeer; public abstract interface KeyboardFocusManagerPeerProvider { + // required by older Java 7 versions public abstract KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager kfm); + + public abstract KeyboardFocusManagerPeer getKeyboardFocusManagerPeer(); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/bdjo.c libbluray-0.8.1/src/libbluray/bdj/native/bdjo.c --- libbluray-0.5.0/src/libbluray/bdj/native/bdjo.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/bdjo.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,232 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bdjo.h" + +#include "util.h" + +#include "libbluray/bdj/bdjo_data.h" + +#include "util/logging.h" + +#include + +/* Documentation: HD Cookbook + * https://hdcookbook.dev.java.net/ + */ + +#define JNICHK(a) if((*env)->ExceptionOccurred(env)) { \ + BD_DEBUG(DBG_BDJ, "Exception occured\n"); \ + (*env)->ExceptionDescribe(env); \ + } if (!a) return NULL; + +/* + * + */ + +static jobject _make_terminal_info(JNIEnv* env, const BDJO_TERMINAL_INFO *p) +{ + jstring jdefault_font = (*env)->NewStringUTF(env, p->default_font); + return bdj_make_object(env, "org/videolan/bdjo/TerminalInfo", "(Ljava/lang/String;IZZ)V", + jdefault_font, (jint)p->initial_havi_config_id, + (jint)p->menu_call_mask, (jint)p->title_search_mask); +} + +static jobject _make_app_cache_info(JNIEnv* env, const BDJO_APP_CACHE_INFO *p) +{ + unsigned ii; + + jobjectArray app_cache_array = bdj_make_array(env, "org/videolan/bdjo/AppCache", p->num_item); + JNICHK(app_cache_array); + + for (ii = 0; ii < p->num_item; ii++) { + jstring jref_to_name = (*env)->NewStringUTF(env, p->item[ii].ref_to_name); + jstring jlang_code = (*env)->NewStringUTF(env, p->item[ii].lang_code); + JNICHK(jref_to_name); + JNICHK(jlang_code); + + jobject entry = bdj_make_object(env, "org/videolan/bdjo/AppCache", + "(ILjava/lang/String;Ljava/lang/String;)V", + (jint)p->item[ii].type, + jref_to_name, jlang_code); + JNICHK(entry); + + (*env)->SetObjectArrayElement(env, app_cache_array, ii, entry); + } + + return app_cache_array; +} + +static jobject _make_accessible_playlists(JNIEnv* env, const BDJO_ACCESSIBLE_PLAYLISTS *p) +{ + unsigned ii; + + jobjectArray playlists = bdj_make_array(env, "java/lang/String", p->num_pl); + JNICHK(playlists); + + for (ii = 0; ii < p->num_pl; ii++) { + jstring jplaylist_name = (*env)->NewStringUTF(env, p->pl[ii].name); + JNICHK(jplaylist_name); + + (*env)->SetObjectArrayElement(env, playlists, ii, jplaylist_name); + } + + return bdj_make_object(env, "org/videolan/bdjo/PlayListTable", "(ZZ[Ljava/lang/String;)V", + (jboolean)p->access_to_all_flag, (jboolean)p->autostart_first_playlist_flag, + playlists); +} + +static jobject _make_app(JNIEnv* env, const BDJO_APP *p) +{ + unsigned ii; + + jobjectArray profiles = bdj_make_array(env, "org/videolan/bdjo/AppProfile", p->num_profile); + JNICHK(profiles); + + for (ii = 0; ii < p->num_profile; ii++) { + jobject profile = bdj_make_object(env, "org/videolan/bdjo/AppProfile", "(SBBB)V", + (jshort)p->profile[ii].profile_number, + (jbyte)p->profile[ii].major_version, + (jbyte)p->profile[ii].minor_version, + (jbyte)p->profile[ii].micro_version); + JNICHK(profile); + + (*env)->SetObjectArrayElement(env, profiles, ii, profile); + JNICHK(1); + } + + jobjectArray app_names = bdj_make_array(env, "[Ljava/lang/String;", p->num_name); + JNICHK(app_names); + + for (ii = 0; ii < p->num_name; ii++) { + jstring jlang = (*env)->NewStringUTF(env, p->name[ii].lang); + JNICHK(jlang); + + jstring jname = (*env)->NewStringUTF(env, p->name[ii].name); + JNICHK(jname); + + jobjectArray app_name = bdj_make_array(env, "java/lang/String", 2); + JNICHK(app_name); + + (*env)->SetObjectArrayElement(env, app_name, 0, jlang); + JNICHK(1); + (*env)->SetObjectArrayElement(env, app_name, 1, jname); + JNICHK(1); + + (*env)->SetObjectArrayElement(env, app_names, ii, app_name); + JNICHK(1); + } + + + jstring icon_locator = (*env)->NewStringUTF(env, p->icon_locator); + JNICHK(icon_locator); + + jstring base_dir = (*env)->NewStringUTF(env, p->base_dir); + JNICHK(base_dir); + + jstring classpath_extension = (*env)->NewStringUTF(env, p->classpath_extension); + JNICHK(classpath_extension); + + jstring initial_class = (*env)->NewStringUTF(env, p->initial_class); + JNICHK(initial_class); + + jobjectArray params = bdj_make_array(env, "java/lang/String", p->num_param); + JNICHK(params); + + for (ii = 0; ii < p->num_param; ii++) { + jstring param = (*env)->NewStringUTF(env, p->param[ii].param); + JNICHK(param); + + (*env)->SetObjectArrayElement(env, params, ii, param); + JNICHK(1); + } + + jobject entry = bdj_make_object(env, "org/videolan/bdjo/AppEntry", + "(IIIS[Lorg/videolan/bdjo/AppProfile;SII[[Ljava/lang/String;Ljava/lang/String;" + "SLjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V", + (jint)p->control_code, (jint)p->type, + (jint)p->org_id, (jshort)p->app_id, + profiles, + (jshort)p->priority, (jint)p->binding, (jint)p->visibility, + app_names, icon_locator, + (jshort)p->icon_flags, + base_dir, classpath_extension, initial_class, params); + + return entry; +} + +static jobjectArray _make_app_management_table(JNIEnv* env, const BDJO_APP_MANAGEMENT_TABLE *p) +{ + unsigned ii; + + jclass entries = bdj_make_array(env, "org/videolan/bdjo/AppEntry", p->num_app); + JNICHK(entries); + + for (ii = 0; ii < p->num_app; ii++) { + jobject entry = _make_app(env, &p->app[ii]); + JNICHK(entry); + + (*env)->SetObjectArrayElement(env, entries, ii, entry); + } + + return entries; +} + +jobject bdjo_make_jobj(JNIEnv* env, const BDJO *p) +{ + jobject terminal_info = _make_terminal_info(env, &p->terminal_info); + JNICHK(terminal_info); + + jobjectArray app_cache_info = _make_app_cache_info(env, &p->app_cache_info); + JNICHK(app_cache_info); + + jobject accessible_playlists = _make_accessible_playlists(env, &p->accessible_playlists); + JNICHK(accessible_playlists); + + jobjectArray app_table = _make_app_management_table(env, &p->app_table); + JNICHK(app_table); + + jstring file_access_info = (*env)->NewStringUTF(env, p->file_access_info.path); + JNICHK(file_access_info); + + jint key_interest_table = + (p->key_interest_table.vk_play ) | + (p->key_interest_table.vk_stop << 1 ) | + (p->key_interest_table.vk_ffw << 2 ) | + (p->key_interest_table.vk_rew << 3 ) | + (p->key_interest_table.vk_track_next << 4 ) | + (p->key_interest_table.vk_track_prev << 5 ) | + (p->key_interest_table.vk_pause << 6 ) | + (p->key_interest_table.vk_still_off << 7 ) | + (p->key_interest_table.vk_sec_audio_ena_dis << 8 ) | + (p->key_interest_table.vk_sec_video_ena_dis << 9 ) | + (p->key_interest_table.pg_textst_ena_dis << 10); + + jobject result = bdj_make_object(env, "org/videolan/bdjo/Bdjo", + "(Lorg/videolan/bdjo/TerminalInfo;[Lorg/videolan/bdjo/AppCache;" + "Lorg/videolan/bdjo/PlayListTable;[Lorg/videolan/bdjo/AppEntry;ILjava/lang/String;)V", + terminal_info, app_cache_info, accessible_playlists, app_table, + key_interest_table, file_access_info); + + return result; +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/bdjo.h libbluray-0.8.1/src/libbluray/bdj/native/bdjo.h --- libbluray-0.5.0/src/libbluray/bdj/native/bdjo.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/bdjo.h 2015-02-18 09:08:30.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * + * 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 + * . + */ + +#ifndef BDJO_H_ +#define BDJO_H_ + +#include "util/attributes.h" + +#include + +struct bdjo_data; + +BD_PRIVATE jobject bdjo_make_jobj(JNIEnv* env, const struct bdjo_data *bdjo); + +#endif /* BDJO_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDFontMetrics.c libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDFontMetrics.c --- libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDFontMetrics.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDFontMetrics.c 2015-01-26 08:01:57.000000000 +0000 @@ -23,13 +23,30 @@ #include +#include "util.h" + #include "util/logging.h" +#include "util/macro.h" #ifdef HAVE_FT2 #include #include FT_FREETYPE_H #endif +#ifdef HAVE_FONTCONFIG +#include "util/strutl.h" +#include +#endif + +#if defined(_WIN32) && defined (HAVE_FT2) +#define NEED_WIN32_FONTS +#endif + +#ifdef NEED_WIN32_FONTS +#include "file/dirs.h" // win32_get_font_dir +#include +#endif + #include "java_awt_BDFontMetrics.h" /* Disable some warnings */ @@ -43,6 +60,237 @@ #define CPP_EXTERN #endif +/* + * Windows fonts + */ + +#ifdef NEED_WIN32_FONTS + +typedef struct { + int bold; + int italic; + char *filename; +} SEARCH_DATA; + +static int CALLBACK EnumFontCallbackW(const ENUMLOGFONTEXW *lpelfe, const NEWTEXTMETRICEX *metric, + DWORD type, LPARAM lParam) +{ + const LOGFONTW *lplf = &lpelfe->elfLogFont; + const wchar_t *font_name = lpelfe->elfFullName; + SEARCH_DATA *data = (SEARCH_DATA *)lParam; + int index = 0; + HKEY hKey; + wchar_t wvalue[MAX_PATH]; + wchar_t wdata[256]; + + if (type & RASTER_FONTTYPE) { + return 1; + } + + /* match attributes */ + if (data->italic >= 0 && (!!lplf->lfItalic != !!data->italic)) { + return 1; + } + if (data->bold >= 0 && + ((data->bold && lplf->lfWeight <= FW_MEDIUM) || + (!data->bold && lplf->lfWeight >= FW_SEMIBOLD))) { + return 1; + } + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", + 0, KEY_READ, &hKey) != ERROR_SUCCESS) { + return 0; + } + + while (!data->filename) { + DWORD wvalue_len = MAX_PATH - 1; + DWORD wdata_len = 255; + + LONG result = RegEnumValueW(hKey, index++, wvalue, &wvalue_len, + NULL, NULL, (LPBYTE)wdata, &wdata_len); + if (result != ERROR_SUCCESS) { + RegCloseKey(hKey); + return result; + } + + if (!_wcsicmp(wvalue, font_name)) { + size_t len = WideCharToMultiByte(CP_UTF8, 0, wdata, -1, NULL, 0, NULL, NULL); + if (len != 0) { + data->filename = (char *)malloc(len); + WideCharToMultiByte(CP_UTF8, 0, wdata, -1, data->filename, len, NULL, NULL); + break; + } + } + } + + RegCloseKey(hKey); + return 0; +} + +static char *_win32_resolve_font(const char *family, int style) +{ + LOGFONTW lf; + HDC hDC; + SEARCH_DATA data = {style & 2, style & 1, NULL}; + + memset(&lf, 0, sizeof(lf)); + lf.lfCharSet = DEFAULT_CHARSET; + MultiByteToWideChar(CP_UTF8, 0, family, -1, lf.lfFaceName, sizeof(lf.lfFaceName)); + + hDC = GetDC(NULL); + EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)&EnumFontCallbackW, (LPARAM)&data, 0); + ReleaseDC(NULL, hDC); + + if (!data.filename) { + return win32_get_font_dir("arial.ttf"); + } + + if (!strchr(data.filename, '\\')) { + char *tmp = win32_get_font_dir(data.filename); + X_FREE(data.filename); + return tmp; + } + return data.filename; +} + +#endif /* NEED_WIN32_FONTS */ + +/* + * fontconfig + */ + +#ifdef HAVE_FONTCONFIG +static FcConfig *_get_fc_lib(JNIEnv * env, jclass cls) +{ + jfieldID fid = (*env)->GetStaticFieldID(env, cls, "fcLib", "J"); + jlong fcLib = (*env)->GetStaticLongField (env, cls, fid); + FcConfig *lib = (FcConfig *)(intptr_t)fcLib; + + if (lib) { + return lib; + } + + lib = FcInitLoadConfigAndFonts(); + (*env)->SetStaticLongField (env, cls, fid, (jlong)(intptr_t)lib); + + if (!lib) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Loading fontconfig failed\n"); + } + + return lib; +} +#endif + +#ifdef HAVE_FONTCONFIG +static void _unload_fc_lib(JNIEnv * env, jclass cls) +{ + jfieldID fid = (*env)->GetStaticFieldID(env, cls, "fcLib", "J"); + jlong fcLib = (*env)->GetStaticLongField (env, cls, fid); + + if (fcLib) { + FcConfig *lib = (FcConfig *)(intptr_t)fcLib; + (*env)->SetStaticLongField (env, cls, fid, 0); + FcConfigDestroy(lib); + } +} +#endif + +#ifdef HAVE_FONTCONFIG +static void _fill_fc_pattern(FcPattern *pat, const char *font_family, jint fontStyle) +{ + int weight = (fontStyle & 1) ? FC_WEIGHT_EXTRABOLD : FC_WEIGHT_NORMAL; + int slant = (fontStyle & 2) ? FC_SLANT_ITALIC : FC_SLANT_ROMAN; + + if (strncmp(font_family, "mono", 4)) { /* mono, monospace, monospaced */ + FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)font_family); + } else { + FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)"monospace"); + } + FcPatternAddBool (pat, FC_OUTLINE, FcTrue); + FcPatternAddInteger(pat, FC_SLANT, slant); + FcPatternAddInteger(pat, FC_WEIGHT, weight); +} +#endif + +#ifdef HAVE_FONTCONFIG +static char *_fontconfig_resolve_font(FcConfig *lib, const char *font_family, jint font_style) +{ + FcResult result = FcResultMatch; + FcPattern *pat, *font; + FcChar8 *fc_filename = NULL; + char *filename = NULL; + + pat = FcPatternCreate(); + if (!pat) { + return NULL; + } + + _fill_fc_pattern(pat, font_family, font_style); + + FcDefaultSubstitute(pat); + if (!FcConfigSubstitute(lib, pat, FcMatchPattern)) { + FcPatternDestroy(pat); + return NULL; + } + + font = FcFontMatch(lib, pat, &result); + FcPatternDestroy(pat); + if (!font || result == FcResultNoMatch) { + return NULL; + } + + if (FcResultMatch == FcPatternGetString(font, FC_FILE, 0, &fc_filename)) { + filename = str_dup((const char*)fc_filename); + } + FcPatternDestroy(font); + + return filename; +} +#endif + +/* + * Font resolver + */ + +JNIEXPORT void JNICALL +Java_java_awt_BDFontMetrics_unloadFontConfigN(JNIEnv * env, jclass cls) +{ +#ifdef HAVE_FONTCONFIG + _unload_fc_lib(env, cls); +#endif +} + +JNIEXPORT jstring JNICALL +Java_java_awt_BDFontMetrics_resolveFontN(JNIEnv * env, jclass cls, jstring jfont_family, jint font_style) +{ + const char *font_family = (*env)->GetStringUTFChars(env, jfont_family, NULL); + char *filename = NULL; + jstring jfilename = NULL; + +#ifdef HAVE_FONTCONFIG + FcConfig *lib = _get_fc_lib(env, cls); + if (lib) { + filename = _fontconfig_resolve_font(lib, font_family, font_style); + } +#elif defined(NEED_WIN32_FONTS) + filename = _win32_resolve_font(font_family, font_style); +#else + BD_DEBUG(DBG_BDJ | DBG_CRIT, "BD-J font config support not compiled in\n"); +#endif + + if (filename) { + jfilename = (*env)->NewStringUTF(env, (const char*)filename); + X_FREE(filename); + } + + (*env)->ReleaseStringUTFChars(env, jfont_family, font_family); + return jfilename; +} + +/* + * Font metrics (freetype) + */ + JNIEXPORT jlong JNICALL Java_java_awt_BDFontMetrics_initN(JNIEnv * env, jclass cls) { @@ -69,9 +317,46 @@ } FT_Done_FreeType(lib); + + Java_java_awt_BDFontMetrics_unloadFontConfigN(env, cls); #endif } +JNIEXPORT jobjectArray JNICALL +Java_java_awt_BDFontMetrics_getFontFamilyAndStyleN(JNIEnv * env, jclass cls, jlong ftLib, jstring fontName) +{ + jobjectArray array = bdj_make_array(env, "java/lang/String", 2); + +#ifdef HAVE_FT2 + const char *name; + FT_Face ftFace; + FT_Error result; + FT_Library lib = (FT_Library)(intptr_t)ftLib; + jstring jfamily, jstyle; + + if (!lib) { + return NULL; + } + + name = (*env)->GetStringUTFChars(env, fontName, NULL); + result = FT_New_Face(lib, name, 0, &ftFace); + (*env)->ReleaseStringUTFChars(env, fontName, name); + if (result) { + return NULL; + } + + jfamily = (*env)->NewStringUTF(env, ftFace->family_name); + jstyle = (*env)->NewStringUTF(env, ftFace->style_name); + + FT_Done_Face(ftFace); + + (*env)->SetObjectArrayElement(env, array, 0, jfamily); + (*env)->SetObjectArrayElement(env, array, 1, jstyle); +#endif + + return array; +} + JNIEXPORT jlong JNICALL Java_java_awt_BDFontMetrics_loadFontN(JNIEnv * env, jobject obj, jlong ftLib, jstring fontName, jint size) { @@ -92,6 +377,7 @@ (*env)->ReleaseStringUTFChars(env, fontName, name); if (result) return 0; + FT_Set_Char_Size(ftFace, 0, size << 6, 0, 0); cls = (*env)->GetObjectClass(env, obj); @@ -231,6 +517,21 @@ VC(Java_java_awt_BDFontMetrics_destroyN), }, { + CC("resolveFontN"), + CC("(Ljava/lang/String;I)Ljava/lang/String;"), + VC(Java_java_awt_BDFontMetrics_resolveFontN), + }, + { + CC("unloadFontConfigN"), + CC("()V"), + VC(Java_java_awt_BDFontMetrics_unloadFontConfigN), + }, + { + CC("getFontFamilyAndStyleN"), + CC("(JLjava/lang/String;)[Ljava/lang/String;"), + VC(Java_java_awt_BDFontMetrics_getFontFamilyAndStyleN), + }, + { CC("loadFontN"), CC("(JLjava/lang/String;I)J"), VC(Java_java_awt_BDFontMetrics_loadFontN), diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDFontMetrics.h libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDFontMetrics.h --- libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDFontMetrics.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDFontMetrics.h 2015-01-26 08:01:57.000000000 +0000 @@ -32,6 +32,30 @@ /* * Class: java_awt_BDFontMetrics + * Method: getFontFamilyAndStyleN + * Signature: (JLjava/lang/String;)[Ljava/lang/String; + */ +JNIEXPORT jobjectArray JNICALL Java_java_awt_BDFontMetrics_getFontFamilyAndStyleN + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: java_awt_BDFontMetrics + * Method: resolveFontN + * Signature: (Ljava/lang/String;I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_java_awt_BDFontMetrics_resolveFontN + (JNIEnv *, jclass, jstring, jint); + +/* + * Class: java_awt_BDFontMetrics + * Method: unloadFontConfigN + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_java_awt_BDFontMetrics_unloadFontConfigN + (JNIEnv *, jclass); + +/* + * Class: java_awt_BDFontMetrics * Method: loadFontN * Signature: (JLjava/lang/String;I)J */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDGraphics.c libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDGraphics.c --- libbluray-0.5.0/src/libbluray/bdj/native/java_awt_BDGraphics.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/java_awt_BDGraphics.c 2015-02-18 09:08:30.000000000 +0000 @@ -17,14 +17,13 @@ * . */ -#include - #if HAVE_CONFIG_H #include "config.h" #endif #include "util/logging.h" +#include #include #ifdef HAVE_FT2 @@ -54,7 +53,8 @@ jclass cls; jmethodID mid; jint a, c; - jint i, j, k; + jint i; + unsigned j, k; FT_Face face = (FT_Face)(intptr_t)ftFace; length = (*env)->GetStringLength(env, string); diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.c libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Libbluray.c --- libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Libbluray.c 2015-05-15 09:25:06.000000000 +0000 @@ -1,7 +1,7 @@ /* * This file is part of libbluray - * Copyright (C) 2010 William Hahne - * Copyright (C) 2012 Petri Hintukainen + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,17 +18,25 @@ * . */ -#include "libbluray/bdj/bdj.h" -#include "libbluray/bdj/bdj_private.h" -#include "libbluray/bdj/bdj_util.h" -#include "libbluray/bdj/bdjo_parser.h" +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bdjo.h" +#include "util.h" + +#include "libbluray/bdj/bdjo_parse.h" + #include "libbluray/bluray.h" #include "libbluray/bluray_internal.h" +#include "libbluray/decoders/overlay.h" +#include "libbluray/disc/disc.h" -#include "util/strutl.h" -#include "util/macro.h" +#include "file/file.h" #include "util/logging.h" +#include "util/macro.h" +#include #include #include @@ -46,17 +54,42 @@ #define CPP_EXTERN #endif -static jobject _make_title_info(JNIEnv* env, int title, int objType, int playbackType, const char* bdjoName, int hdmvOID) +/* + * build org.videolan.TitleInfo + */ + +static jobject _make_title_info(JNIEnv* env, const BLURAY_TITLE *title, int title_number) { - jstring name = bdjoName ? (*env)->NewStringUTF(env, bdjoName) : NULL; - jobject ti = bdj_make_object(env, "org/videolan/TitleInfo", - "(IIILjava/lang/String;I)V", - title, objType, playbackType, name, hdmvOID); - if (name) - (*env)->DeleteLocalRef(env, name); + jobject ti = NULL; + if (title) { + int title_type = title->bdj ? 2 : 1; + int playback_type = (!!title->interactive) + ((!!title->bdj) << 1); + ti = bdj_make_object(env, "org/videolan/TitleInfo", + "(IIII)V", + title_number, title_type, playback_type, title->id_ref); + } return ti; } +static jobjectArray _make_title_infos(JNIEnv * env, const BLURAY_DISC_INFO *disc_info) +{ + jobjectArray titleArr = bdj_make_array(env, "org/videolan/TitleInfo", disc_info->num_titles + 2); + + for (unsigned i = 0; i <= disc_info->num_titles; i++) { + jobject titleInfo = _make_title_info(env, disc_info->titles[i], i); + (*env)->SetObjectArrayElement(env, titleArr, i, titleInfo); + } + + jobject titleInfo = _make_title_info(env, disc_info->first_play, 65535); + (*env)->SetObjectArrayElement(env, titleArr, disc_info->num_titles + 1, titleInfo); + + return titleArr; +} + +/* + * build org.videolan.PlaylistInfo + */ + static jobjectArray _make_stream_array(JNIEnv* env, int count, BLURAY_STREAM_INFO* streams) { jobjectArray streamArr = bdj_make_array(env, @@ -121,60 +154,30 @@ ti->playlist, ti->duration, ti->angle_count, marks, clips); } +/* + * + */ -JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getTitleInfoN - (JNIEnv * env, jclass cls, jlong np, jint title) -{ - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; +JNIEXPORT jobjectArray JNICALL Java_org_videolan_Libbluray_getTitleInfosN + (JNIEnv * env, jclass cls, jlong np) + { + BLURAY* bd = (BLURAY*)(intptr_t)np; + const BLURAY_DISC_INFO *disc_info = bd_get_disc_info(bd); - BD_DEBUG(DBG_JNI, "getTitleInfoN(%d)\n", (int)title); + BD_DEBUG(DBG_JNI, "getTitleInfosN()\n"); - if (title == 65535) { - if (bdj->index->first_play.object_type == indx_object_type_hdmv) - return _make_title_info(env, 65535, indx_object_type_hdmv, - bdj->index->first_play.hdmv.playback_type, - NULL, - bdj->index->first_play.hdmv.id_ref); - else - return _make_title_info(env, 65535, indx_object_type_bdj, - bdj->index->first_play.bdj.playback_type, - bdj->index->first_play.bdj.name, - -1); - } else if (title == 0) { - if (bdj->index->top_menu.object_type == indx_object_type_hdmv) - return _make_title_info(env, 0, indx_object_type_hdmv, - bdj->index->top_menu.hdmv.playback_type, - NULL, - bdj->index->top_menu.hdmv.id_ref); - else - return _make_title_info(env, 0, indx_object_type_bdj, - bdj->index->top_menu.bdj.playback_type, - bdj->index->top_menu.bdj.name, - -1); - } else if ((title > 0) && (title <= bdj->index->num_titles)) { - if (bdj->index->titles[title - 1].object_type == indx_object_type_hdmv) - return _make_title_info(env, title, indx_object_type_hdmv, - bdj->index->titles[title - 1].hdmv.playback_type, - NULL, - bdj->index->titles[title - 1].hdmv.id_ref); - else - return _make_title_info(env, title, indx_object_type_bdj, - bdj->index->titles[title - 1].bdj.playback_type, - bdj->index->titles[title - 1].bdj.name, - -1); - } - return NULL; + return _make_title_infos(env, disc_info); } JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN (JNIEnv * env, jclass cls, jlong np, jint playlist) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + BLURAY *bd = (BLURAY*)(intptr_t)np; BLURAY_TITLE_INFO* ti; BD_DEBUG(DBG_JNI, "getPlaylistInfoN(%d)\n", (int)playlist); - ti = bd_get_playlist_info(bdj->bd, playlist, 0); + ti = bd_get_playlist_info(bd, playlist, 0); if (!ti) return NULL; @@ -188,8 +191,10 @@ JNIEXPORT jbyteArray JNICALL Java_org_videolan_Libbluray_getAacsDataN (JNIEnv * env, jclass cls, jlong np, jint type) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - const uint8_t *data = bd_get_aacs_data(bdj->bd, type); + BLURAY* bd = (BLURAY*)(intptr_t)np; + const uint8_t *data = bd_get_aacs_data(bd, type); + + BD_DEBUG(DBG_JNI, "getAacsDataN(%d) -> %p\n", (int)type, (const void *)data); if (!data) { return NULL; @@ -201,151 +206,122 @@ JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getUOMaskN(JNIEnv * env, jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_get_uo_mask(bdj->bd); + BLURAY* bd = (BLURAY*)(intptr_t)np; + + BD_DEBUG(DBG_JNI, "getUOMaskN()\n"); + return bd_get_uo_mask(bd); } JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN(JNIEnv * env, jclass cls, jlong np, jboolean menuCallMask, jboolean titleSearchMask) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - bdj->uo_mask = ((!!menuCallMask) * BDJ_MENU_CALL_MASK) | ((!!titleSearchMask) * BDJ_TITLE_SEARCH_MASK); -} + BLURAY* bd = (BLURAY*)(intptr_t)np; -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getTitlesN(JNIEnv * env, - jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bdj->index->num_titles; + BD_DEBUG(DBG_JNI, "setUOMaskN(%d,%d)\n", (int)menuCallMask, (int)titleSearchMask); + bd_set_bdj_uo_mask(bd, ((!!menuCallMask) * BDJ_MENU_CALL_MASK) | ((!!titleSearchMask) * BDJ_TITLE_SEARCH_MASK)); } -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekN(JNIEnv * env, - jclass cls, jlong np, jlong pos) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; +JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setKeyInterestN(JNIEnv * env, + jclass cls, jlong np, jint mask) { + BLURAY* bd = (BLURAY*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "seekN(%"PRId64")\n", (int64_t)pos); - - return bd_seek(bdj->bd, pos); -} - -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekTimeN(JNIEnv * env, - jclass cls, jlong np, jlong tick) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - - BD_DEBUG(DBG_JNI, "seekTimeN(%"PRId64")\n", (int64_t)tick); - - return bd_seek_time(bdj->bd, tick); + BD_DEBUG(DBG_JNI, "setKeyInterestN(0x%x)\n", (int)mask); + bd_set_bdj_kit(bd, mask); } -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekChapterN(JNIEnv * env, - jclass cls, jlong np, jint chapter) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_setVirtualPackageN(JNIEnv * env, + jclass cls, jlong np, jstring vpPath, jboolean psr_init_backup) { + BLURAY* bd = (BLURAY*)(intptr_t)np; + const char *path = NULL; + jint result; - BD_DEBUG(DBG_JNI, "seekChapterN(%d)\n", (int)chapter); - - return bd_seek_chapter(bdj->bd, chapter); -} - -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_chapterPosN(JNIEnv * env, - jclass cls, jlong np, jint chapter) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_chapter_pos(bdj->bd, chapter); -} + if (vpPath) { + path = (*env)->GetStringUTFChars(env, vpPath, NULL); + } -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getCurrentChapterN( - JNIEnv * env, jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_get_current_chapter(bdj->bd); -} + BD_DEBUG(DBG_JNI|DBG_CRIT, "setVirtualPackageN(%s,%d)\n", path, (int)psr_init_backup); -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekMarkN(JNIEnv * env, - jclass cls, jlong np, jint mark) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + result = bd_set_virtual_package(bd, path, (int)psr_init_backup); - BD_DEBUG(DBG_JNI, "seekMarkN(%d)\n", (int)mark); + if (vpPath) { + (*env)->ReleaseStringUTFChars(env, vpPath, path); + } - return bd_seek_mark(bdj->bd, mark); + return result; } -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekPlayItemN(JNIEnv * env, - jclass cls, jlong np, jint clip) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; +JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekN(JNIEnv * env, + jclass cls, jlong np, jint playitem, jint playmark, jlong tick) { + BLURAY* bd = (BLURAY*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "seekPlayItemN(%d)\n", (int)clip); + BD_DEBUG(DBG_JNI, "seekN(tick=%"PRId64", mark=%d, playitem=%d)\n", (int64_t)tick, (int)playmark, (int)playitem); - return bd_seek_playitem(bdj->bd, clip); + return bd_bdj_seek(bd, playitem, playmark, tick); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectPlaylistN( - JNIEnv * env, jclass cls, jlong np, jint playlist) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + JNIEnv * env, jclass cls, jlong np, jint playlist, jint playitem, jint playmark, jlong time) { + BLURAY* bd = (BLURAY*)(intptr_t)np; + + if (!bd) { + return 0; + } - BD_DEBUG(DBG_JNI, "selectPlaylistN(%05d.mpls)\n", (int)playlist); + BD_DEBUG(DBG_JNI, "selectPlaylistN(pl=%d, pi=%d, pm=%d, time=%ld)\n", + (int)playlist, (int)playitem, (int)playmark, (long)time); - return bd_select_playlist(bdj->bd, playlist); + return bd_play_playlist_at(bd, playlist, playitem, playmark, time); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectTitleN(JNIEnv * env, jclass cls, jlong np, jint title) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + BLURAY* bd = (BLURAY*)(intptr_t)np; BD_DEBUG(DBG_JNI, "selectTitleN(%d)\n", (int)title); - return bd_play_title_internal(bdj->bd, title); + return bd_play_title_internal(bd, title); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectAngleN(JNIEnv * env, jclass cls, jlong np, jint angle) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_select_angle(bdj->bd, angle); -} - -JNIEXPORT void JNICALL Java_org_videolan_Libbluray_seamlessAngleChangeN( - JNIEnv * env, jclass cls, jlong np, jint angle) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - bd_seamless_angle_change(bdj->bd, angle); -} - -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getTitleSizeN(JNIEnv * env, - jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_get_title_size(bdj->bd); + BLURAY* bd = (BLURAY*)(intptr_t)np; + return bd_select_angle(bd, angle - 1); } -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getCurrentAngleN( - JNIEnv * env, jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_get_current_angle(bdj->bd); -} - -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellN(JNIEnv * env, - jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_tell(bdj->bd); +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_soundEffectN(JNIEnv * env, + jclass cls, jlong np, jint id) { + BLURAY* bd = (BLURAY*)(intptr_t)np; + return bd_bdj_sound_effect(bd, id); } JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellTimeN(JNIEnv * env, jclass cls, jlong np) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - return bd_tell_time(bdj->bd); + BLURAY* bd = (BLURAY*)(intptr_t)np; + return bd_tell_time(bd); } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN(JNIEnv * env, - jclass cls, jlong np, jfloat rate) { + jclass cls, jlong np, jfloat rate, jint reason) { + BLURAY* bd = (BLURAY*)(intptr_t)np; + + BD_DEBUG(DBG_JNI, "selectRateN(%1.1f, %d)\n", (float)rate, (int)reason); + + bd_select_rate(bd, (float)rate, reason); return 1; } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writeGPRN(JNIEnv * env, jclass cls, jlong np, jint num, jint value) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + BLURAY* bd = (BLURAY*)(intptr_t)np; BD_DEBUG(DBG_JNI, "writeGPRN(%d,%d)\n", (int)num, (int)value); - return bd_reg_write(bdj->bd, 0, num, 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) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - int value = bd_reg_read(bdj->bd, 0, 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); @@ -353,62 +329,164 @@ } JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN(JNIEnv * env, - jclass cls, jlong np, jint num, jint value) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + jclass cls, jlong np, jint num, jint value, jint mask) { + BLURAY* bd = (BLURAY*)(intptr_t)np; - BD_DEBUG(DBG_JNI, "writePSRN(%d,%d)\n", (int)num, (int)value); + if ((uint32_t)mask == 0xffffffff) { + BD_DEBUG(DBG_JNI, "writePSRN(%d,%d)\n", (int)num, (int)value); + } else { + BD_DEBUG(DBG_JNI, "writePSRN(%d,0x%x,0x%08x)\n", (int)num, (int)value, (int)mask); + } - return bd_reg_write(bdj->bd, 1, num, value); + 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) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - int value = bd_reg_read(bdj->bd, 1, 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; } -JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env, - jclass cls, jlong np, jstring name) { +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_cacheBdRomFileN(JNIEnv * env, + jclass cls, jlong np, + jstring jrel_path, jstring jcache_path) { + + BLURAY *bd = (BLURAY*)(intptr_t)np; + BD_DISC *disc = bd_get_disc(bd); + int result = -1; + + const char *rel_path = (*env)->GetStringUTFChars(env, jrel_path, NULL); + const char *cache_path = (*env)->GetStringUTFChars(env, jcache_path, NULL); + if (!rel_path || !cache_path) { + BD_DEBUG(DBG_JNI | DBG_CRIT, "cacheBdRomFile() failed: no path\n"); + goto out; + } + BD_DEBUG(DBG_JNI, "cacheBdRomFile(%s => %s)\n", rel_path, cache_path); - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; - const char *bdjo_name = (*env)->GetStringUTFChars(env, name, NULL);; - char* bdjo_path = str_printf("%s%s/%s.bdjo", bdj->path, BDJ_BDJO_PATH, bdjo_name); - (*env)->ReleaseStringUTFChars(env, name, bdjo_name); - jobject bdjo = bdjo_read(env, bdjo_path); - X_FREE(bdjo_path); + result = disc_cache_bdrom_file(disc, rel_path, cache_path); - return bdjo; + out: + if (rel_path) { + (*env)->ReleaseStringUTFChars(env, jrel_path, rel_path); + } + if (cache_path) { + (*env)->ReleaseStringUTFChars(env, jcache_path, cache_path); + } + + return result; } -JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env, - jclass cls, jlong np, jint width, jint height, jintArray rgbArray, - jint x0, jint y0, jint x1, jint y1) { +JNIEXPORT jobjectArray JNICALL Java_org_videolan_Libbluray_listBdFilesN(JNIEnv * env, + jclass cls, jlong np, jstring jpath, + jboolean onlyBdRom) { - BDJAVA* bdj = (BDJAVA*)(intptr_t)np; + BLURAY *bd = (BLURAY*)(intptr_t)np; + BD_DISC *disc = bd_get_disc(bd); - BD_DEBUG(DBG_JNI, "updateGraphicN(%d,%d-%d,%d)\n", x0, y0, x1, y1); + const char *path = (*env)->GetStringUTFChars(env, jpath, NULL); + if (!path) { + BD_DEBUG(DBG_JNI | DBG_CRIT, "listBdFilesN() failed: no path\n"); + return NULL; + } + BD_DEBUG(DBG_JNI, "listBdFilesN(%s)\n", path); - /* app callback not initialized ? */ - if (!bdj || !bdj->osd_cb) { - return; + /* open directory stream */ + BD_DIR_H *dp; + if (onlyBdRom) { + dp = disc_open_bdrom_dir(disc, path); + } else { + dp = disc_open_dir(disc, path); } + if (!dp) { + BD_DEBUG(DBG_JNI, "failed opening directory %s\n", path); + (*env)->ReleaseStringUTFChars(env, jpath, path); + return NULL; + } + (*env)->ReleaseStringUTFChars(env, jpath, path); - /* close ? */ - if (!rgbArray) { - bdj->osd_cb(bdj->bd, NULL, (int)width, (int)height, 0, 0, 0, 0); - return; + /* count files and create java strings (java array size must be known when it is created) */ + jstring *files = NULL; + unsigned count = 0; + unsigned allocated = 0; + BD_DIRENT ent; + while (!dir_read(dp, &ent)) { + if (strcmp(ent.d_name, ".") && strcmp(ent.d_name, "..")) { + if (allocated <= count) { + allocated += 512; + jstring *tmp = realloc(files, sizeof(*files) * allocated); + if (!tmp) { + BD_DEBUG(DBG_JNI | DBG_CRIT, "failed allocating memory for %u directory entries\n", allocated); + break; + } + files = tmp; + } + files[count] = (*env)->NewStringUTF(env, ent.d_name); + count++; + } } + dir_close(dp); - /* nothing to draw ? */ - if (x1 < x0 || y1 < y0 || (x1 | y1) < 0) { + /* allocate java array */ + jobjectArray arr = bdj_make_array(env, "java/lang/String", count); + if (!arr) { + BD_DEBUG(DBG_JNI | DBG_CRIT, "failed creating array [%d]\n", count); + } else { + /* populate files to array */ + unsigned ii; + for (ii = 0; ii < count; ii++) { + (*env)->SetObjectArrayElement(env, arr, ii, files[ii]); + } + } + + X_FREE(files); + + return arr; +} + + +JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env, + jclass cls, jlong np, jstring jfile) { + + BLURAY *bd = (BLURAY*)(intptr_t)np; + struct bdjo_data *bdjo; + jobject jbdjo = NULL; + + const char *file = (*env)->GetStringUTFChars(env, jfile, NULL); + if (!file) { + BD_DEBUG(DBG_JNI | DBG_CRIT, "getBdjoN() failed: no path\n"); + return NULL; + } + BD_DEBUG(DBG_JNI, "getBdjoN(%s)\n", file); + + bdjo = bdjo_get(bd_get_disc(bd), file); + if (bdjo) { + jbdjo = bdjo_make_jobj(env, bdjo); + bdjo_free(&bdjo); + } else { + BD_DEBUG(DBG_JNI | DBG_CRIT, "getBdjoN(%s) failed\n", file); + } + + (*env)->ReleaseStringUTFChars(env, jfile, file); + + return jbdjo; +} + +static void _updateGraphic(JNIEnv * env, + BLURAY *bd, jint width, jint height, jintArray rgbArray, + jint x0, jint y0, jint x1, jint y1, + BD_ARGB_BUFFER *buf) { + + /* close ? */ + if (!rgbArray) { + bd_bdj_osd_cb(bd, NULL, (int)width, (int)height, 0, 0, 0, 0); return; } - if (bdj->buf) { + if (buf) { /* copy to application-allocated buffer */ @@ -416,52 +494,52 @@ jsize offset; /* set dirty area before lock() */ - bdj->buf->dirty[BD_OVERLAY_IG].x0 = x0; - bdj->buf->dirty[BD_OVERLAY_IG].x1 = x1; - bdj->buf->dirty[BD_OVERLAY_IG].y0 = y0; - bdj->buf->dirty[BD_OVERLAY_IG].y1 = y1; + buf->dirty[BD_OVERLAY_IG].x0 = (uint16_t)x0; + buf->dirty[BD_OVERLAY_IG].x1 = (uint16_t)x1; + buf->dirty[BD_OVERLAY_IG].y0 = (uint16_t)y0; + buf->dirty[BD_OVERLAY_IG].y1 = (uint16_t)y1; /* get buffer */ - if (bdj->buf->lock) { - bdj->buf->lock(bdj->buf); + if (buf->lock) { + buf->lock(buf); } - if (!bdj->buf->buf[BD_OVERLAY_IG]) { + if (!buf->buf[BD_OVERLAY_IG]) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "ARGB frame buffer missing\n"); - if (bdj->buf->unlock) { - bdj->buf->unlock(bdj->buf); + if (buf->unlock) { + buf->unlock(buf); } return; } /* check buffer size */ - if (bdj->buf->width < width || bdj->buf->height < height) { + if (buf->width < width || buf->height < height) { /* assume buffer is only for the dirty arrea */ - BD_DEBUG(DBG_BDJ, "ARGB frame buffer size is smaller than BD-J frame buffer size (app: %dx%d BD-J: %dx%d)\n", - bdj->buf->width, bdj->buf->height, width, height); + BD_DEBUG(DBG_BDJ, "ARGB frame buffer size is smaller than BD-J frame buffer size (app: %dx%d BD-J: %ldx%ld)\n", + buf->width, buf->height, (long)width, (long)height); - if (bdj->buf->width < (x1 - x0 + 1) || bdj->buf->height < (y1 - y0 + 1)) { + if (buf->width < (x1 - x0 + 1) || buf->height < (y1 - y0 + 1)) { BD_DEBUG(DBG_BDJ | DBG_CRIT, "ARGB frame buffer size is smaller than dirty area\n"); - if (bdj->buf->unlock) { - bdj->buf->unlock(bdj->buf); + if (buf->unlock) { + buf->unlock(buf); } return; } - dst = (jint*)bdj->buf->buf[BD_OVERLAY_IG]; + dst = (jint*)buf->buf[BD_OVERLAY_IG]; } else { - dst = (jint*)bdj->buf->buf[BD_OVERLAY_IG] + y0 * bdj->buf->width + x0; + dst = (jint*)buf->buf[BD_OVERLAY_IG] + y0 * buf->width + x0; /* clip */ - if (y1 >= bdj->buf->height) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %d rows from bottom\n", y1 - bdj->buf->height); - y1 = bdj->buf->height - 1; + if (y1 >= buf->height) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %ld rows from bottom\n", (long)(y1 - buf->height)); + y1 = buf->height - 1; } - if (x1 >= bdj->buf->width) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %d pixels from right\n", x1 - bdj->buf->width); - x1 = bdj->buf->width - 1; + if (x1 >= buf->width) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Cropping %ld pixels from right\n", (long)(x1 - buf->width)); + x1 = buf->width - 1; } } @@ -472,22 +550,22 @@ for (y = y0; y <= y1; y++) { (*env)->GetIntArrayRegion(env, rgbArray, offset, x1 - x0 + 1, dst); offset += width; - dst += bdj->buf->width; + dst += buf->width; } /* check for errors */ if ((*env)->ExceptionOccurred(env)) { - BD_DEBUG(DBG_BDJ | DBG_CRIT, "Array access error at %d (+%d)\n", offset, x1 - x0 + 1); + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Array access error at %ld (+%ld)\n", (long)offset, (long)(x1 - x0 + 1)); (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); } - if (bdj->buf->unlock) { - bdj->buf->unlock(bdj->buf); + if (buf->unlock) { + buf->unlock(buf); } - bdj->osd_cb(bdj->bd, bdj->buf->buf[BD_OVERLAY_IG], (int)width, (int)height, - x0, y0, x1, y1); + bd_bdj_osd_cb(bd, buf->buf[BD_OVERLAY_IG], (int)width, (int)height, + x0, y0, x1, y1); } else { @@ -495,8 +573,8 @@ jint *image = (jint *)(*env)->GetPrimitiveArrayCritical(env, rgbArray, NULL); if (image) { - bdj->osd_cb(bdj->bd, (const unsigned *)image, (int)width, (int)height, - x0, y0, x1, y1); + bd_bdj_osd_cb(bd, (const unsigned *)image, (int)width, (int)height, + x0, y0, x1, y1); (*env)->ReleasePrimitiveArrayCritical(env, rgbArray, image, JNI_ABORT); } else { BD_DEBUG(DBG_BDJ | DBG_CRIT, "GetPrimitiveArrayCritical() failed\n"); @@ -504,6 +582,31 @@ } } +JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env, + jclass cls, jlong np, jint width, jint height, jintArray rgbArray, + jint x0, jint y0, jint x1, jint y1) { + + BLURAY* bd = (BLURAY*)(intptr_t)np; + + BD_DEBUG(DBG_JNI, "updateGraphicN(%ld,%ld-%ld,%ld)\n", (long)x0, (long)y0, (long)x1, (long)y1); + + /* app callback not initialized ? */ + if (!bd) { + return; + } + + /* nothing to draw ? */ + if (rgbArray && (x1 < x0 || y1 < y0 || (x1 | y1) < 0)) { + return; + } + + BD_ARGB_BUFFER *buf = bd_lock_osd_buffer(bd); + + _updateGraphic(env, bd, width, height, rgbArray, x0, y0, x1, y1, buf); + + bd_unlock_osd_buffer(bd); +} + #define CC (char*)(uintptr_t) /* cast a literal from (const char*) */ #define VC (void*)(uintptr_t) /* cast function pointer to void* */ @@ -526,9 +629,14 @@ VC(Java_org_videolan_Libbluray_setUOMaskN), }, { - CC("getTitleInfoN"), - CC("(JI)Lorg/videolan/TitleInfo;"), - VC(Java_org_videolan_Libbluray_getTitleInfoN), + CC("setKeyInterestN"), + CC("(JI)V"), + VC(Java_org_videolan_Libbluray_setKeyInterestN), + }, + { + CC("getTitleInfosN"), + CC("(J)[Lorg/videolan/TitleInfo;"), + VC(Java_org_videolan_Libbluray_getTitleInfosN), }, { CC("getPlaylistInfoN"), @@ -536,48 +644,13 @@ VC(Java_org_videolan_Libbluray_getPlaylistInfoN), }, { - CC("getTitlesN"), - CC("(J)I"), - VC(Java_org_videolan_Libbluray_getTitlesN), - }, - { CC("seekN"), - CC("(JJ)J"), + CC("(JIIJ)J"), VC(Java_org_videolan_Libbluray_seekN), }, { - CC("seekTimeN"), - CC("(JJ)J"), - VC(Java_org_videolan_Libbluray_seekTimeN), - }, - { - CC("seekChapterN"), - CC("(JI)J"), - VC(Java_org_videolan_Libbluray_seekChapterN), - }, - { - CC("chapterPosN"), - CC("(JI)J"), - VC(Java_org_videolan_Libbluray_chapterPosN), - }, - { - CC("getCurrentChapterN"), - CC("(J)I"), - VC(Java_org_videolan_Libbluray_getCurrentChapterN), - }, - { - CC("seekMarkN"), - CC("(JI)J"), - VC(Java_org_videolan_Libbluray_seekMarkN), - }, - { - CC("seekPlayItemN"), - CC("(JI)J"), - VC(Java_org_videolan_Libbluray_seekPlayItemN), - }, - { CC("selectPlaylistN"), - CC("(JI)I"), + CC("(JIIIJ)I"), VC(Java_org_videolan_Libbluray_selectPlaylistN), }, { @@ -586,29 +659,19 @@ VC(Java_org_videolan_Libbluray_selectTitleN), }, { + CC("setVirtualPackageN"), + CC("(JLjava/lang/String;Z)I"), + VC(Java_org_videolan_Libbluray_setVirtualPackageN), + }, + { CC("selectAngleN"), CC("(JI)I"), VC(Java_org_videolan_Libbluray_selectAngleN), }, { - CC("seamlessAngleChangeN"), - CC("(JI)V"), - VC(Java_org_videolan_Libbluray_seamlessAngleChangeN), - }, - { - CC("getTitleSizeN"), - CC("(J)J"), - VC(Java_org_videolan_Libbluray_getTitleSizeN), - }, - { - CC("getCurrentAngleN"), - CC("(J)I"), - VC(Java_org_videolan_Libbluray_getCurrentAngleN), - }, - { - CC("tellN"), - CC("(J)J"), - VC(Java_org_videolan_Libbluray_tellN), + CC("soundEffectN"), + CC("(JI)I"), + VC(Java_org_videolan_Libbluray_soundEffectN), }, { CC("tellTimeN"), @@ -617,7 +680,7 @@ }, { CC("selectRateN"), - CC("(JF)I"), + CC("(JFI)I"), VC(Java_org_videolan_Libbluray_selectRateN), }, { @@ -627,7 +690,7 @@ }, { CC("writePSRN"), - CC("(JII)I"), + CC("(JIII)I"), VC(Java_org_videolan_Libbluray_writePSRN), }, { @@ -641,6 +704,16 @@ VC(Java_org_videolan_Libbluray_readPSRN), }, { + CC("cacheBdRomFileN"), + CC("(JLjava/lang/String;Ljava/lang/String;)I"), + VC(Java_org_videolan_Libbluray_cacheBdRomFileN), + }, + { + CC("listBdFilesN"), + CC("(JLjava/lang/String;Z)[Ljava/lang/String;"), + VC(Java_org_videolan_Libbluray_listBdFilesN), + }, + { CC("getBdjoN"), CC("(JLjava/lang/String;)Lorg/videolan/bdjo/Bdjo;"), VC(Java_org_videolan_Libbluray_getBdjoN), diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.h libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Libbluray.h --- libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Libbluray.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Libbluray.h 2015-05-15 09:25:06.000000000 +0000 @@ -110,7 +110,7 @@ /* * Class: org_videolan_Libbluray - * Method: getUOMask + * Method: setUOMask * Signature: (JZZ)V */ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setUOMaskN @@ -118,91 +118,43 @@ /* * Class: org_videolan_Libbluray - * Method: getTitleInfoN - * Signature: (JI)Lorg/videolan/TitleInfo; - */ -JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getTitleInfoN - (JNIEnv *, jclass, jlong, jint); - -/* - * Class: org_videolan_Libbluray - * Method: getPlaylistInfoN - * Signature: (JI)Lorg/videolan/PlaylistInfo; - */ -JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN - (JNIEnv *, jclass, jlong, jint); - -/* - * Class: org_videolan_Libbluray - * Method: getTitlesN - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getTitlesN - (JNIEnv *, jclass, jlong); - -/* - * Class: org_videolan_Libbluray - * Method: seekN - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekN - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_videolan_Libbluray - * Method: seekTimeN - * Signature: (JJ)J - */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekTimeN - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_videolan_Libbluray - * Method: seekChapterN - * Signature: (JI)J - */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekChapterN - (JNIEnv *, jclass, jlong, jint); - -/* - * Class: org_videolan_Libbluray - * Method: chapterPosN - * Signature: (JI)J + * Method: setKeyInterestN + * Signature: (JI)V */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_chapterPosN - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT void JNICALL Java_org_videolan_Libbluray_setKeyInterestN +(JNIEnv *, jclass, jlong, jint); /* * Class: org_videolan_Libbluray - * Method: getCurrentChapterN - * Signature: (J)I + * Method: getTitleInfosN + * Signature: (J)[Lorg/videolan/TitleInfo; */ -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getCurrentChapterN +JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getTitleInfosN (JNIEnv *, jclass, jlong); /* * Class: org_videolan_Libbluray - * Method: seekMarkN - * Signature: (JI)J + * Method: getPlaylistInfoN + * Signature: (JI)Lorg/videolan/PlaylistInfo; */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekMarkN +JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getPlaylistInfoN (JNIEnv *, jclass, jlong, jint); /* * Class: org_videolan_Libbluray - * Method: seekPlayItemN - * Signature: (JI)J + * Method: seekN + * Signature: (JIIJ)J */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekPlayItemN - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_seekN + (JNIEnv *, jclass, jlong, jint, jint, jlong); /* * Class: org_videolan_Libbluray * Method: selectPlaylistN - * Signature: (JI)I + * Signature: (JIIIJ)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectPlaylistN - (JNIEnv *, jclass, jlong, jint); + (JNIEnv *, jclass, jlong, jint, jint, jint, jlong); /* * Class: org_videolan_Libbluray @@ -214,43 +166,27 @@ /* * Class: org_videolan_Libbluray - * Method: selectAngleN - * Signature: (JI)I + * Method: setVirtualPackageN + * Signature: (JLjava/lang/String;Z)I */ -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectAngleN - (JNIEnv *, jclass, jlong, jint); +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_setVirtualPackageN + (JNIEnv * env, jclass cls, jlong np, jstring vpPath, jboolean psr_init_backup); /* * Class: org_videolan_Libbluray - * Method: seamlessAngleChangeN - * Signature: (JI)V + * Method: selectAngleN + * Signature: (JI)I */ -JNIEXPORT void JNICALL Java_org_videolan_Libbluray_seamlessAngleChangeN +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectAngleN (JNIEnv *, jclass, jlong, jint); /* * Class: org_videolan_Libbluray - * Method: getTitleSizeN - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getTitleSizeN - (JNIEnv *, jclass, jlong); - -/* - * Class: org_videolan_Libbluray - * Method: getCurrentAngleN - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_getCurrentAngleN - (JNIEnv *, jclass, jlong); - -/* - * Class: org_videolan_Libbluray - * Method: tellN - * Signature: (J)J + * Method: soundEffectN + * Signature: (JI)I */ -JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_tellN - (JNIEnv *, jclass, jlong); +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_soundEffectN + (JNIEnv *, jclass, jlong, jint); /* * Class: org_videolan_Libbluray @@ -263,10 +199,10 @@ /* * Class: org_videolan_Libbluray * Method: selectRateN - * Signature: (JF)I + * Signature: (JFI)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectRateN - (JNIEnv *, jclass, jlong, jfloat); + (JNIEnv *, jclass, jlong, jfloat, jint); /* * Class: org_videolan_Libbluray @@ -279,10 +215,10 @@ /* * Class: org_videolan_Libbluray * Method: writePSRN - * Signature: (JII)I + * Signature: (JIII)I */ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_writePSRN - (JNIEnv *, jclass, jlong, jint, jint); + (JNIEnv *, jclass, jlong, jint, jint, jint); /* * Class: org_videolan_Libbluray @@ -302,6 +238,23 @@ /* * Class: org_videolan_Libbluray + * Method: cacheBdRomFileN + * Signature: (JLjava/lang/String;Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_cacheBdRomFileN +(JNIEnv *, jclass, jlong, jstring, jstring); + +/* + * Class: org_videolan_Libbluray + * Method: listBdFilesN + * Signature: (JLjava/lang/String;Z)[Ljava/lang/String; + */ +JNIEXPORT jobjectArray JNICALL Java_org_videolan_Libbluray_listBdFilesN(JNIEnv * env, + jclass cls, jlong np, jstring jpath, + jboolean onlyBdRom); + +/* + * Class: org_videolan_Libbluray * Method: getBdjoN * Signature: (JLjava/lang/String;)Lorg/videolan/bdjo/Bdjo; */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Logger.c libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Logger.c --- libbluray-0.5.0/src/libbluray/bdj/native/org_videolan_Logger.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/org_videolan_Logger.c 2015-01-26 08:01:57.000000000 +0000 @@ -17,14 +17,13 @@ * . */ -#include - #if HAVE_CONFIG_H #include "config.h" #endif #include "util/logging.h" +#include #include #include "org_videolan_Logger.h" diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/register_native.c libbluray-0.8.1/src/libbluray/bdj/native/register_native.c --- libbluray-0.5.0/src/libbluray/bdj/native/register_native.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/register_native.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,9 +17,80 @@ * . */ -#include "libbluray/bdj/native/register_native.h" +#if HAVE_CONFIG_H +#include "config.h" +#endif -#include "libbluray/bdj/bdj_util.h" +#include "register_native.h" + +#include "util/logging.h" + +#include + +static int _register_methods(JNIEnv *env, const char *class_name, + const JNINativeMethod *methods, int methods_count) +{ + jclass cls; + int error; + + (*env)->ExceptionClear(env); + + cls = (*env)->FindClass(env, class_name); + + if (!cls) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + error = (*env)->RegisterNatives(env, cls, methods, methods_count); + + if ((*env)->ExceptionOccurred(env)) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to register native methods for class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + if (error) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to register native methods for class %s\n", class_name); + } + + return !error; +} + +static int _unregister_methods(JNIEnv *env, const char *class_name) +{ + jclass cls; + int error; + + (*env)->ExceptionClear(env); + + cls = (*env)->FindClass(env, class_name); + + if (!cls) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + error = (*env)->UnregisterNatives(env, cls); + + if ((*env)->ExceptionOccurred(env)) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to unregister native methods for class %s\n", class_name); + (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + return 0; + } + + if (error) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to unegister native methods for class %s\n", class_name); + } + + return !error; +} int bdj_register_native_methods(JNIEnv *env) { @@ -32,22 +103,30 @@ extern const int Java_java_awt_BDGraphics_methods_count; extern const int Java_java_awt_BDFontMetrics_methods_count; - return - bdj_register_methods(env, "org/videolan/Logger", - Java_org_videolan_Logger_methods, - Java_org_videolan_Logger_methods_count) - * - bdj_register_methods(env, "org/videolan/Libbluray", - Java_org_videolan_Libbluray_methods, - Java_org_videolan_Libbluray_methods_count) - * + int result = _register_methods(env, "org/videolan/Logger", + Java_org_videolan_Logger_methods, + Java_org_videolan_Logger_methods_count); + + result *= _register_methods(env, "org/videolan/Libbluray", + Java_org_videolan_Libbluray_methods, + Java_org_videolan_Libbluray_methods_count); + /* BDFontMetrics must be registered before BDGraphics */ - bdj_register_methods(env, "java/awt/BDFontMetrics", - Java_java_awt_BDFontMetrics_methods, - Java_java_awt_BDFontMetrics_methods_count) - * - bdj_register_methods(env, "java/awt/BDGraphics", - Java_java_awt_BDGraphics_methods, - Java_java_awt_BDGraphics_methods_count) - ; + result *= _register_methods(env, "java/awt/BDFontMetrics", + Java_java_awt_BDFontMetrics_methods, + Java_java_awt_BDFontMetrics_methods_count); + + result *= _register_methods(env, "java/awt/BDGraphicsBase", + Java_java_awt_BDGraphics_methods, + Java_java_awt_BDGraphics_methods_count); + + return result; +} + +void bdj_unregister_native_methods(JNIEnv *env) +{ + _unregister_methods(env, "java/awt/BDGraphicsBase"); + _unregister_methods(env, "java/awt/BDFontMetrics"); + _unregister_methods(env, "org/videolan/Libbluray"); + _unregister_methods(env, "org/videolan/Logger"); } diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/register_native.h libbluray-0.8.1/src/libbluray/bdj/native/register_native.h --- libbluray-0.5.0/src/libbluray/bdj/native/register_native.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/register_native.h 2015-01-26 08:01:57.000000000 +0000 @@ -25,5 +25,6 @@ #include BD_PRIVATE int bdj_register_native_methods(JNIEnv *env); +BD_PRIVATE void bdj_unregister_native_methods(JNIEnv *env); #endif /* _REGISTER_NATIVE_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/util.c libbluray-0.8.1/src/libbluray/bdj/native/util.c --- libbluray-0.5.0/src/libbluray/bdj/native/util.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/util.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * Copyright (C) 2012 Petri Hintukainen + * + * 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.s + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "util.h" + +#include "util/logging.h" + +#include + +jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...) +{ + jclass obj_class = (*env)->FindClass(env, name); + jmethodID obj_constructor = (*env)->GetMethodID(env, obj_class, "", sig); + + if (!obj_class) { + BD_DEBUG(DBG_BDJ | DBG_CRIT, "Class %s not found\n", name); + return NULL; + } + + va_list ap; + va_start(ap, sig); + jobject obj = (*env)->NewObjectV(env, obj_class, obj_constructor, ap); + va_end(ap); + + return obj; +} + +jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count) +{ + jclass arr_class = (*env)->FindClass(env, name); + return (*env)->NewObjectArray(env, count, arr_class, NULL); +} diff -Nru libbluray-0.5.0/src/libbluray/bdj/native/util.h libbluray-0.8.1/src/libbluray/bdj/native/util.h --- libbluray-0.5.0/src/libbluray/bdj/native/util.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdj/native/util.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 William Hahne + * + * 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.s + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef JNIUTIL_H_ +#define JNIUTIL_H_ + +#include "util/attributes.h" + +#include + +// makes an object from the specified class name and constructor signature +BD_PRIVATE jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...); + +// makes an array for the specified class name, all elements are initialized to null +BD_PRIVATE jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count); + +#endif diff -Nru libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.c libbluray-0.8.1/src/libbluray/bdnav/bdid_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/bdid_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,14 +17,21 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bdid_parse.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "bdid_parse.h" +#include "util/strutl.h" #include -#include #define BDID_SIG1 ('B' << 24 | 'D' << 16 | 'I' << 8 | 'D') #define BDID_SIG2A ('0' << 24 | '2' << 16 | '0' << 8 | '0') @@ -52,26 +59,19 @@ return 1; } -static BDID_DATA *_bdid_parse(const char *file_name) +static BDID_DATA *_bdid_parse(BD_FILE_H *fp) { BITSTREAM bs; - BD_FILE_H *fp; BDID_DATA *bdid = NULL; uint32_t data_start, extension_data_start; uint8_t tmp[16]; - fp = file_open(file_name, "rb"); - if (!fp) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "bdid_parse(): error opening %s\n", file_name); - return NULL; - } - bs_init(&bs, fp); if (!_parse_header(&bs, &data_start, &extension_data_start)) { BD_DEBUG(DBG_NAV | DBG_CRIT, "id.bdmv: invalid header\n"); - goto error; + return NULL; } bdid = calloc(1, sizeof(BDID_DATA)); @@ -79,35 +79,38 @@ bs_seek_byte(&bs, 40); bs_read_bytes(&bs, tmp, 4); - print_hex(bdid->org_id, tmp, 4); + str_print_hex(bdid->org_id, tmp, 4); bs_read_bytes(&bs, tmp, 16); - print_hex(bdid->disc_id, tmp, 16); + str_print_hex(bdid->disc_id, tmp, 16); - file_close(fp); return bdid; +} - error: - X_FREE(bdid); +static BDID_DATA *_bdid_get(BD_DISC *disc, const char *path) +{ + BD_FILE_H *fp; + BDID_DATA *bdid; + + fp = disc_open_path(disc, path); + if (!fp) { + return NULL; + } + + bdid = _bdid_parse(fp); file_close(fp); - return NULL; + return bdid; } -BDID_DATA *bdid_parse(const char *file_name) +BDID_DATA *bdid_get(BD_DISC *disc) { - BDID_DATA *bdid = _bdid_parse(file_name); + BDID_DATA *bdid; + + bdid = _bdid_get(disc, "CERTIFICATE" DIR_SEP "id.bdmv"); /* if failed, try backup file */ if (!bdid) { - size_t len = strlen(file_name); - char *backup = malloc(len + 8); - - strcpy(backup, file_name); - strcpy(backup + len - 7, "BACKUP/id.bdmv"); - - bdid = _bdid_parse(backup); - - X_FREE(backup); + bdid = _bdid_get(disc, "CERTIFICATE" DIR_SEP "BACKUP" DIR_SEP "id.bdmv"); } return bdid; diff -Nru libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.h libbluray-0.8.1/src/libbluray/bdnav/bdid_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/bdid_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/bdid_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_BDID_PARSE_H_) #define _BDID_PARSE_H_ -#include +#include "util/attributes.h" #include @@ -30,7 +30,9 @@ } BDID_DATA; -BD_PRIVATE BDID_DATA* bdid_parse(const char *path); /* parse id.bdmv */ +struct bd_disc; + +BD_PRIVATE BDID_DATA* bdid_get(struct bd_disc *disc); /* parse id.bdmv */ BD_PRIVATE void bdid_free(BDID_DATA **p); #endif // _BDID_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/clpi_data.h libbluray-0.8.1/src/libbluray/bdnav/clpi_data.h --- libbluray-0.5.0/src/libbluray/bdnav/clpi_data.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/clpi_data.h 2015-01-26 08:01:57.000000000 +0000 @@ -48,18 +48,18 @@ typedef struct { uint8_t validity; - uint8_t format_id[5]; + char format_id[5]; } CLPI_TS_TYPE; typedef struct { uint32_t delta; - uint8_t file_id[6]; - uint8_t file_code[5]; + char file_id[6]; + char file_code[5]; } CLPI_ATC_DELTA; typedef struct { - uint8_t file_id[6]; + char file_id[6]; } CLPI_FONT; typedef struct { @@ -92,7 +92,7 @@ uint8_t aspect; uint8_t oc_flag; uint8_t char_code; - uint8_t lang[4]; + char lang[4]; } CLPI_PROG_STREAM; typedef struct diff -Nru libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.c libbluray-0.8.1/src/libbluray/bdnav/clpi_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/clpi_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -18,11 +18,20 @@ * . */ -#include "util/macro.h" +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "clpi_parse.h" + +#include "extdata_parse.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" -#include "extdata_parse.h" -#include "clpi_parse.h" +#include "util/macro.h" +#include "util/logging.h" #include #include @@ -48,10 +57,11 @@ static int _parse_stream_attr(BITSTREAM *bits, CLPI_PROG_STREAM *ss) { - int len, pos; + int64_t pos; + int len; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_stream_attr: Stream alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_stream_attr(): Stream alignment error\n"); } len = bs_read(bits, 8); @@ -86,22 +96,22 @@ case 0xa2: ss->format = bs_read(bits, 4); ss->rate = bs_read(bits, 4); - bs_read_bytes(bits, ss->lang, 3); + bs_read_string(bits, ss->lang, 3); break; case 0x90: case 0x91: case 0xa0: - bs_read_bytes(bits, ss->lang, 3); + bs_read_string(bits, ss->lang, 3); break; case 0x92: ss->char_code = bs_read(bits, 8); - bs_read_bytes(bits, ss->lang, 3); + bs_read_string(bits, ss->lang, 3); break; default: - fprintf(stderr, "stream attr: unrecognized coding type %02x\n", ss->coding_type); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_stream_attr(): unrecognized coding type %02x\n", ss->coding_type); break; }; ss->lang[3] = '\0'; @@ -126,7 +136,7 @@ _human_readable_sig(sig, cl->type_indicator, cl->type_indicator2); _human_readable_sig(expect, CLPI_SIG1, CLPI_SIG2A); - fprintf(stderr, "failed signature match expected (%s) got (%s)\n", + BD_DEBUG(DBG_NAV | DBG_CRIT, "failed signature match expected (%s) got (%s)\n", expect, sig); return 0; } @@ -141,7 +151,8 @@ static int _parse_clipinfo(BITSTREAM *bits, CLPI_CL *cl) { - int len, pos; + int64_t pos; + int len; int ii; bs_seek_byte(bits, 40); @@ -165,8 +176,7 @@ pos = bs_pos(bits) >> 3; if (len) { cl->clip.ts_type_info.validity = bs_read(bits, 8); - bs_read_bytes(bits, cl->clip.ts_type_info.format_id, 4); - cl->clip.ts_type_info.format_id[4] = '\0'; + bs_read_string(bits, cl->clip.ts_type_info.format_id, 4); // Seek past the stuff we don't know anything about bs_seek_byte(bits, pos + len); } @@ -178,10 +188,8 @@ malloc(cl->clip.atc_delta_count * sizeof(CLPI_ATC_DELTA)); for (ii = 0; ii < cl->clip.atc_delta_count; ii++) { cl->clip.atc_delta[ii].delta = bs_read(bits, 32); - bs_read_bytes(bits, cl->clip.atc_delta[ii].file_id, 5); - cl->clip.atc_delta[ii].file_id[5] = '\0'; - bs_read_bytes(bits, cl->clip.atc_delta[ii].file_code, 4); - cl->clip.atc_delta[ii].file_code[4] = '\0'; + bs_read_string(bits, cl->clip.atc_delta[ii].file_id, 5); + bs_read_string(bits, cl->clip.atc_delta[ii].file_code, 4); bs_skip(bits, 8); } } @@ -193,8 +201,7 @@ if (cl->font_info.font_count) { cl->font_info.font = malloc(cl->font_info.font_count * sizeof(CLPI_FONT)); for (ii = 0; ii < cl->font_info.font_count; ii++) { - bs_read_bytes(bits, cl->font_info.font[ii].file_id, 5); - cl->font_info.font[ii].file_id[5] = '\0'; + bs_read_string(bits, cl->font_info.font[ii].file_id, 5); bs_skip(bits, 8); } } @@ -321,7 +328,7 @@ bs_skip(bits, 12); cpi->type = bs_read(bits, 4); - ep_map_pos = bs_pos(bits) >> 3; + ep_map_pos = (uint32_t)(bs_pos(bits) >> 3); // EP Map starts here bs_skip(bits, 8); @@ -583,6 +590,14 @@ { CLPI_CL *cl = (CLPI_CL*)handle; + if (id1 == 1) { + if (id2 == 2) { + // LPCM down mix coefficient + //_parse_lpcm_down_mix_coeff(bits, &cl->lpcm_down_mix_coeff); + return 0; + } + } + if (id1 == 2) { if (id2 == 4) { // Extent start point @@ -598,6 +613,7 @@ } } + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_clpi_extension(): unhandled extension %d.%d\n", id1, id2); return 0; } @@ -664,27 +680,19 @@ } static CLPI_CL* -_clpi_parse(const char *path) +_clpi_parse(BD_FILE_H *fp) { BITSTREAM bits; - BD_FILE_H *fp; CLPI_CL *cl; cl = calloc(1, sizeof(CLPI_CL)); if (cl == NULL) { - return NULL; - } - - fp = file_open(path, "rb"); - if (fp == NULL) { - fprintf(stderr, "Failed to open %s\n", path); - X_FREE(cl); + BD_DEBUG(DBG_CRIT, "out of memory\n"); return NULL; } bs_init(&bits, fp); if (!_parse_header(&bits, cl)) { - file_close(fp); clpi_free(cl); return NULL; } @@ -697,48 +705,70 @@ } if (!_parse_clipinfo(&bits, cl)) { - file_close(fp); clpi_free(cl); return NULL; } if (!_parse_sequence(&bits, cl)) { - file_close(fp); clpi_free(cl); return NULL; } if (!_parse_program_info(&bits, cl)) { - file_close(fp); clpi_free(cl); return NULL; } if (!_parse_cpi_info(&bits, cl)) { - file_close(fp); clpi_free(cl); return NULL; } - file_close(fp); + return cl; } CLPI_CL* clpi_parse(const char *path) { - CLPI_CL *cl = _clpi_parse(path); + BD_FILE_H *fp; + CLPI_CL *cl; - /* if failed, try backup file */ - if (!cl) { - size_t len = strlen(path); - char *backup = malloc(len + 8); + fp = file_open(path, "rb"); + if (!fp) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "Failed to open %s\n", path); + return NULL; + } + + cl = _clpi_parse(fp); + file_close(fp); + return cl; +} + +static CLPI_CL* +_clpi_get(BD_DISC *disc, const char *dir, const char *file) +{ + BD_FILE_H *fp; + CLPI_CL *cl; - strncpy(backup, path, len - 18); - strcpy(backup + len - 18, "BACKUP/"); - strcpy(backup + len - 18 + 7, path + len - 18); + fp = disc_open_file(disc, dir, file); + if (!fp) { + return NULL; + } - cl = _clpi_parse(backup); + cl = _clpi_parse(fp); + file_close(fp); + return cl; +} - X_FREE(backup); +CLPI_CL* +clpi_get(BD_DISC *disc, const char *file) +{ + CLPI_CL *cl; + + cl = _clpi_get(disc, "BDMV" DIR_SEP "CLIPINF", file); + if (cl) { + return cl; } + /* if failed, try backup file */ + cl = _clpi_get(disc, "BDMV" DIR_SEP "BACKUP" DIR_SEP "CLIPINF", file); return cl; } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.h libbluray-0.8.1/src/libbluray/bdnav/clpi_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/clpi_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/clpi_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -25,9 +25,12 @@ #include +struct bd_disc; + 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_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); diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/bdid_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/bdid_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/bdid_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/bdid_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/clpi_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/clpi_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/clpi_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/clpi_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/extdata_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/extdata_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/extdata_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/extdata_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/index_dump-index_parse.Po libbluray-0.8.1/src/libbluray/bdnav/.deps/index_dump-index_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/index_dump-index_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/index_dump-index_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/index_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/index_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/index_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/index_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/meta_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/meta_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/meta_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/meta_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-clpi_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-extdata_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_dump-mpls_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/mpls_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/mpls_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/navigation.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/navigation.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/navigation.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/navigation.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/.deps/sound_parse.Plo libbluray-0.8.1/src/libbluray/bdnav/.deps/sound_parse.Plo --- libbluray-0.5.0/src/libbluray/bdnav/.deps/sound_parse.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/.deps/sound_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/bdnav/extdata_parse.c libbluray-0.8.1/src/libbluray/bdnav/extdata_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/extdata_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/extdata_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,9 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif #include "util/bits.h" #include "extdata_parse.h" @@ -28,7 +31,7 @@ int (*handler)(BITSTREAM*, int, int, void*), void *handle) { - off_t length; + int64_t length; int num_entries, n; if (start_address < 1) return 0; @@ -47,10 +50,10 @@ for (n = 0; n < num_entries; n++) { uint16_t id1 = bs_read(bits, 16); uint16_t id2 = bs_read(bits, 16); - off_t ext_start = bs_read(bits, 32); - off_t ext_len = bs_read(bits, 32); + int64_t ext_start = bs_read(bits, 32); + int64_t ext_len = bs_read(bits, 32); - off_t saved_pos = bs_pos(bits) >> 3; + int64_t saved_pos = bs_pos(bits) >> 3; if (ext_start + start_address + ext_len > bits->end) return 0; diff -Nru libbluray-0.5.0/src/libbluray/bdnav/index_parse.c libbluray-0.8.1/src/libbluray/bdnav/index_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/index_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/index_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,11 +17,19 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "index_parse.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "index_parse.h" +#include "util/strutl.h" #include #include @@ -34,6 +42,12 @@ hdmv->id_ref = bs_read(bs, 16); bs_skip(bs, 32); + if (hdmv->playback_type != indx_hdmv_playback_type_movie && + hdmv->playback_type != indx_hdmv_playback_type_interactive) { + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid HDMV playback type %d\n", hdmv->playback_type); + } + return 1; } @@ -41,10 +55,15 @@ { bdj->playback_type = bs_read(bs, 2); bs_skip(bs, 14); - bs_read_bytes(bs, (uint8_t*)bdj->name, 5); - bdj->name[5] = 0; + bs_read_string(bs, bdj->name, 5); bs_skip(bs, 8); + if (bdj->playback_type != indx_bdj_playback_type_movie && + bdj->playback_type != indx_bdj_playback_type_interactive) { + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid BD-J playback type %d\n", bdj->playback_type); + } + return 1; } @@ -53,11 +72,16 @@ obj->object_type = bs_read(bs, 2); bs_skip(bs, 30); - if (obj->object_type == 1) { - return _parse_hdmv_obj(bs, &obj->hdmv); - } else { - return _parse_bdj_obj(bs, &obj->bdj); + switch (obj->object_type) { + case indx_object_type_hdmv: + return _parse_hdmv_obj(bs, &obj->hdmv); + + case indx_object_type_bdj: + return _parse_bdj_obj(bs, &obj->bdj); } + + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown object type %d\n", obj->object_type); + return 0; } static int _parse_index(BITSTREAM *bs, INDX_ROOT *index) @@ -68,7 +92,7 @@ /* TODO: check if goes to extension data area */ - if ((bs_end(bs) - bs_pos(bs))/8 < (off_t)index_len) { + if ((bs_end(bs) - bs_pos(bs))/8 < (int64_t)index_len) { BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid index_len %d !\n", index_len); return 0; } @@ -88,10 +112,20 @@ index->titles[i].access_type = bs_read(bs, 2); bs_skip(bs, 28); - if (index->titles[i].object_type == 1) { - _parse_hdmv_obj(bs, &index->titles[i].hdmv); - } else { - _parse_bdj_obj(bs, &index->titles[i].bdj); + switch (index->titles[i].object_type) { + case indx_object_type_hdmv: + if (!_parse_hdmv_obj(bs, &index->titles[i].hdmv)) + return 0; + break; + + case indx_object_type_bdj: + if (!_parse_bdj_obj(bs, &index->titles[i].bdj)) + return 0; + break; + + default: + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown object type %d (#%d)\n", index->titles[i].object_type, i); + return 0; } } @@ -139,8 +173,8 @@ if (sig1 != INDX_SIG1 || (sig2 != INDX_SIG2A && sig2 != INDX_SIG2B)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv failed signature match: expected INDX0100 got %8.8s\n", bs->buf); - return 0; + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv failed signature match: expected INDX0100 got %8.8s\n", bs->buf); + return 0; } *index_start = bs_read(bs, 32); @@ -149,68 +183,66 @@ return 1; } -static INDX_ROOT *_indx_parse(const char *file_name) +static INDX_ROOT *_indx_parse(BD_FILE_H *fp) { BITSTREAM bs; - BD_FILE_H *fp; INDX_ROOT *index = calloc(1, sizeof(INDX_ROOT)); - int indexes_start, extension_data_start; - fp = file_open(file_name, "rb"); - if (!fp) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "indx_parse(): error opening %s\n", file_name); - X_FREE(index); + if (!index) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); return NULL; } bs_init(&bs, fp); - if (!_parse_header(&bs, &indexes_start, &extension_data_start)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: invalid header\n"); - goto error; - } + if (!_parse_header(&bs, &indexes_start, &extension_data_start) || + !_parse_app_info(&bs, &index->app_info)) { - if (!_parse_app_info(&bs, &index->app_info)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: error parsing app info\n"); - goto error; + indx_free(&index); + return NULL; } bs_seek_byte(&bs, indexes_start); - if (!_parse_index(&bs, index)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: error parsing indexes\n"); - goto error; + indx_free(&index); + return NULL; } - file_close(fp); + if (extension_data_start) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "index.bdmv: unknown extension data at %d\n", extension_data_start); + } return index; - - error: - X_FREE(index); - file_close(fp); - return NULL; } -INDX_ROOT *indx_parse(const char *file_name) +static INDX_ROOT *_indx_get(BD_DISC *disc, const char *path) { - INDX_ROOT *indx = _indx_parse(file_name); + BD_FILE_H *fp; + INDX_ROOT *index; - /* if failed, try backup file */ - if (!indx) { - size_t len = strlen(file_name); - char *backup = malloc(len + 8); + fp = disc_open_path(disc, path); + if (!fp) { + return NULL; + } + + index = _indx_parse(fp); + file_close(fp); + return index; +} - strcpy(backup, file_name); - strcpy(backup + len - 10, "BACKUP/index.bdmv"); +INDX_ROOT *indx_get(BD_DISC *disc) +{ + INDX_ROOT *index; - indx = _indx_parse(backup); + index = _indx_get(disc, "BDMV" DIR_SEP "index.bdmv"); - X_FREE(backup); + if (!index) { + /* try backup */ + index = _indx_get(disc, "BDMV" DIR_SEP "BACKUP" DIR_SEP "index.bdmv"); } - return indx; + return index; } void indx_free(INDX_ROOT **p) diff -Nru libbluray-0.5.0/src/libbluray/bdnav/index_parse.h libbluray-0.8.1/src/libbluray/bdnav/index_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/index_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/index_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_INDX_PARSE_H_) #define _INDX_PARSE_H_ -#include +#include "util/attributes.h" #include @@ -61,6 +61,15 @@ indx_bdj_playback_type_interactive = 3, } indx_bdj_playback_type; +typedef enum { + indx_access_permitted = 0, /* jump into this title is permitted. title number may be shown on UI. */ + indx_access_prohibited = 1, /* jump into this title is prohibited. title number may be shown on UI. */ + indx_access_hidden = 3, /* jump into this title is prohibited. title number shall not be shown on UI. */ +} indx_access_type; + +#define INDX_ACCESS_PROHIBITED_MASK 0x01 /* if set, jump to this title is not allowed */ +#define INDX_ACCESS_HIDDEN_MASK 0x02 /* if set, title number shall not be displayed on UI */ + typedef struct { unsigned int initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */ unsigned int content_exist_flag : 1; @@ -106,7 +115,9 @@ } INDX_ROOT; -BD_PRIVATE INDX_ROOT* indx_parse(const char *path); /* parse index.bdmv */ +struct bd_disc; + +BD_PRIVATE INDX_ROOT* indx_get(struct bd_disc *disc); /* parse index.bdmv */ BD_PRIVATE void indx_free(INDX_ROOT **index); #endif // _INDX_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/meta_parse.c libbluray-0.8.1/src/libbluray/bdnav/meta_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/meta_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/meta_parse.c 2015-02-18 09:08:30.000000000 +0000 @@ -21,13 +21,17 @@ #include "config.h" #endif +#include "meta_parse.h" + +#include "meta_data.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" #include "util/strutl.h" -#include "meta_parse.h" -#include "libbluray/register.h" #include #include @@ -43,7 +47,11 @@ #include #endif +#define DEFAULT_LANGUAGE "eng" + + #define BAD_CAST_CONST (const xmlChar *) +#define XML_FREE(p) (xmlFree(p), p = NULL) #define MAX_META_FILE_SIZE 0xfffff @@ -64,11 +72,11 @@ } if (xmlStrEqual(cur_node->name, BAD_CAST_CONST "numSets")) { disclib->di_num_sets = atoi((char*)(tmp = xmlNodeGetContent(cur_node))); - xmlFree(tmp); + XML_FREE(tmp); } if (xmlStrEqual(cur_node->name, BAD_CAST_CONST "setNumber")) { disclib->di_set_number = atoi((char*)(tmp = xmlNodeGetContent(cur_node))); - xmlFree(tmp); + XML_FREE(tmp); } } else if (xmlStrEqual(cur_node->parent->name, BAD_CAST_CONST "tableOfContents")) { @@ -78,7 +86,7 @@ disclib->toc_entries = realloc(disclib->toc_entries, (disclib->toc_count*sizeof(META_TITLE))); disclib->toc_entries[i].title_number = atoi((const char*)tmp); disclib->toc_entries[i].title_name = (char*)xmlNodeGetContent(cur_node); - X_FREE(tmp); + XML_FREE(tmp); } } else if (xmlStrEqual(cur_node->parent->name, BAD_CAST_CONST "description")) { @@ -92,7 +100,7 @@ sscanf((const char*)tmp, "%ix%i", &x, &y); disclib->thumbnails[i].xres = x; disclib->thumbnails[i].yres = y; - X_FREE(tmp); + XML_FREE(tmp); } else { disclib->thumbnails[i].xres = disclib->thumbnails[i].yres = -1; @@ -104,26 +112,25 @@ } } -static void _findMetaXMLfiles(META_ROOT *meta, const char *device_path) +static void _findMetaXMLfiles(META_ROOT *meta, BD_DISC *disc) { BD_DIR_H *dir; BD_DIRENT ent; - char *path = NULL; - path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "META" DIR_SEP "DL", device_path); - dir = dir_open(path); + dir = disc_open_dir(disc, "BDMV" DIR_SEP "META" DIR_SEP "DL"); if (dir == NULL) { - BD_DEBUG(DBG_DIR, "Failed to open meta dir %s\n", path); - X_FREE(path); + BD_DEBUG(DBG_DIR, "Failed to open meta dir BDMV/META/DL/\n"); return; } int res; for (res = dir_read(dir, &ent); !res; res = dir_read(dir, &ent)) { if (ent.d_name[0] == '.') continue; - else if (ent.d_name != NULL && strncasecmp(ent.d_name, "bdmt_", 5) == 0) { + else if (strncasecmp(ent.d_name, "bdmt_", 5) == 0) { uint8_t i = meta->dl_count; meta->dl_count++; meta->dl_entries = realloc(meta->dl_entries, (meta->dl_count*sizeof(META_DL))); + memset(&meta->dl_entries[i], 0, sizeof(meta->dl_entries[i])); + meta->dl_entries[i].filename = str_dup(ent.d_name); strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3); meta->dl_entries[i].language_code[3] = '\0'; @@ -131,46 +138,31 @@ } } dir_close(dir); - X_FREE(path); } #endif -META_ROOT *meta_parse(const char *device_path) +META_ROOT *meta_parse(BD_DISC *disc) { #ifdef HAVE_LIBXML2 META_ROOT *root = calloc(1, sizeof(META_ROOT)); root->dl_count = 0; xmlDocPtr doc; - _findMetaXMLfiles(root, device_path); + _findMetaXMLfiles(root, disc); uint8_t i; for (i = 0; i < root->dl_count; i++) { - char *base = NULL; - base = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "META" DIR_SEP "DL" , device_path); - char *path = NULL; - path = str_printf("%s" DIR_SEP "%s", base, root->dl_entries[i].filename); - - BD_FILE_H *handle = file_open(path, "rb"); - if (handle == NULL) { - BD_DEBUG(DBG_DIR, "Failed to open meta file (%s)\n", path); - X_FREE(path); - X_FREE(base); - continue; - } - - int64_t length = file_size(handle); - - if (length > 0 && length < MAX_META_FILE_SIZE) { - size_t size = (size_t)length; - uint8_t *data = malloc(size); - size_t size_read = file_read(handle, data, size); - if (size != size_read) { - BD_DEBUG(DBG_DIR, "Failed to read %s\n", path); - } else { - doc = xmlReadMemory((char*)data, (int)size, base, NULL, 0); + uint8_t *data = NULL; + size_t size; + size = disc_read_file(disc, "BDMV" DIR_SEP "META" DIR_SEP "DL", + root->dl_entries[i].filename, + &data); + if (!data || size == 0) { + BD_DEBUG(DBG_DIR, "Failed to read BDMV/META/DL/%s\n", root->dl_entries[i].filename); + } else { + doc = xmlReadMemory((char*)data, (int)size, NULL, NULL, 0); if (doc == NULL) { - BD_DEBUG(DBG_DIR, "Failed to parse %s\n", path); + BD_DEBUG(DBG_DIR, "Failed to parse BDMV/META/DL/%s\n", root->dl_entries[i].filename); } else { xmlNode *root_element = NULL; root_element = xmlDocGetRootElement(doc); @@ -180,18 +172,15 @@ root->dl_entries[i].toc_entries = NULL; root->dl_entries[i].thumbnails = NULL; _parseManifestNode(root_element, &root->dl_entries[i]); - xmlFreeDoc(doc); + XML_FREE(doc); } - } X_FREE(data); } - file_close(handle); - X_FREE(path); - X_FREE(base); } xmlCleanupParser(); return root; #else + (void)disc; BD_DEBUG(DBG_DIR, "configured without libxml2 - can't parse meta info\n"); return NULL; #endif @@ -199,6 +188,7 @@ const META_DL *meta_get(const META_ROOT *meta_root, const char *language_code) { +#ifdef HAVE_LIBXML2 unsigned i; if (meta_root == NULL || meta_root->dl_count == 0) { @@ -224,28 +214,36 @@ BD_DEBUG(DBG_DIR, "requested disclib language '%s' or default '"DEFAULT_LANGUAGE"' not found, using '%s' instead\n", language_code, meta_root->dl_entries[0].language_code); return &meta_root->dl_entries[0]; +#else + (void)meta_root; + (void)language_code; + return NULL; +#endif } void meta_free(META_ROOT **p) { + (void)p; +#ifdef HAVE_LIBXML2 if (p && *p) { uint8_t i; for (i = 0; i < (*p)->dl_count; i++) { uint32_t t; for (t = 0; t < (*p)->dl_entries[i].toc_count; t++) { - X_FREE((*p)->dl_entries[i].toc_entries[t].title_name); + XML_FREE((*p)->dl_entries[i].toc_entries[t].title_name); } for (t = 0; t < (*p)->dl_entries[i].thumb_count; t++) { - X_FREE((*p)->dl_entries[i].thumbnails[t].path); + XML_FREE((*p)->dl_entries[i].thumbnails[t].path); } X_FREE((*p)->dl_entries[i].toc_entries); X_FREE((*p)->dl_entries[i].thumbnails); X_FREE((*p)->dl_entries[i].filename); - X_FREE((*p)->dl_entries[i].di_name); - X_FREE((*p)->dl_entries[i].di_alternative); + XML_FREE((*p)->dl_entries[i].di_name); + XML_FREE((*p)->dl_entries[i].di_alternative); } X_FREE((*p)->dl_entries); X_FREE(*p); } +#endif } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/meta_parse.h libbluray-0.8.1/src/libbluray/bdnav/meta_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/meta_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/meta_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -17,14 +17,17 @@ * . */ -#include "meta_data.h" - #if !defined(_META_PARSE_H_) #define _META_PARSE_H_ -BD_PRIVATE META_ROOT* meta_parse(const char *device_path); -BD_PRIVATE void meta_free(META_ROOT **index); -BD_PRIVATE const META_DL* meta_get(const META_ROOT *meta_root, const char *language_code); +#include "util/attributes.h" + +struct bd_disc; +struct meta_root; + +BD_PRIVATE struct meta_root * meta_parse(struct bd_disc *disc) BD_ATTR_MALLOC; +BD_PRIVATE void meta_free (struct meta_root **index); +BD_PRIVATE const struct meta_dl * meta_get (const struct meta_root *meta_root, const char *language_code); #endif // _META_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.c libbluray-0.8.1/src/libbluray/bdnav/mpls_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/mpls_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -18,11 +18,20 @@ * . */ -#include "util/macro.h" +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mpls_parse.h" + +#include "extdata_parse.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" -#include "extdata_parse.h" -#include "mpls_parse.h" +#include "util/logging.h" +#include "util/macro.h" #include #include @@ -51,6 +60,8 @@ BITBUFFER bb; bb_init(&bb, buf, 8); + memset(uo, 0, sizeof(BD_UO_MASK)); + uo->menu_call = bb_read(&bb, 1); uo->title_search = bb_read(&bb, 1); uo->chapter_search = bb_read(&bb, 1); @@ -61,7 +72,7 @@ uo->stop = bb_read(&bb, 1); uo->pause_on = bb_read(&bb, 1); uo->pause_off = bb_read(&bb, 1); - uo->still = bb_read(&bb, 1); + uo->still_off = bb_read(&bb, 1); uo->forward = bb_read(&bb, 1); uo->backward = bb_read(&bb, 1); uo->resume = bb_read(&bb, 1); @@ -100,15 +111,19 @@ static int _parse_appinfo(BITSTREAM *bits, MPLS_AI *ai) { - int len; - off_t pos; + int64_t pos, len; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_appinfo: alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_appinfo: alignment error\n"); } pos = bs_pos(bits) >> 3; len = bs_read(bits, 32); + if (bs_avail(bits) < len * 8) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_appinfo: unexpected end of file\n"); + return 0; + } + // Reserved bs_skip(bits, 8); ai->playback_type = bs_read(bits, 8); @@ -131,6 +146,11 @@ static int _parse_header(BITSTREAM *bits, MPLS_PL *pl) { + if (bs_avail(bits) < 5 * 32 + 160) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_header: unexpected end of file\n"); + return 0; + } + pl->type_indicator = bs_read(bits, 32); pl->type_indicator2 = bs_read(bits, 32); if (pl->type_indicator != MPLS_SIG1 || @@ -142,7 +162,7 @@ _human_readable_sig(sig, pl->type_indicator, pl->type_indicator2); _human_readable_sig(expect, MPLS_SIG1, MPLS_SIG2A); - fprintf(stderr, "failed signature match, expected (%s) got (%s)\n", + BD_DEBUG(DBG_NAV | DBG_CRIT, "failed signature match, expected (%s) got (%s)\n", expect, sig); return 0; } @@ -161,10 +181,10 @@ _parse_stream(BITSTREAM *bits, MPLS_STREAM *s) { int len; - off_t pos; + int64_t pos; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_stream: Stream alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_stream: Stream alignment error\n"); } len = bs_read(bits, 8); pos = bs_pos(bits) >> 3; @@ -188,7 +208,7 @@ break; default: - fprintf(stderr, "unrecognized stream type %02x\n", s->stream_type); + BD_DEBUG(DBG_NAV | DBG_CRIT, "unrecognized stream type %02x\n", s->stream_type); break; }; @@ -221,21 +241,21 @@ case 0xa2: s->format = bs_read(bits, 4); s->rate = bs_read(bits, 4); - bs_read_bytes(bits, s->lang, 3); + bs_read_string(bits, s->lang, 3); break; case 0x90: case 0x91: - bs_read_bytes(bits, s->lang, 3); + bs_read_string(bits, s->lang, 3); break; case 0x92: s->char_code = bs_read(bits, 8); - bs_read_bytes(bits, s->lang, 3); + bs_read_string(bits, s->lang, 3); break; default: - fprintf(stderr, "unrecognized coding type %02x\n", s->coding_type); + BD_DEBUG(DBG_NAV | DBG_CRIT, "unrecognized coding type %02x\n", s->coding_type); break; }; s->lang[3] = '\0'; @@ -248,12 +268,12 @@ _parse_stn(BITSTREAM *bits, MPLS_STN *stn) { int len; - off_t pos; + int64_t pos; MPLS_STREAM *ss; int ii,jj; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_stream: Stream alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_stream: Stream alignment error\n"); } // Skip STN len len = bs_read(bits, 16); @@ -280,7 +300,7 @@ for (ii = 0; ii < stn->num_video; ii++) { if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing video entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing video entry\n"); return 0; } } @@ -295,7 +315,7 @@ if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing audio entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing audio entry\n"); return 0; } } @@ -309,7 +329,7 @@ for (ii = 0; ii < (stn->num_pg + stn->num_pip_pg); ii++) { if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing pg/pip-pg entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing pg/pip-pg entry\n"); return 0; } } @@ -323,7 +343,7 @@ for (ii = 0; ii < stn->num_ig; ii++) { if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing ig entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing ig entry\n"); return 0; } } @@ -337,7 +357,7 @@ for (ii = 0; ii < stn->num_secondary_audio; ii++) { if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing secondary audio entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing secondary audio entry\n"); return 0; } // Read Secondary Audio Extra Attributes @@ -363,7 +383,7 @@ for (ii = 0; ii < stn->num_secondary_video; ii++) { if (!_parse_stream(bits, &ss[ii])) { X_FREE(ss); - fprintf(stderr, "error parsing secondary video entry\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing secondary video entry\n"); return 0; } // Read Secondary Video Extra Attributes @@ -421,12 +441,12 @@ _parse_playitem(BITSTREAM *bits, MPLS_PI *pi) { int len, ii; - off_t pos; + int64_t pos; char clip_id[6], codec_id[5]; uint8_t stc_id; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_playitem: Stream alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_playitem: Stream alignment error\n"); } // PlayItem Length @@ -434,13 +454,11 @@ pos = bs_pos(bits) >> 3; // Primary Clip identifer - bs_read_bytes(bits, (uint8_t*)clip_id, 5); - clip_id[5] = '\0'; + bs_read_string(bits, clip_id, 5); - bs_read_bytes(bits, (uint8_t*)codec_id, 4); - codec_id[4] = '\0'; + bs_read_string(bits, codec_id, 4); if (memcmp(codec_id, "M2TS", 4) != 0) { - fprintf(stderr, "Incorrect CodecIdentifier (%s)\n", codec_id); + BD_DEBUG(DBG_NAV | DBG_CRIT, "Incorrect CodecIdentifier (%s)\n", codec_id); } // Skip reserved 11 bits @@ -453,7 +471,7 @@ pi->connection_condition != 0x05 && pi->connection_condition != 0x06) { - fprintf(stderr, "Unexpected connection condition %02x\n", + BD_DEBUG(DBG_NAV | DBG_CRIT, "Unexpected connection condition %02x\n", pi->connection_condition); } @@ -486,13 +504,11 @@ strcpy(pi->clip[0].codec_id, codec_id); pi->clip[0].stc_id = stc_id; for (ii = 1; ii < pi->angle_count; ii++) { - bs_read_bytes(bits, (uint8_t*)pi->clip[ii].clip_id, 5); - pi->clip[ii].clip_id[5] = '\0'; + bs_read_string(bits, pi->clip[ii].clip_id, 5); - bs_read_bytes(bits, (uint8_t*)pi->clip[ii].codec_id, 4); - pi->clip[ii].codec_id[4] = '\0'; + bs_read_string(bits, pi->clip[ii].codec_id, 4); if (memcmp(pi->clip[ii].codec_id, "M2TS", 4) != 0) { - fprintf(stderr, "Incorrect CodecIdentifier (%s)\n", pi->clip[ii].codec_id); + BD_DEBUG(DBG_NAV | DBG_CRIT, "Incorrect CodecIdentifier (%s)\n", pi->clip[ii].codec_id); } pi->clip[ii].stc_id = bs_read(bits, 8); } @@ -515,12 +531,12 @@ _parse_subplayitem(BITSTREAM *bits, MPLS_SUB_PI *spi) { int len, ii; - off_t pos; + int64_t pos; char clip_id[6], codec_id[5]; uint8_t stc_id; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_subplayitem: alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_subplayitem: alignment error\n"); } // PlayItem Length @@ -528,13 +544,11 @@ pos = bs_pos(bits) >> 3; // Primary Clip identifer - bs_read_bytes(bits, (uint8_t*)clip_id, 5); - clip_id[5] = '\0'; + bs_read_string(bits, clip_id, 5); - bs_read_bytes(bits, (uint8_t*)codec_id, 4); - codec_id[4] = '\0'; + bs_read_string(bits, codec_id, 4); if (memcmp(codec_id, "M2TS", 4) != 0) { - fprintf(stderr, "Incorrect CodecIdentifier (%s)\n", codec_id); + BD_DEBUG(DBG_NAV | DBG_CRIT, "Incorrect CodecIdentifier (%s)\n", codec_id); } bs_skip(bits, 27); @@ -545,7 +559,7 @@ spi->connection_condition != 0x05 && spi->connection_condition != 0x06) { - fprintf(stderr, "Unexpected connection condition %02x\n", + BD_DEBUG(DBG_NAV | DBG_CRIT, "Unexpected connection condition %02x\n", spi->connection_condition); } spi->is_multi_clip = bs_read(bits, 1); @@ -567,13 +581,11 @@ spi->clip[0].stc_id = stc_id; for (ii = 1; ii < spi->clip_count; ii++) { // Primary Clip identifer - bs_read_bytes(bits, (uint8_t*)spi->clip[ii].clip_id, 5); - spi->clip[ii].clip_id[5] = '\0'; + bs_read_string(bits, spi->clip[ii].clip_id, 5); - bs_read_bytes(bits, (uint8_t*)spi->clip[ii].codec_id, 4); - spi->clip[ii].codec_id[4] = '\0'; + bs_read_string(bits, spi->clip[ii].codec_id, 4); if (memcmp(spi->clip[ii].codec_id, "M2TS", 4) != 0) { - fprintf(stderr, "Incorrect CodecIdentifier (%s)\n", spi->clip[ii].codec_id); + BD_DEBUG(DBG_NAV | DBG_CRIT, "Incorrect CodecIdentifier (%s)\n", spi->clip[ii].codec_id); } spi->clip[ii].stc_id = bs_read(bits, 8); } @@ -594,11 +606,11 @@ _parse_subpath(BITSTREAM *bits, MPLS_SUB *sp) { int len, ii; - off_t pos; + int64_t pos; MPLS_SUB_PI *spi = NULL; if (!bs_is_align(bits, 0x07)) { - fprintf(stderr, "_parse_subpath: alignment error\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_subpath: alignment error\n"); } // PlayItem Length @@ -616,7 +628,7 @@ for (ii = 0; ii < sp->sub_playitem_count; ii++) { if (!_parse_subplayitem(bits, &spi[ii])) { X_FREE(spi); - fprintf(stderr, "error parsing sub play item\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing sub play item\n"); return 0; } } @@ -641,12 +653,19 @@ static int _parse_playlistmark(BITSTREAM *bits, MPLS_PL *pl) { + int64_t len; int ii; MPLS_PLM *plm = NULL; bs_seek_byte(bits, pl->mark_pos); - // Skip the length field, I don't use it - bs_skip(bits, 32); + // length field + len = bs_read(bits, 32); + + if (bs_avail(bits) < len * 8) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_playlistmark: unexpected end of file\n"); + return 0; + } + // Then get the number of marks pl->mark_count = bs_read(bits, 16); @@ -666,13 +685,20 @@ static int _parse_playlist(BITSTREAM *bits, MPLS_PL *pl) { + int64_t len; int ii; MPLS_PI *pi = NULL; MPLS_SUB *sub_path = NULL; bs_seek_byte(bits, pl->list_pos); - // Skip playlist length - bs_skip(bits, 32); + // playlist length + len = bs_read(bits, 32); + + if (bs_avail(bits) < len * 8) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_playlist: unexpected end of file\n"); + return 0; + } + // Skip reserved bytes bs_skip(bits, 16); @@ -683,7 +709,7 @@ for (ii = 0; ii < pl->list_count; ii++) { if (!_parse_playitem(bits, &pi[ii])) { X_FREE(pi); - fprintf(stderr, "error parsing play list item\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing play list item\n"); return 0; } } @@ -695,7 +721,7 @@ if (!_parse_subpath(bits, &sub_path[ii])) { X_FREE(sub_path); - fprintf(stderr, "error parsing subpath\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing subpath\n"); return 0; } } @@ -772,7 +798,7 @@ { uint32_t data_address; int result; - off_t pos; + int64_t pos; data->clip_ref = bs_read(bits, 16); data->secondary_video_ref = bs_read(bits, 8); @@ -817,7 +843,7 @@ for (ii = 0; ii < entries; ii++) { if (!_parse_pip_metadata_block(bits, start_address, data)) { X_FREE(data); - fprintf(stderr, "error parsing pip metadata extension\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing pip metadata extension\n"); return 0; } } @@ -845,7 +871,7 @@ for (ii = 0; ii < sub_count; ii++) { if (!_parse_subpath(bits, &sub_path[ii])) { X_FREE(sub_path); - fprintf(stderr, "error parsing extension subpath\n"); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing extension subpath\n"); return 0; } } @@ -868,50 +894,47 @@ } if (id1 == 2) { + if (id2 == 1) { + return 0; + } if (id2 == 2) { // SubPath entries extension return _parse_subpath_extension(bits, pl); } } + BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_mpls_extension(): unhandled extension %d.%d\n", id1, id2); + return 0; } static MPLS_PL* -_mpls_parse(const char *path) +_mpls_parse(BD_FILE_H *fp) { BITSTREAM bits; - BD_FILE_H *fp; MPLS_PL *pl = NULL; pl = calloc(1, sizeof(MPLS_PL)); if (pl == NULL) { - return NULL; - } - - fp = file_open(path, "rb"); - if (fp == NULL) { - fprintf(stderr, "Failed to open %s\n", path); - X_FREE(pl); + BD_DEBUG(DBG_CRIT, "out of memory\n"); return NULL; } bs_init(&bits, fp); + if (!_parse_header(&bits, pl)) { - file_close(fp); _clean_playlist(pl); return NULL; } if (!_parse_playlist(&bits, pl)) { - file_close(fp); _clean_playlist(pl); return NULL; } if (!_parse_playlistmark(&bits, pl)) { - file_close(fp); _clean_playlist(pl); return NULL; } + if (pl->ext_pos > 0) { bdmv_parse_extension_data(&bits, pl->ext_pos, @@ -919,28 +942,53 @@ pl); } - file_close(fp); return pl; } MPLS_PL* mpls_parse(const char *path) { - MPLS_PL *pl = _mpls_parse(path); + MPLS_PL *pl; + BD_FILE_H *fp; - /* if failed, try backup file */ - if (!pl) { - size_t len = strlen(path); - char *backup = malloc(len + 8); + fp = file_open(path, "rb"); + if (!fp) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "Failed to open %s\n", path); + return NULL; + } - strncpy(backup, path, len - 19); - strcpy(backup + len - 19, "BACKUP/"); - strcpy(backup + len - 19 + 7, path + len - 19); + pl = _mpls_parse(fp); + file_close(fp); + return pl; +} - pl = _mpls_parse(backup); +static MPLS_PL* +_mpls_get(BD_DISC *disc, const char *dir, const char *file) +{ + MPLS_PL *pl; + BD_FILE_H *fp; - X_FREE(backup); + fp = disc_open_file(disc, dir, file); + if (!fp) { + return NULL; } + pl = _mpls_parse(fp); + file_close(fp); + return pl; +} + +MPLS_PL* +mpls_get(BD_DISC *disc, const char *file) +{ + MPLS_PL *pl; + + pl = _mpls_get(disc, "BDMV" DIR_SEP "PLAYLIST", file); + if (pl) { + return pl; + } + + /* if failed, try backup file */ + pl = _mpls_get(disc, "BDMV" DIR_SEP "BACKUP" DIR_SEP "PLAYLIST", file); return pl; } diff -Nru libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.h libbluray-0.8.1/src/libbluray/bdnav/mpls_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/mpls_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/mpls_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -23,7 +23,7 @@ #include "uo_mask_table.h" -#include +#include "util/attributes.h" #include @@ -40,7 +40,7 @@ uint8_t format; uint8_t rate; uint8_t char_code; - uint8_t lang[4]; + char lang[4]; // Secondary audio specific fields uint8_t sa_num_primary_audio_ref; uint8_t *sa_primary_audio_ref; @@ -177,7 +177,10 @@ } MPLS_PL; -BD_PRIVATE MPLS_PL* mpls_parse(const char *path); +struct bd_disc; + +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 int mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo); diff -Nru libbluray-0.5.0/src/libbluray/bdnav/navigation.c libbluray-0.8.1/src/libbluray/bdnav/navigation.c --- libbluray-0.5.0/src/libbluray/bdnav/navigation.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/navigation.c 2015-02-12 09:56:04.000000000 +0000 @@ -21,44 +21,105 @@ #include "config.h" #endif +#include "navigation.h" + +#include "clpi_parse.h" +#include "mpls_parse.h" + +#include "disc/disc.h" + #include "util/macro.h" #include "util/logging.h" #include "util/strutl.h" #include "file/file.h" -#include "libbluray/bluray.h" -#include "mpls_parse.h" -#include "navigation.h" #include #include -static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl) +static int _stream_cmp(MPLS_STREAM *a, MPLS_STREAM *b) { - unsigned ii, jj; + if (a->stream_type == b->stream_type && + a->coding_type == b->coding_type && + a->pid == b->pid && + a->subpath_id == b->subpath_id && + a->subclip_id == b->subclip_id && + a->format == b->format && + a->rate == b->rate && + a->char_code == b->char_code && + memcmp(a->lang, b->lang, 4) == 0) { + return 0; + } + return 1; +} +static int _streams_cmp(MPLS_STREAM *s1, MPLS_STREAM *s2, unsigned count) +{ + unsigned ii; for (ii = 0; ii < count; ii++) { - if (pl->list_count != pl_list[ii]->list_count) { - continue; - } - if (pl->mark_count != pl_list[ii]->mark_count) { - continue; + if (_stream_cmp(&s1[ii], &s2[ii])) { + return 1; } - for (jj = 0; jj < pl->list_count; jj++) { - MPLS_PI *pi1, *pi2; + } + return 0; +} - pi1 = &pl->play_item[jj]; - pi2 = &pl_list[ii]->play_item[jj]; +static int _pi_cmp(MPLS_PI *pi1, MPLS_PI *pi2) +{ + if (memcmp(pi1->clip[0].clip_id, pi2->clip[0].clip_id, 5) != 0 || + pi1->in_time != pi2->in_time || + pi1->out_time != pi2->out_time) { + return 1; + } + + if (pi1->stn.num_video != pi2->stn.num_video || + pi1->stn.num_audio != pi2->stn.num_audio || + pi1->stn.num_pg != pi2->stn.num_pg || + pi1->stn.num_ig != pi2->stn.num_ig || + pi1->stn.num_secondary_audio != pi2->stn.num_secondary_audio || + pi1->stn.num_secondary_video != pi2->stn.num_secondary_video) { + return 1; + } + + if (_streams_cmp(pi1->stn.video, pi2->stn.video, pi1->stn.num_video) || + _streams_cmp(pi1->stn.audio, pi2->stn.audio, pi1->stn.num_audio) || + _streams_cmp(pi1->stn.pg, pi2->stn.pg, pi1->stn.num_pg) || + _streams_cmp(pi1->stn.ig, pi2->stn.ig, pi1->stn.num_ig) || + _streams_cmp(pi1->stn.secondary_audio, pi2->stn.secondary_audio, pi1->stn.num_secondary_audio) || + _streams_cmp(pi1->stn.secondary_video, pi2->stn.secondary_video, pi1->stn.num_secondary_video)) { + return 1; + } - if (memcmp(pi1->clip[0].clip_id, pi2->clip[0].clip_id, 5) != 0 || - pi1->in_time != pi2->in_time || - pi1->out_time != pi2->out_time) { - break; - } + return 0; +} + +static int _pl_cmp(MPLS_PL *pl1, MPLS_PL *pl2) +{ + unsigned ii; + + if (pl1->list_count != pl2->list_count) { + return 1; + } + if (pl1->mark_count != pl2->mark_count) { + return 1; + } + for (ii = 0; ii < pl1->list_count; ii++) { + if (_pi_cmp(&pl1->play_item[ii], &pl2->play_item[ii])) { + return 1; } - if (jj != pl->list_count) { - continue; + } + + return 0; +} + +/* return 0 if duplicate playlist */ +static int _filter_dup(MPLS_PL *pl_list[], unsigned count, MPLS_PL *pl) +{ + unsigned ii; + + for (ii = 0; ii < count; ii++) { + if (!_pl_cmp(pl, pl_list[ii])) { + return 0; } - return 0; } return 1; } @@ -113,11 +174,10 @@ return duration; } -NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t min_title_length) +NAV_TITLE_LIST* nav_get_title_list(BD_DISC *disc, uint32_t flags, uint32_t min_title_length) { BD_DIR_H *dir; BD_DIRENT ent; - char *path = NULL; MPLS_PL **pl_list = NULL; MPLS_PL *pl = NULL; unsigned int ii, pl_list_size = 0; @@ -125,21 +185,13 @@ NAV_TITLE_LIST *title_list; unsigned int title_info_alloc = 100; - title_list = calloc(1, sizeof(NAV_TITLE_LIST)); - title_list->title_info = calloc(title_info_alloc, sizeof(NAV_TITLE_INFO)); - - BD_DEBUG(DBG_NAV, "Root: %s:\n", root); - path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST", root); - - dir = dir_open(path); + dir = disc_open_dir(disc, "BDMV" DIR_SEP "PLAYLIST"); if (dir == NULL) { - BD_DEBUG(DBG_NAV, "Failed to open dir: %s\n", path); - X_FREE(path); - X_FREE(title_list->title_info); - X_FREE(title_list); return NULL; } - X_FREE(path); + + title_list = calloc(1, sizeof(NAV_TITLE_LIST)); + title_list->title_info = calloc(title_info_alloc, sizeof(NAV_TITLE_INFO)); ii = 0; for (res = dir_read(dir, &ent); !res; res = dir_read(dir, &ent)) { @@ -147,22 +199,17 @@ if (ent.d_name[0] == '.') { continue; } - path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s", - root, ent.d_name); - if (ii >= pl_list_size) { MPLS_PL **tmp = NULL; pl_list_size += 100; tmp = realloc(pl_list, pl_list_size * sizeof(MPLS_PL*)); if (tmp == NULL) { - X_FREE(path); break; } pl_list = tmp; } - pl = mpls_parse(path); - X_FREE(path); + pl = mpls_get(disc, ent.d_name); if (pl != NULL) { if ((flags & TITLES_FILTER_DUP_TITLE) && !_filter_dup(pl_list, ii, pl)) { @@ -341,7 +388,7 @@ unsigned ref, uint32_t *pos, uint32_t *time) { - char *path; + char *file; clip->title = title; clip->ref = ref; @@ -356,11 +403,10 @@ strncpy(&clip->name[5], ".m2ts", 6); clip->clip_id = atoi(mpls_clip[clip->angle].clip_id); - path = str_printf("%s"DIR_SEP"BDMV"DIR_SEP"CLIPINF"DIR_SEP"%s.clpi", - title->root, mpls_clip[clip->angle].clip_id); + file = str_printf("%s.clpi", mpls_clip[clip->angle].clip_id); clpi_free(clip->cl); - clip->cl = clpi_parse(path); - X_FREE(path); + clip->cl = clpi_get(title->disc, file); + X_FREE(file); if (clip->cl == NULL) { clip->start_pkt = 0; clip->end_pkt = 0; @@ -386,16 +432,15 @@ mpls_clip[clip->angle].stc_id); clip->in_time = in_time; clip->out_time = out_time; - clip->pos = *pos; + clip->title_pkt = *pos; *pos += clip->end_pkt - clip->start_pkt; - clip->start_time = *time; + clip->title_time = *time; *time += clip->out_time - clip->in_time; } -NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle) +NAV_TITLE* nav_title_open(BD_DISC *disc, const char *playlist, unsigned angle) { NAV_TITLE *title = NULL; - char *path; unsigned ii, ss, chapters = 0; uint32_t pos = 0; uint32_t time = 0; @@ -404,21 +449,18 @@ if (title == NULL) { return NULL; } - title->root = str_dup(root); + title->disc = disc; strncpy(title->name, playlist, 11); title->name[10] = '\0'; - path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s", - root, playlist); title->angle_count = 0; title->angle = angle; - title->pl = mpls_parse(path); + title->pl = mpls_get(disc, playlist); if (title->pl == NULL) { - BD_DEBUG(DBG_NAV, "Fail: Playlist parse %s\n", path); + BD_DEBUG(DBG_NAV, "Fail: Playlist parse %s\n", playlist); X_FREE(title); - X_FREE(path); return NULL; } - X_FREE(path); + // 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)); @@ -497,7 +539,6 @@ } mpls_free(title->pl); X_FREE(title->clip_list.clip); - X_FREE(title->root); X_FREE(title->chap_list.mark); X_FREE(title->mark_list.mark); X_FREE(title); @@ -512,16 +553,16 @@ if (chapter > title->chap_list.count) { clip = &title->clip_list.clip[0]; *clip_pkt = clip->start_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt; return clip; } clip = &title->clip_list.clip[title->chap_list.mark[chapter].clip_ref]; *clip_pkt = title->chap_list.mark[chapter].clip_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } -uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t pkt) +uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt) { NAV_MARK * mark; NAV_TITLE *title; @@ -541,12 +582,12 @@ else return 0; } - if (mark->clip_ref == clip->ref && mark->clip_pkt <= pkt) { + if (mark->clip_ref == clip->ref && mark->clip_pkt <= clip_pkt) { if ( ii == title->chap_list.count - 1 ) { return ii; } mark = &title->chap_list.mark[ii+1]; - if (mark->clip_ref != clip->ref || mark->clip_pkt > pkt) { + if (mark->clip_ref != clip->ref || mark->clip_pkt > clip_pkt) { return ii; } } @@ -563,12 +604,12 @@ if (mark > title->mark_list.count) { clip = &title->clip_list.clip[0]; *clip_pkt = clip->start_pkt; - *out_pkt = clip->pos; + *out_pkt = clip->title_pkt; return clip; } clip = &title->clip_list.clip[title->mark_list.mark[mark].clip_ref]; *clip_pkt = title->mark_list.mark[mark].clip_pkt; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -582,6 +623,7 @@ NAV_CLIP *clip; unsigned ii; + *out_time = 0; pos = 0; for (ii = 0; ii < title->pl->list_count; ii++) { clip = &title->clip_list.clip[ii]; @@ -598,6 +640,9 @@ clip = &title->clip_list.clip[ii]; if (clip->cl != NULL) { *clip_pkt = clpi_access_point(clip->cl, pkt - pos + clip->start_pkt, 0, 0, out_time); + if (*clip_pkt < clip->start_pkt) { + *clip_pkt = clip->start_pkt; + } } else { *clip_pkt = clip->start_pkt; } @@ -606,7 +651,7 @@ *out_time = 0; else *out_time -= clip->in_time; - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -673,11 +718,14 @@ if (clip->cl != NULL) { *clip_pkt = clpi_lookup_spn(clip->cl, tick - pos + pi->in_time, 1, title->pl->play_item[clip->ref].clip[clip->angle].stc_id); + if (*clip_pkt < clip->start_pkt) { + *clip_pkt = clip->start_pkt; + } } else { *clip_pkt = clip->start_pkt; } } - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; return clip; } @@ -695,7 +743,7 @@ *clip_pkt = clip->start_pkt; } } - *out_pkt = clip->pos + *clip_pkt - clip->start_pkt; + *out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt; } /* diff -Nru libbluray-0.5.0/src/libbluray/bdnav/navigation.h libbluray-0.8.1/src/libbluray/bdnav/navigation.h --- libbluray-0.5.0/src/libbluray/bdnav/navigation.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/navigation.h 2015-02-12 09:56:04.000000000 +0000 @@ -20,10 +20,12 @@ #if !defined(_NAVIGATION_H_) #define _NAVIGATION_H_ -#include +#include "util/attributes.h" #include "mpls_parse.h" -#include "clpi_parse.h" +#include "clpi_data.h" + +struct bd_disc; #define CONNECT_NON_SEAMLESS 0 #define CONNECT_SEAMLESS 1 @@ -66,13 +68,11 @@ char name[11]; uint32_t clip_id; unsigned ref; - uint32_t pos; uint32_t start_pkt; uint32_t end_pkt; uint8_t connection; uint8_t angle; - uint32_t start_time; uint32_t duration; uint32_t in_time; @@ -102,7 +102,7 @@ }; struct nav_title_s { - char *root; + struct bd_disc *disc; char name[11]; uint8_t angle_count; uint8_t angle; @@ -138,7 +138,7 @@ }; BD_PRIVATE uint8_t nav_lookup_aspect(NAV_CLIP *clip, int pid); -BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle); +BD_PRIVATE NAV_TITLE* nav_title_open(struct bd_disc *disc, const char *playlist, unsigned angle) BD_ATTR_MALLOC; BD_PRIVATE void nav_title_close(NAV_TITLE *title); BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip); BD_PRIVATE NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt, @@ -146,12 +146,12 @@ BD_PRIVATE NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE NAV_CLIP* nav_chapter_search(NAV_TITLE *title, unsigned chapter, uint32_t *clip_pkt, uint32_t *out_pkt); -BD_PRIVATE uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t pkt); +BD_PRIVATE uint32_t nav_chapter_get_current(NAV_CLIP *clip, uint32_t clip_pkt); BD_PRIVATE NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *clip_pkt, uint32_t *out_pkt); BD_PRIVATE uint32_t nav_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time); BD_PRIVATE NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle); -BD_PRIVATE NAV_TITLE_LIST* nav_get_title_list(const char *root, uint32_t flags, uint32_t min_title_length); +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); #endif // _NAVIGATION_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/sound_parse.c libbluray-0.8.1/src/libbluray/bdnav/sound_parse.c --- libbluray-0.5.0/src/libbluray/bdnav/sound_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/sound_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,11 +17,18 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "sound_parse.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "sound_parse.h" #include @@ -120,10 +127,9 @@ } } -SOUND_DATA *sound_parse(const char *file_name) +static SOUND_DATA *_sound_parse(BD_FILE_H *fp) { BITSTREAM bs; - BD_FILE_H *fp; SOUND_DATA *data = NULL; uint16_t num_sounds; uint32_t data_len; @@ -131,16 +137,10 @@ uint32_t data_start, extension_data_start; uint32_t *data_offsets = NULL; - fp = file_open(file_name, "rb"); - if (!fp) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "error opening %s\n", file_name); - return NULL; - } - bs_init(&bs, fp); if (!_bclk_parse_header(&bs, &data_start, &extension_data_start)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: invalid header\n", file_name); + BD_DEBUG(DBG_NAV | DBG_CRIT, "invalid header\n"); goto error; } @@ -151,7 +151,7 @@ num_sounds = bs_read(&bs, 8); if (data_len < 1) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: empty database\n", file_name); + BD_DEBUG(DBG_NAV | DBG_CRIT, "empty database\n"); goto error; } @@ -164,7 +164,7 @@ for (i = 0; i < data->num_sounds; i++) { if (!_sound_parse_index(&bs, data_offsets + i, &data->sounds[i])) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: error parsing sound %d attribues\n", file_name, i); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error parsing sound %d attribues\n", i); goto error; } } @@ -176,19 +176,33 @@ bs_seek_byte(&bs, data_start + data_offsets[i]); if (!_sound_read_samples(&bs, &data->sounds[i])) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: error reading samples for sound %d\n", file_name, i); + BD_DEBUG(DBG_NAV | DBG_CRIT, "error reading samples for sound %d\n", i); goto error; } } X_FREE(data_offsets); - file_close(fp); - return data; error: sound_free(&data); X_FREE(data_offsets); - file_close(fp); return NULL; } + +SOUND_DATA *sound_get(BD_DISC *disc) +{ + BD_FILE_H *fp; + SOUND_DATA *p; + + /* there's no no backup copy for sound.bdmv */ + + fp = disc_open_path(disc, "BDMV" DIR_SEP "AUXDATA" DIR_SEP "sound.bdmv"); + if (!fp) { + return NULL; + } + + p = _sound_parse(fp); + file_close(fp); + return p; +} diff -Nru libbluray-0.5.0/src/libbluray/bdnav/sound_parse.h libbluray-0.8.1/src/libbluray/bdnav/sound_parse.h --- libbluray-0.5.0/src/libbluray/bdnav/sound_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/sound_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_SOUND_PARSE_H_) #define _SOUND_PARSE_H_ -#include +#include "util/attributes.h" #include @@ -38,8 +38,9 @@ SOUND_OBJECT *sounds; } SOUND_DATA; +struct bd_disc; -BD_PRIVATE SOUND_DATA* sound_parse(const char *path); /* parse sound.bdmv */ +BD_PRIVATE SOUND_DATA* sound_get(struct bd_disc *disc); /* parse sound.bdmv */ BD_PRIVATE void sound_free(SOUND_DATA **sound); #endif // _SOUND_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bdnav/uo_mask_table.h libbluray-0.8.1/src/libbluray/bdnav/uo_mask_table.h --- libbluray-0.5.0/src/libbluray/bdnav/uo_mask_table.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bdnav/uo_mask_table.h 2015-05-15 09:25:06.000000000 +0000 @@ -22,6 +22,11 @@ #include +enum { + UO_MASK_MENU_CALL_INDEX = 0, + UO_MASK_TITLE_SEARCH_INDEX = 1, +}; + typedef struct bd_uo_mask_table_s { unsigned int menu_call : 1; @@ -34,7 +39,7 @@ unsigned int stop : 1; unsigned int pause_on : 1; unsigned int pause_off : 1; - unsigned int still : 1; + unsigned int still_off : 1; unsigned int forward : 1; unsigned int backward : 1; unsigned int resume : 1; @@ -62,17 +67,28 @@ static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b) { - BD_UO_MASK o; - unsigned int *pa = (unsigned int*)&a; - unsigned int *pb = (unsigned int*)&b; - unsigned int *po = (unsigned int*)&o; - unsigned i; - - for (i = 0; i < sizeof(BD_UO_MASK) / sizeof(unsigned int); i++) { - po[i] = pa[i] | pb[i]; - } + union { + uint64_t u64; + BD_UO_MASK mask; + } mask_a = {0}, mask_b = {0}, result; + + mask_a.mask = a; + mask_b.mask = b; + result.u64 = mask_a.u64 | mask_b.u64; + + return result.mask; +} + +#define EMPTY_UO_MASK {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0} + +static inline BD_UO_MASK bd_empty_uo_mask(void) +{ + static const union { + const uint64_t u64; + const BD_UO_MASK mask; + } empty = {0}; - return o; + return empty.mask; } #endif // _BD_UO_MASK_TABLE_H_ diff -Nru libbluray-0.5.0/src/libbluray/bluray.c libbluray-0.8.1/src/libbluray/bluray.c --- libbluray-0.5.0/src/libbluray/bluray.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bluray.c 2015-05-15 09:25:06.000000000 +0000 @@ -27,44 +27,36 @@ #include "bluray.h" #include "bluray_internal.h" #include "register.h" +#include "util/array.h" #include "util/macro.h" #include "util/logging.h" #include "util/strutl.h" #include "util/mutex.h" +#include "bdnav/bdid_parse.h" #include "bdnav/navigation.h" #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 "hdmv/hdmv_vm.h" +#include "hdmv/mobj_parse.h" #include "decoders/graphics_controller.h" #include "decoders/m2ts_filter.h" #include "decoders/overlay.h" +#include "disc/disc.h" +#include "disc/enc_info.h" #include "file/file.h" #ifdef USING_BDJAVA #include "bdj/bdj.h" +#include "bdj/bdjo_parse.h" #endif -#include "file/libbdplus.h" -#include "file/libaacs.h" - +#include // SEEK_ #include #include #include -#ifdef HAVE_MNTENT_H -#include -#include -#endif - -#ifdef __APPLE__ -#define _DARWIN_C_SOURCE -#include -#include -#include -#include -#endif - #define MAX_EVENTS 31 /* 2^n - 1 */ typedef struct bd_event_queue_s { @@ -91,16 +83,18 @@ /* current aligned unit */ uint16_t int_buf_off; + /* current stream UO mask (combined from playlist and current clip UO masks) */ BD_UO_MASK uo_mask; /* internally handled pids */ uint16_t ig_pid; /* pid of currently selected IG stream */ uint16_t pg_pid; /* pid of currently selected PG stream */ - M2TS_FILTER *m2ts_filter; + /* */ + uint8_t eof_hit; + uint8_t encrypted_block_cnt; - /* BD+ */ - BD_BDPLUS_ST *bdplus; + M2TS_FILTER *m2ts_filter; } BD_STREAM; typedef struct { @@ -111,12 +105,12 @@ struct bluray { - BD_MUTEX mutex; /* protect API function access to internal data (must be first element in struct) */ + BD_MUTEX mutex; /* protect API function access to internal data */ /* current disc */ - char *device_path; + BD_DISC *disc; BLURAY_DISC_INFO disc_info; - INDX_ROOT *index; + BLURAY_TITLE **titles; /* titles from disc index */ META_ROOT *meta; NAV_TITLE_LIST *title_list; @@ -126,8 +120,8 @@ uint64_t s_pos; /* streams */ - BD_STREAM st0; /* main path */ - BD_PRELOAD st_ig; /* preloaded IG stream sub path */ + BD_STREAM st0; /* main path */ + BD_PRELOAD st_ig; /* preloaded IG stream sub path */ BD_PRELOAD st_textst; /* preloaded TextST sub path */ /* buffer for bd_read(): current aligned unit of main stream (st0) */ @@ -143,29 +137,33 @@ uint64_t next_mark_pos; int next_mark; - /* AACS */ - BD_AACS *libaacs; - - /* BD+ */ - BD_BDPLUS *libbdplus; - /* player state */ - BD_REGISTERS *regs; // player registers - BD_EVENT_QUEUE *event_queue; // navigation mode event queue - BD_TITLE_TYPE title_type; // type of current title (in navigation mode) + BD_REGISTERS *regs; /* player registers */ + BD_EVENT_QUEUE *event_queue; /* navigation mode event queue */ + BD_UO_MASK uo_mask; /* Current UO mask */ + BD_UO_MASK title_uo_mask; /* UO mask from current .bdjo file or Movie Object */ + BD_TITLE_TYPE title_type; /* type of current title (in navigation mode) */ + /* Pending action after playlist end + * BD-J: delayed sending of BDJ_EVENT_END_OF_PLAYLIST + * 1 - message pending. 3 - message sent. + */ + uint8_t end_of_playlist; /* 1 - reached. 3 - processed . */ + /* HDMV */ HDMV_VM *hdmv_vm; - uint8_t hdmv_suspended; + uint8_t hdmv_suspended; + + /* BD-J */ #ifdef USING_BDJAVA BDJAVA *bdjava; + BDJ_STORAGE bdjstorage; + uint8_t bdj_wait_start; /* BD-J has selected playlist (prefetch) but not yet started playback */ #endif - /* delayed sending of BDJ_EVENT_END_OF_PLAYLIST: - * 1 - message pending. 3 - message sent. */ - uint8_t bdj_end_of_playlist; /* HDMV graphics */ GRAPHICS_CONTROLLER *graphics_controller; SOUND_DATA *sound_effects; + BD_UO_MASK gc_uo_mask; /* UO mask from current menu page */ uint32_t gc_status; uint8_t decode_pg; @@ -174,9 +172,12 @@ uint64_t gc_wakeup_pos; /* stream position of gc_wakeup_time */ /* ARGB overlay output */ +#ifdef USING_BDJAVA void *argb_overlay_proc_handle; bd_argb_overlay_proc_f argb_overlay_proc; BD_ARGB_BUFFER *argb_buffer; + BD_MUTEX argb_buffer_mutex; +#endif }; /* Stream Packet Number = byte offset / 192. Avoid 64-bit division. */ @@ -279,7 +280,6 @@ MPLS_STREAM *streams, unsigned num_streams, uint32_t *lang, uint32_t blacklist) { - uint32_t psr_val; uint32_t preferred_lang; int stream_idx = -1; unsigned ii; @@ -321,13 +321,9 @@ BD_DEBUG(DBG_BLURAY, "Selected stream %d (language %s)\n", stream_idx, streams[stream_idx].lang); - bd_psr_lock(regs); - - psr_val = bd_psr_read(regs, psr_stream) & 0x7fff0000; - psr_val |= (stream_idx + 1) | enable_flag; - bd_psr_write(regs, psr_stream, psr_val); - - bd_psr_unlock(regs); + bd_psr_write_bits(regs, psr_stream, + (stream_idx + 1) | enable_flag, + 0x80000fff); } static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip) @@ -357,11 +353,12 @@ NULL, audio_lang); } - /* Validate selected audio and subtitle stream PSRs when using menus */ + /* Validate selected audio, subtitle and IG stream PSRs when using menus */ } else { uint32_t psr_val; if (stn->num_audio) { + bd_psr_lock(bd->regs); psr_val = bd_psr_read(bd->regs, PSR_PRIMARY_AUDIO_ID); if (psr_val == 0 || psr_val > stn->num_audio) { _update_stream_psr_by_lang(bd->regs, @@ -371,8 +368,10 @@ } else { audio_lang = str_to_uint32((const char *)stn->audio[psr_val - 1].lang, 3); } + bd_psr_unlock(bd->regs); } if (stn->num_pg) { + bd_psr_lock(bd->regs); psr_val = bd_psr_read(bd->regs, PSR_PG_STREAM) & 0xfff; if ((psr_val == 0) || (psr_val > stn->num_pg)) { _update_stream_psr_by_lang(bd->regs, @@ -380,14 +379,40 @@ stn->pg, stn->num_pg, NULL, audio_lang); } + bd_psr_unlock(bd->regs); + } + if (stn->num_ig) { + bd_psr_lock(bd->regs); + psr_val = bd_psr_read(bd->regs, PSR_IG_STREAM_ID); + if ((psr_val == 0) || (psr_val > stn->num_ig)) { + bd_psr_write(bd->regs, PSR_IG_STREAM_ID, 1); + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Selected IG stream 1 (stream %d not available)\n", psr_val); + } + bd_psr_unlock(bd->regs); } } } +static int _is_interactive_title(BLURAY *bd) +{ + if (bd->titles && bd->title_type != title_undef) { + unsigned title = bd_psr_read(bd->regs, PSR_TITLE_NUMBER); + if (title == 0xffff && bd->disc_info.first_play->interactive) { + return 1; + } + if (title <= bd->disc_info.num_titles && bd->titles[title]) { + return bd->titles[title]->interactive; + } + } + return 0; +} + static void _update_chapter_psr(BLURAY *bd) { - uint32_t current_chapter = bd_get_current_chapter(bd); - bd_psr_write(bd->regs, PSR_CHAPTER, current_chapter + 1); + if (!_is_interactive_title(bd)) { + uint32_t current_chapter = bd_get_current_chapter(bd); + bd_psr_write(bd->regs, PSR_CHAPTER, current_chapter + 1); + } } /* @@ -396,7 +421,8 @@ static int _find_pg_stream(BLURAY *bd, uint16_t *pid, int *sub_path_idx, unsigned *sub_clip_idx, uint8_t *char_code) { - MPLS_PI *pi = &bd->title->pl->play_item[0]; + unsigned main_clip_idx = bd->st0.clip ? bd->st0.clip->ref : 0; + MPLS_PI *pi = &bd->title->pl->play_item[main_clip_idx]; unsigned pg_stream = bd_psr_read(bd->regs, PSR_PG_STREAM); #if 0 @@ -464,7 +490,7 @@ { if (bd->st_textst.clip) { if (bd->st0.clip_block_pos >= bd->gc_wakeup_pos) { - GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0}; + GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0, EMPTY_UO_MASK}; gc_run(bd->graphics_controller, GC_CTRL_PG_UPDATE, bd->gc_wakeup_time, &cmds); @@ -475,10 +501,12 @@ if (cmds.wakeup_time >= bd->st0.clip->in_time && cmds.wakeup_time < bd->st0.clip->out_time) { /* find event position in main path clip */ NAV_CLIP *clip = bd->st0.clip; - 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); - if (spn) { - bd->gc_wakeup_pos = spn * 192; + 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); + if (spn) { + bd->gc_wakeup_pos = (uint64_t)spn * 192L; + } } } } @@ -487,9 +515,9 @@ static void _init_textst_timer(BLURAY *bd) { - if (bd->st_textst.clip) { + if (bd->st_textst.clip && bd->st0.clip->cl) { uint32_t clip_time; - clpi_access_point(bd->st0.clip->cl, bd->st0.clip_block_pos/192, /*next=*/0, /*angle_change=*/0, &clip_time); + clpi_access_point(bd->st0.clip->cl, SPN(bd->st0.clip_block_pos), /*next=*/0, /*angle_change=*/0, &clip_time); bd->gc_wakeup_time = clip_time; bd->gc_wakeup_pos = 0; _update_textst_timer(bd); @@ -497,6 +525,48 @@ } /* + * UO mask + */ + +static uint32_t _compressed_mask(BD_UO_MASK mask) +{ + return mask.menu_call | (mask.title_search << 1); +} + +static void _update_uo_mask(BLURAY *bd) +{ + BD_UO_MASK old_mask = bd->uo_mask; + BD_UO_MASK new_mask; + + new_mask = bd_uo_mask_combine(bd->title_uo_mask, bd->st0.uo_mask); + new_mask = bd_uo_mask_combine(bd->gc_uo_mask, new_mask); + if (_compressed_mask(old_mask) != _compressed_mask(new_mask)) { + _queue_event(bd, BD_EVENT_UO_MASK_CHANGED, _compressed_mask(new_mask)); + } + bd->uo_mask = new_mask; +} + +#ifdef USING_BDJAVA +void bd_set_bdj_uo_mask(BLURAY *bd, unsigned mask) +{ + bd->title_uo_mask.title_search = !!(mask & BDJ_TITLE_SEARCH_MASK); + bd->title_uo_mask.menu_call = !!(mask & BDJ_MENU_CALL_MASK); + + _update_uo_mask(bd); +} +#endif + +static void _update_hdmv_uo_mask(BLURAY *bd) +{ + uint32_t mask = hdmv_vm_get_uo_mask(bd->hdmv_vm); + bd->title_uo_mask.title_search = !!(mask & HDMV_TITLE_SEARCH_MASK); + bd->title_uo_mask.menu_call = !!(mask & HDMV_MENU_CALL_MASK); + + _update_uo_mask(bd); +} + + +/* * clip access (BD_STREAM) */ @@ -508,27 +578,19 @@ } m2ts_filter_close(&st->m2ts_filter); - - libbdplus_m2ts_close(&st->bdplus); - - /* reset UO mask */ - memset(&st->uo_mask, 0, sizeof(st->uo_mask)); } static int _open_m2ts(BLURAY *bd, BD_STREAM *st) { - char *f_name; - _close_m2ts(st); - f_name = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "STREAM" DIR_SEP "%s", - bd->device_path, st->clip->name); - st->fp = file_open(f_name, "rb"); - X_FREE(f_name); + st->fp = disc_open_stream(bd->disc, st->clip->name); st->clip_size = 0; st->clip_pos = (uint64_t)st->clip->start_pkt * 192; st->clip_block_pos = (st->clip_pos / 6144) * 6144; + st->eof_hit = 0; + st->encrypted_block_cnt = 0; if (st->fp) { int64_t clip_size = file_size(st->fp); @@ -543,18 +605,18 @@ st->clip_size = clip_size; st->int_buf_off = 6144; - libaacs_select_title(bd->libaacs, bd_psr_read(bd->regs, PSR_TITLE_NUMBER)); - if (st == &bd->st0) { MPLS_PL *pl = st->clip->title->pl; MPLS_STN *stn = &pl->play_item[st->clip->ref].stn; st->uo_mask = bd_uo_mask_combine(pl->app_info.uo_mask, pl->play_item[st->clip->ref].uo_mask); + _update_uo_mask(bd); st->m2ts_filter = m2ts_filter_init((int64_t)st->clip->in_time << 1, (int64_t)st->clip->out_time << 1, - stn->num_video, stn->num_audio); + stn->num_video, stn->num_audio, + stn->num_ig, stn->num_pg); _update_clip_psrs(bd, st->clip); @@ -563,8 +625,6 @@ _init_textst_timer(bd); } - st->bdplus = libbdplus_m2ts(bd->libbdplus, st->clip->clip_id, st->clip_block_pos); - return 1; } @@ -577,6 +637,61 @@ return 0; } +static int _validate_unit(BLURAY *bd, BD_STREAM *st, uint8_t *buf) +{ + /* Check TP_extra_header Copy_permission_indicator. If != 0, unit may be encrypted. */ + /* Check first sync byte. It should never be encrypted. */ + if (BD_UNLIKELY(buf[0] & 0xc0 || buf[4] != 0x47)) { + + /* Check first sync bytes. If not OK, drop unit. */ + if (buf[4] != 0x47 || buf [4 + 192] != 0x47 || buf[4 + 2*192] != 0x47 || buf[4 + 3*192] != 0x47) { + + /* Some streams have Copy_permission_indicator incorrectly set. */ + /* Check first TS sync byte. If unit is encrypted, first 16 bytes are plain, rest not. */ + /* not 100% accurate (can be random data too). But the unit is broken anyway ... */ + if (buf[4] == 0x47) { + + /* most likely encrypted stream. Check couple of blocks before erroring out. */ + st->encrypted_block_cnt++; + + if (st->encrypted_block_cnt > 10) { + /* error out */ + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "TP header copy permission indicator != 0. Stream seems to be encrypted.\n"); + _queue_event(bd, BD_EVENT_ENCRYPTED, BD_ERROR_AACS); + return -1; + } + } + + /* broken block, ignore it */ + _queue_event(bd, BD_EVENT_READ_ERROR, 1); + return 0; + } + } + + st->eof_hit = 0; + st->encrypted_block_cnt = 0; + return 1; +} + +static int _skip_unit(BLURAY *bd, BD_STREAM *st) +{ + const size_t len = 6144; + + /* skip broken unit */ + st->clip_block_pos += len; + st->clip_pos += len; + + _queue_event(bd, BD_EVENT_READ_ERROR, 0); + + /* seek to next unit start */ + if (file_seek(st->fp, st->clip_block_pos, SEEK_SET) < 0) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to seek clip %s!\n", st->clip->name); + return -1; + } + + return 0; +} + static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf) { const size_t len = 6144; @@ -588,28 +703,19 @@ size_t read_len; if ((read_len = file_read(st->fp, buf, len))) { + int error; + if (read_len != len) { BD_DEBUG(DBG_STREAM | DBG_CRIT, "Read %d bytes at %"PRIu64" ; requested %d !\n", (int)read_len, st->clip_block_pos, (int)len); + return _skip_unit(bd, st); } - if (bd->libaacs && libaacs_decrypt_unit(bd->libaacs, buf)) { - _queue_event(bd, BD_EVENT_ENCRYPTED, BD_ERROR_AACS); - return -1; - } - if (st->bdplus && (libbdplus_fixup(st->bdplus, buf, len) < 0)) { - _queue_event(bd, BD_EVENT_ENCRYPTED, BD_ERROR_BDPLUS); - } - st->clip_block_pos += len; - /* Check TP_extra_header Copy_permission_indicator. If != 0, unit is still encrypted. */ - if (buf[0] & 0xc0) { - /* check first TS sync bytes */ - if (buf[4] != 0x47 || buf[4+192] != 0x47 || buf[4+2*192] != 0x47) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, - "TP header copy permission indicator != 0, unit is still encrypted?\n"); - _queue_event(bd, BD_EVENT_ENCRYPTED, BD_ERROR_AACS); - return -1; - } + if ((error = _validate_unit(bd, st, buf)) <= 0) { + /* skip broken unit */ + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Skipping broken unit at %"PRId64"\n", st->clip_block_pos - len); + st->clip_pos += len; + return error; } if (st->m2ts_filter) { @@ -632,21 +738,9 @@ BD_DEBUG(DBG_STREAM | DBG_CRIT, "Read unit at %"PRIu64" failed !\n", st->clip_block_pos); - _queue_event(bd, BD_EVENT_READ_ERROR, 0); - - /* skip broken unit */ - st->clip_block_pos += len; - st->clip_pos += len; - - if (file_seek(st->fp, st->clip_block_pos, SEEK_SET) < 0) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to seek clip %s!\n", st->clip->name); - } - - return 0; + return _skip_unit(bd, st); } - BD_DEBUG(DBG_STREAM | DBG_CRIT, "Read past EOF !\n"); - /* This is caused by truncated .m2ts file or invalid clip length. * * Increase position to avoid infinite loops. @@ -655,6 +749,11 @@ st->clip_block_pos += len; st->clip_pos += len; + if (!st->eof_hit) { + BD_DEBUG(DBG_STREAM | DBG_CRIT, "Read past EOF !\n"); + st->eof_hit = 1; + } + return 0; } @@ -760,8 +859,12 @@ { int result = -1; - if (bd && bd->graphics_controller && bd->hdmv_vm) { - GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0}; + if (!bd) { + return -1; + } + + if (bd->graphics_controller && bd->hdmv_vm) { + GC_NAV_CMDS cmds = {-1, NULL, -1, 0, 0, EMPTY_UO_MASK}; result = gc_run(bd->graphics_controller, msg, param, &cmds); @@ -785,6 +888,9 @@ _queue_event(bd, BD_EVENT_SOUND_EFFECT, cmds.sound_id_ref); } + bd->gc_uo_mask = cmds.page_uo_mask; + _update_uo_mask(bd); + } else { if (bd->gc_status & GC_STATUS_MENU_OPEN) { _queue_event(bd, BD_EVENT_MENU, 0); @@ -799,126 +905,13 @@ } /* - * libaacs and libbdplus open / close - */ - -static int _libaacs_init(BLURAY *bd, const char *keyfile_path) -{ - int result; - const uint8_t *disc_id; - - libaacs_unload(&bd->libaacs); - - bd->disc_info.aacs_detected = libaacs_required(bd->device_path); - if (!bd->disc_info.aacs_detected) { - /* no AACS */ - return 1; /* no error if libaacs is not needed */ - } - - bd->libaacs = libaacs_load(); - bd->disc_info.libaacs_detected = !!bd->libaacs; - if (!bd->libaacs) { - /* no libaacs */ - return 0; - } - - result = libaacs_open(bd->libaacs, bd->device_path, keyfile_path); - - bd->disc_info.aacs_error_code = result; - bd->disc_info.aacs_handled = !result; - bd->disc_info.aacs_mkbv = libaacs_get_mkbv(bd->libaacs); - disc_id = libaacs_get_aacs_data(bd->libaacs, BD_AACS_DISC_ID); - if (disc_id) { - memcpy(bd->disc_info.disc_id, disc_id, 20); - } - - if (result) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_open() failed!\n"); - libaacs_unload(&bd->libaacs); - return 0; - } - - BD_DEBUG(DBG_BLURAY, "Opened libaacs\n"); - return 1; -} - -const uint8_t *bd_get_aacs_data(BLURAY *bd, int type) -{ - /* internal function. Used by BD-J and libbdplus loader. */ - return libaacs_get_aacs_data(bd->libaacs, type); -} - -static int _libbdplus_init(BLURAY *bd) -{ - libbdplus_unload(&bd->libbdplus); - - bd->disc_info.bdplus_detected = libbdplus_required(bd->device_path); - if (!bd->disc_info.bdplus_detected) { - return 0; - } - - bd->libbdplus = libbdplus_load(); - bd->disc_info.libbdplus_detected = !!bd->libbdplus; - if (!bd->libbdplus) { - return 0; - } - - const uint8_t *vid = libaacs_get_aacs_data(bd->libaacs, BD_AACS_MEDIA_VID); - const uint8_t *mk = libaacs_get_aacs_data(bd->libaacs, BD_AACS_MEDIA_KEY); - if (!vid) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ initialization failed (no AACS ?)\n"); - libaacs_unload(&bd->libaacs); - return 0; - } - - if (libbdplus_init(bd->libbdplus, bd->device_path, vid, mk)) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bdplus_init() failed\n"); - - bd->disc_info.bdplus_handled = 0; - libbdplus_unload(&bd->libbdplus); - return 0; - } - - BD_DEBUG(DBG_BLURAY, "libbdplus initialized\n"); - - /* map player memory regions */ - libbdplus_mmap(bd->libbdplus, 0, (void*)bd->regs); - libbdplus_mmap(bd->libbdplus, 1, (void*)((uint8_t *)bd->regs + sizeof(uint32_t) * 128)); - - /* connect registers */ - libbdplus_psr(bd->libbdplus, (void*)bd->regs, (void*)bd_psr_read, (void*)bd_psr_write); - - bd->disc_info.bdplus_gen = libbdplus_get_gen(bd->libbdplus); - bd->disc_info.bdplus_date = libbdplus_get_date(bd->libbdplus); - bd->disc_info.bdplus_handled = 1; - return 1; -} - -/* - * index open - */ - -static int _index_open(BLURAY *bd) -{ - if (!bd->index) { - char *file; - - file = str_printf("%s/BDMV/index.bdmv", bd->device_path); - bd->index = indx_parse(file); - X_FREE(file); - } - - return !!bd->index; -} - -/* * meta open */ static int _meta_open(BLURAY *bd) { if (!bd->meta) { - bd->meta = meta_parse(bd->device_path); + bd->meta = meta_parse(bd->disc); } return !!bd->meta; @@ -933,8 +926,22 @@ return &bd->disc_info; } -static void _fill_disc_info(BLURAY *bd) +static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info) { + bd->disc_info.aacs_detected = enc_info->aacs_detected; + bd->disc_info.libaacs_detected = enc_info->libaacs_detected; + bd->disc_info.aacs_error_code = enc_info->aacs_error_code; + bd->disc_info.aacs_handled = enc_info->aacs_handled; + bd->disc_info.aacs_mkbv = enc_info->aacs_mkbv; + memcpy(bd->disc_info.disc_id, enc_info->disc_id, 20); + bd->disc_info.bdplus_detected = enc_info->bdplus_detected; + bd->disc_info.libbdplus_detected = enc_info->libbdplus_detected; + bd->disc_info.bdplus_handled = enc_info->bdplus_handled; + bd->disc_info.bdplus_gen = enc_info->bdplus_gen; + bd->disc_info.bdplus_date = enc_info->bdplus_date; + + bd->disc_info.udf_volume_id = disc_volume_id(bd->disc); + bd->disc_info.bluray_detected = 0; bd->disc_info.top_menu_supported = 0; bd->disc_info.first_play_supported = 0; @@ -947,39 +954,91 @@ bd->disc_info.libjvm_detected = 0; bd->disc_info.bdj_handled = 0; - if (bd->index) { + bd->disc_info.num_titles = 0; + bd->disc_info.titles = NULL; + bd->disc_info.top_menu = NULL; + bd->disc_info.first_play = NULL; + + array_free((void**)&bd->titles); + + memset(bd->disc_info.bdj_org_id, 0, sizeof(bd->disc_info.bdj_org_id)); + memset(bd->disc_info.bdj_disc_id, 0, sizeof(bd->disc_info.bdj_disc_id)); + + INDX_ROOT *index = indx_get(bd->disc); + if (index) { INDX_PLAY_ITEM *pi; unsigned ii; bd->disc_info.bluray_detected = 1; - /* count titles */ + /* application info */ + bd->disc_info.video_format = index->app_info.video_format; + bd->disc_info.frame_rate = index->app_info.frame_rate; + bd->disc_info.content_exist_3D = index->app_info.content_exist_flag; + bd->disc_info.initial_output_mode_preference = index->app_info.initial_output_mode_preference; + memcpy(bd->disc_info.provider_data, index->app_info.user_data, sizeof(bd->disc_info.provider_data)); + + /* allocate array for title info */ + BLURAY_TITLE **titles = (BLURAY_TITLE**)array_alloc(index->num_titles + 2, sizeof(BLURAY_TITLE)); + if (!titles) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't allocate memory\n"); + return; + } + bd->titles = titles; + bd->disc_info.titles = (const BLURAY_TITLE * const *)titles; + bd->disc_info.num_titles = index->num_titles; - for (ii = 0; ii < bd->index->num_titles; ii++) { - if (bd->index->titles[ii].object_type == indx_object_type_hdmv) { + /* count titles and fill title info */ + + for (ii = 0; ii < index->num_titles; ii++) { + if (index->titles[ii].object_type == indx_object_type_hdmv) { bd->disc_info.num_hdmv_titles++; + titles[ii + 1]->interactive = (index->titles[ii].hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[ii + 1]->id_ref = index->titles[ii].hdmv.id_ref; } - if (bd->index->titles[ii].object_type == indx_object_type_bdj) { + if (index->titles[ii].object_type == indx_object_type_bdj) { bd->disc_info.num_bdj_titles++; - bd->disc_info.num_unsupported_titles++; bd->disc_info.bdj_detected = 1; + titles[ii + 1]->bdj = 1; + titles[ii + 1]->interactive = (index->titles[ii].bdj.playback_type == indx_bdj_playback_type_interactive); + titles[ii + 1]->id_ref = atoi(index->titles[ii].bdj.name); } + + titles[ii + 1]->accessible = !(index->titles[ii].access_type & INDX_ACCESS_PROHIBITED_MASK); + titles[ii + 1]->hidden = !!(index->titles[ii].access_type & INDX_ACCESS_HIDDEN_MASK); } - if (bd->index->first_play.object_type == indx_object_type_bdj) { + pi = &index->first_play; + if (pi->object_type == indx_object_type_bdj) { bd->disc_info.bdj_detected = 1; + titles[index->num_titles + 1]->bdj = 1; + titles[index->num_titles + 1]->interactive = (pi->bdj.playback_type == indx_bdj_playback_type_interactive); + titles[index->num_titles + 1]->id_ref = atoi(pi->bdj.name); } - if (bd->index->top_menu.object_type == indx_object_type_bdj) { + if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { + titles[index->num_titles + 1]->interactive = (pi->hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[index->num_titles + 1]->id_ref = pi->hdmv.id_ref; + } + + pi = &index->top_menu; + if (pi->object_type == indx_object_type_bdj) { bd->disc_info.bdj_detected = 1; + titles[0]->bdj = 1; + titles[0]->interactive = (pi->bdj.playback_type == indx_bdj_playback_type_interactive); + titles[0]->id_ref = atoi(pi->bdj.name); + } + if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { + titles[0]->interactive = (pi->hdmv.playback_type == indx_hdmv_playback_type_interactive); + titles[0]->id_ref = pi->hdmv.id_ref; } - /* BD-J capability */ + /* check for BD-J capability */ #ifdef USING_BDJAVA if (bd->disc_info.bdj_detected) { bd->disc_info.bdj_supported = 1; /* BD-J titles found. Check if jvm + jar can be loaded ? */ - switch (bdj_jvm_available()) { + switch (bdj_jvm_available(&bd->bdjstorage)) { case 2: bd->disc_info.bdj_handled = 1; case 1: bd->disc_info.libjvm_detected = 1; default:; @@ -987,15 +1046,52 @@ } #endif /* USING_BDJAVA */ - pi = &bd->index->first_play; + /* mark supported titles */ + + if (bd->disc_info.bdj_detected && !bd->disc_info.bdj_handled) { + bd->disc_info.num_unsupported_titles = bd->disc_info.num_bdj_titles; + } + + pi = &index->first_play; if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { bd->disc_info.first_play_supported = 1; } + if (pi->object_type == indx_object_type_bdj) { + bd->disc_info.first_play_supported = bd->disc_info.bdj_handled; + } - pi = &bd->index->top_menu; + pi = &index->top_menu; if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref != 0xffff) { bd->disc_info.top_menu_supported = 1; } + if (pi->object_type == indx_object_type_bdj) { + bd->disc_info.top_menu_supported = bd->disc_info.bdj_handled; + } + + /* */ + + if (bd->disc_info.first_play_supported) { + titles[index->num_titles + 1]->accessible = 1; + bd->disc_info.first_play = titles[index->num_titles + 1]; + } + if (bd->disc_info.top_menu_supported) { + titles[0]->accessible = 1; + bd->disc_info.top_menu = titles[0]; + } + + /* populate title names */ + bd_get_meta(bd); + + indx_free(&index); + } + + if (bd->disc_info.bdj_detected) { + BDID_DATA *bdid = bdid_get(bd->disc); /* parse id.bdmv */ + if (bdid) { + memcpy(bd->disc_info.bdj_org_id, bdid->org_id, sizeof(bd->disc_info.bdj_org_id)); + memcpy(bd->disc_info.bdj_disc_id, bdid->disc_id, sizeof(bd->disc_info.bdj_disc_id)); + bdid_free(&bdid); + } } } @@ -1004,6 +1100,13 @@ */ #ifdef USING_BDJAVA +const uint8_t *bd_get_aacs_data(BLURAY *bd, int type) +{ + return disc_get_data(bd->disc, type); +} +#endif + +#ifdef USING_BDJAVA uint64_t bd_get_uo_mask(BLURAY *bd) { /* internal function. Used by BD-J. */ @@ -1013,7 +1116,7 @@ } mask = {0}; //bd_mutex_lock(&bd->mutex); - memcpy(&mask.mask, &bd->st0.uo_mask, sizeof(BD_UO_MASK)); + memcpy(&mask.mask, &bd->uo_mask, sizeof(BD_UO_MASK)); //bd_mutex_unlock(&bd->mutex); return mask.u64; @@ -1021,6 +1124,69 @@ #endif #ifdef USING_BDJAVA +void bd_set_bdj_kit(BLURAY *bd, int mask) +{ + _queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, mask); +} +#endif + +#ifdef USING_BDJAVA +void bd_select_rate(BLURAY *bd, float rate, int reason) +{ + if (reason == BDJ_PLAYBACK_STOP) { + /* playback stop. Might want to wait for buffers empty here. */ + return; + } + + if (reason == BDJ_PLAYBACK_START) { + /* playback is triggered by bd_select_rate() */ + bd->bdj_wait_start = 0; + } + + if (rate < 0.5) { + _queue_event(bd, BD_EVENT_STILL, 1); + } else { + _queue_event(bd, BD_EVENT_STILL, 0); + } +} +#endif + +#ifdef USING_BDJAVA +int bd_set_virtual_package(BLURAY *bd, const char *vp_path, int psr_init_backup) +{ + bd_mutex_lock(&bd->mutex); + + if (bd->title) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_set_virtual_package() failed: playlist is playing\n"); + return -1; + } + if (bd->title_type != title_bdj) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_set_virtual_package() failed: HDMV title\n"); + return -1; + } + + if (psr_init_backup) { + bd_psr_reset_backup_registers(bd->regs); + } + + disc_update(bd->disc, vp_path); + + /* TODO: reload all cached information, update disc info, notify app */ + + bd_mutex_unlock(&bd->mutex); + + return 0; +} +#endif + +#ifdef USING_BDJAVA +BD_DISC *bd_get_disc(BLURAY *bd) +{ + return bd ? bd->disc : NULL; +} +#endif + +#ifdef USING_BDJAVA uint32_t bd_reg_read(BLURAY *bd, int psr, int reg) { if (psr) { @@ -1032,14 +1198,14 @@ #endif #ifdef USING_BDJAVA -int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value) +int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value, uint32_t psr_value_mask) { if (psr) { if (psr < 102) { /* avoid deadlocks (psr_write triggers callbacks that may lock this mutex) */ bd_mutex_lock(&bd->mutex); } - int res = bd_psr_write(bd->regs, reg, value); + int res = bd_psr_write_bits(bd->regs, reg, value, psr_value_mask); if (psr < 102) { bd_mutex_unlock(&bd->mutex); } @@ -1051,15 +1217,26 @@ #endif #ifdef USING_BDJAVA +BD_ARGB_BUFFER *bd_lock_osd_buffer(BLURAY *bd) +{ + bd_mutex_lock(&bd->argb_buffer_mutex); + return bd->argb_buffer; +} + +void bd_unlock_osd_buffer(BLURAY *bd) +{ + bd_mutex_unlock(&bd->argb_buffer_mutex); +} + /* * handle graphics updates from BD-J layer */ -static void _bdj_osd_cb(BLURAY *bd, const unsigned *img, int w, int h, - int x0, int y0, int x1, int y1) +void bd_bdj_osd_cb(BLURAY *bd, const unsigned *img, int w, int h, + int x0, int y0, int x1, int y1) { BD_ARGB_OVERLAY aov; - if (!bd || !bd->argb_overlay_proc) { + if (!bd->argb_overlay_proc) { _queue_event(bd, BD_EVENT_MENU, 0); return; } @@ -1131,13 +1308,16 @@ { #ifdef USING_BDJAVA if (bd->bdjava == NULL) { - bd->bdjava = bdj_open(bd->device_path, bd, bd->index, _bdj_osd_cb, bd->argb_buffer); + const char *root = disc_root(bd->disc); + bd->bdjava = bdj_open(root, bd, bd->disc_info.bdj_disc_id, &bd->bdjstorage); if (!bd->bdjava) { return 0; } } - return bdj_start(bd->bdjava, title); + + return !bdj_process_event(bd->bdjava, BDJ_EVENT_START, title); #else + (void)bd; BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Title %d: BD-J not compiled in\n", title); return 0; #endif @@ -1152,14 +1332,16 @@ return -1; } #else -#define _bdj_event(bd, ev, param) (bd=bd, -1) +#define _bdj_event(bd, ev, param) do{}while(0) #endif #ifdef USING_BDJAVA static void _stop_bdj(BLURAY *bd) { if (bd->bdjava != NULL) { - bdj_stop(bd->bdjava); + bdj_process_event(bd->bdjava, BDJ_EVENT_STOP, 0); + _queue_event(bd, BD_EVENT_STILL, 0); + _queue_event(bd, BD_EVENT_KEY_INTEREST_TABLE, 0); } } #else @@ -1178,110 +1360,111 @@ #define _close_bdj(bd) do{}while(0) #endif -#ifdef HAVE_MNTENT_H -/* - * Replace device node (/dev/sr0) by mount point - * Implemented on Linux and MacOSX - */ -static void get_mount_point(BLURAY *bd) +#ifdef USING_BDJAVA +static void _storage_free(BLURAY *bd) { - struct stat st; - if (stat (bd->device_path, &st) ) - return; - - /* If it's a directory, all is good */ - if (S_ISDIR(st.st_mode)) - return; - - FILE *f = setmntent ("/proc/self/mounts", "r"); - if (!f) - return; - - struct mntent* m; -#ifdef HAVE_GETMNTENT_R - struct mntent mbuf; - char buf [8192]; - while ((m = getmntent_r (f, &mbuf, buf, sizeof(buf))) != NULL) { -#else - while ((m = getmntent (f)) != NULL) { -#endif - if (!strcmp (m->mnt_fsname, bd->device_path)) { - free(bd->device_path); - bd->device_path = str_dup (m->mnt_dir); - break; - } - } - endmntent (f); + X_FREE(bd->bdjstorage.cache_root); + X_FREE(bd->bdjstorage.persistent_root); + X_FREE(bd->bdjstorage.classpath); } +#else +#define _storage_free(bd) do{}while(0) #endif -#ifdef __APPLE__ -static void get_mount_point(BLURAY *bd) -{ - struct stat st; - if (stat (bd->device_path, &st) ) - return; - /* If it's a directory, all is good */ - if (S_ISDIR(st.st_mode)) - return; +/* + * open / close + */ - struct statfs mbuf[128]; - int fs_count; +BLURAY *bd_init(void) +{ + BD_DEBUG(DBG_BLURAY, "libbluray version "BLURAY_VERSION_STRING"\n"); - if ( (fs_count = getfsstat (NULL, 0, MNT_NOWAIT)) == -1 ) { - return; - } + BLURAY *bd = calloc(1, sizeof(BLURAY)); - getfsstat (mbuf, fs_count * sizeof(mbuf[0]), MNT_NOWAIT); + if (!bd) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't allocate memory\n"); + return NULL; + } - for ( int i = 0; i < fs_count; ++i) { - if (!strcmp (mbuf[i].f_mntfromname, bd->device_path)) { - free(bd->device_path); - bd->device_path = str_dup (mbuf[i].f_mntonname); - } + bd->regs = bd_registers_init(); + if (!bd->regs) { + BD_DEBUG(DBG_BLURAY, "bd_registers_init() failed\n"); + X_FREE(bd); + return NULL; } -} + + bd_mutex_init(&bd->mutex); +#ifdef USING_BDJAVA + bd_mutex_init(&bd->argb_buffer_mutex); #endif -/* - * open / close - */ + BD_DEBUG(DBG_BLURAY, "BLURAY initialized!\n"); + + return bd; +} -BLURAY *bd_open(const char* device_path, const char* keyfile_path) +static int _bd_open(BLURAY *bd, + const char *device_path, const char *keyfile_path, + void *read_blocks_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)) { - BD_DEBUG(DBG_BLURAY, "libbluray version "BLURAY_VERSION_STRING"\n"); + BD_ENC_INFO enc_info; - if (!device_path) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No device path provided!\n"); - return NULL; + if (!bd) { + return 0; + } + if (bd->disc) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Disc already open\n"); + return 0; } - BLURAY *bd = calloc(1, sizeof(BLURAY)); + bd->disc = disc_open(device_path, read_blocks_handle, read_blocks, + &enc_info, keyfile_path, + (void*)bd->regs, (void*)bd_psr_read, (void*)bd_psr_write); - if (!bd) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't allocate memory\n"); - return NULL; + if (!bd->disc) { + return 0; } - bd->device_path = str_dup(device_path); + _fill_disc_info(bd, &enc_info); -#if (defined HAVE_MNTENT_H || defined __APPLE__) - get_mount_point(bd); -#endif + return bd->disc_info.bluray_detected; +} - _libaacs_init(bd, keyfile_path); +int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path) +{ + if (!device_path) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No device path provided!\n"); + return 0; + } - bd->regs = bd_registers_init(); + return _bd_open(bd, device_path, keyfile_path, NULL, NULL); +} - _libbdplus_init(bd); +int bd_open_stream(BLURAY *bd, + void *read_blocks_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)) +{ + if (!read_blocks) { + return 0; + } - _index_open(bd); + return _bd_open(bd, NULL, NULL, read_blocks_handle, read_blocks); +} - _fill_disc_info(bd); +BLURAY *bd_open(const char *device_path, const char *keyfile_path) +{ + BLURAY *bd; - bd_mutex_init(&bd->mutex); + bd = bd_init(); + if (!bd) { + return NULL; + } - BD_DEBUG(DBG_BLURAY, "BLURAY initialized!\n"); + if (!bd_open_disc(bd, device_path, keyfile_path)) { + bd_close(bd); + return NULL; + } return bd; } @@ -1290,14 +1473,10 @@ { _close_bdj(bd); - libaacs_unload(&bd->libaacs); - _close_m2ts(&bd->st0); _close_preload(&bd->st_ig); _close_preload(&bd->st_textst); - libbdplus_unload(&bd->libbdplus); - if (bd->title_list != NULL) { nav_free_title_list(bd->title_list); } @@ -1308,15 +1487,20 @@ hdmv_vm_free(&bd->hdmv_vm); gc_free(&bd->graphics_controller); - indx_free(&bd->index); meta_free(&bd->meta); sound_free(&bd->sound_effects); bd_registers_free(bd->regs); _free_event_queue(bd); - X_FREE(bd->device_path); + array_free((void**)&bd->titles); + _storage_free(bd); + + disc_close(&bd->disc); bd_mutex_destroy(&bd->mutex); +#ifdef USING_BDJAVA + bd_mutex_destroy(&bd->argb_buffer_mutex); +#endif BD_DEBUG(DBG_BLURAY, "BLURAY destroyed!\n"); @@ -1338,6 +1522,7 @@ if (pos > bd->s_pos) { bd->next_mark = ii; bd->next_mark_pos = pos; + _update_chapter_psr(bd); return; } } @@ -1390,8 +1575,6 @@ } BD_DEBUG(DBG_BLURAY, "Seek to %"PRIu64"\n", bd->s_pos); - - libbdplus_seek(bd->st0.bdplus, bd->st0.clip_block_pos); } } @@ -1413,6 +1596,11 @@ uint32_t clip_pkt, out_pkt; NAV_CLIP *clip; + if (tick >> 33) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_time(%"PRIu64") failed: invalid timestamp\n", tick); + return bd->s_pos; + } + tick /= 2; bd_mutex_lock(&bd->mutex); @@ -1423,9 +1611,12 @@ _change_angle(bd); // Find the closest access unit to the requested position - clip = nav_time_search(bd->title, tick, &clip_pkt, &out_pkt); + clip = nav_time_search(bd->title, (uint32_t)tick, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_time(%u) failed\n", (unsigned int)tick); } bd_mutex_unlock(&bd->mutex); @@ -1438,12 +1629,16 @@ uint32_t clip_pkt = 0, out_pkt = 0, out_time = 0; NAV_CLIP *clip; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd && bd->title) { + if (bd->title) { clip = nav_packet_search(bd->title, SPN(bd->s_pos), &clip_pkt, &out_pkt, &out_time); if (clip) { - out_time += clip->start_time; + out_time += clip->title_time; } } @@ -1468,6 +1663,9 @@ clip = nav_chapter_search(bd->title, chapter, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_chapter(%u) failed\n", chapter); } bd_mutex_unlock(&bd->mutex); @@ -1524,9 +1722,12 @@ clip = &bd->title->clip_list.clip[clip_ref]; clip_pkt = clip->start_pkt; - out_pkt = clip->pos; + out_pkt = clip->title_pkt; _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_playitem(%u) failed\n", clip_ref); } bd_mutex_unlock(&bd->mutex); @@ -1550,6 +1751,9 @@ clip = nav_mark_search(bd->title, mark, &clip_pkt, &out_pkt); _seek_internal(bd, clip, out_pkt, clip_pkt); + + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_mark(%u) failed\n", mark); } bd_mutex_unlock(&bd->mutex); @@ -1586,9 +1790,13 @@ { uint64_t ret = 0; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd && bd->title) { + if (bd->title) { ret = (uint64_t)bd->title->packets * 192; } @@ -1601,11 +1809,13 @@ { uint64_t ret = 0; + if (!bd) { + return 0; + } + bd_mutex_lock(&bd->mutex); - if (bd) { - ret = bd->s_pos; - } + ret = bd->s_pos; bd_mutex_unlock(&bd->mutex); @@ -1653,7 +1863,7 @@ if (!_open_m2ts(bd, st)) { return -1; } - bd->s_pos = st->clip->pos; + bd->s_pos = (uint64_t)st->clip->title_pkt * 192L; } else { _change_angle(bd); _clip_seek_time(bd, bd->angle_change_time); @@ -1662,10 +1872,9 @@ } else { uint64_t angle_pos; - angle_pos = bd->angle_change_pkt * 192; - if (angle_pos - st->clip_pos < size) - { - size = angle_pos - st->clip_pos; + angle_pos = (uint64_t)bd->angle_change_pkt * 192L; + if (angle_pos - st->clip_pos < size) { + size = (unsigned int)(angle_pos - st->clip_pos); } } } @@ -1673,7 +1882,7 @@ // We previously reached the last clip. Nothing // else to read. _queue_event(bd, BD_EVENT_END_OF_TITLE, 0); - bd->bdj_end_of_playlist |= 1; + bd->end_of_playlist |= 1; return 0; } if (st->int_buf_off == 6144 || clip_pkt >= st->clip->end_pkt) { @@ -1705,7 +1914,7 @@ if (st->clip == NULL) { BD_DEBUG(DBG_BLURAY | DBG_STREAM, "End of title\n"); _queue_event(bd, BD_EVENT_END_OF_TITLE, 0); - bd->bdj_end_of_playlist |= 1; + bd->end_of_playlist |= 1; return 0; } if (!_open_m2ts(bd, st)) { @@ -1855,6 +2064,11 @@ gc_run(bd->graphics_controller, GC_CTRL_PG_RESET, 0, NULL); bd->st_textst.clip = &bd->title->sub_path[textst_subpath].clip_list.clip[textst_subclip]; + if (!bd->st0.clip->cl) { + /* required for fonts */ + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_preload_textst_subpath(): missing clip data\n"); + return -1; + } if (!_preload_m2ts(bd, &bd->st_textst)) { _close_preload(&bd->st_textst); @@ -1864,10 +2078,14 @@ gc_decode_ts(bd->graphics_controller, 0x1800, 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); + gc_add_font(bd->graphics_controller, NULL, -1); for (ii = 0; ii < bd->st_textst.clip->cl->font_info.font_count; ii++) { - char *file = str_printf("%s/BDMV/AUXDATA/%s.otf", bd->device_path, bd->st_textst.clip->cl->font_info.font[ii].file_id); - gc_add_font(bd->graphics_controller, file); + char *file = str_printf("%s.otf", bd->st_textst.clip->cl->font_info.font[ii].file_id); + 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_run(bd->graphics_controller, GC_CTRL_PG_CHARCODE, char_code, NULL); @@ -1884,7 +2102,8 @@ static int _find_ig_stream(BLURAY *bd, uint16_t *pid, int *sub_path_idx, unsigned *sub_clip_idx) { - MPLS_PI *pi = &bd->title->pl->play_item[0]; + unsigned main_clip_idx = bd->st0.clip ? bd->st0.clip->ref : 0; + MPLS_PI *pi = &bd->title->pl->play_item[main_clip_idx]; unsigned ig_stream = bd_psr_read(bd->regs, PSR_IG_STREAM_ID); if (ig_stream > 0 && ig_stream <= pi->stn.num_ig) { @@ -1994,6 +2213,23 @@ gc_run(bd->graphics_controller, GC_CTRL_RESET, 0, NULL); } + /* stopping playback in middle of playlist ? */ + if (bd->title && bd->st0.clip) { + if (bd->st0.clip->ref < bd->title->clip_list.count - 1) { + /* not last clip of playlist */ + BD_DEBUG(DBG_BLURAY, "close playlist (not last clip)\n"); + _queue_event(bd, BD_EVENT_PLAYLIST_STOP, 0); + } else { + /* last clip of playlist */ + int clip_pkt = SPN(bd->st0.clip_pos); + int skip = bd->st0.clip->end_pkt - clip_pkt; + BD_DEBUG(DBG_BLURAY, "close playlist (last clip), packets skipped %d\n", skip); + if (skip > 100) { + _queue_event(bd, BD_EVENT_PLAYLIST_STOP, 0); + } + } + } + _close_m2ts(&bd->st0); _close_preload(&bd->st_ig); _close_preload(&bd->st_textst); @@ -2002,13 +2238,18 @@ nav_title_close(bd->title); bd->title = NULL; } + + /* reset UO mask */ + memset(&bd->st0.uo_mask, 0, sizeof(BD_UO_MASK)); + memset(&bd->gc_uo_mask, 0, sizeof(BD_UO_MASK)); + _update_uo_mask(bd); } static int _open_playlist(BLURAY *bd, const char *f_name, unsigned angle) { _close_playlist(bd); - bd->title = nav_title_open(bd->device_path, f_name, angle); + bd->title = nav_title_open(bd->disc, f_name, angle); if (bd->title == NULL) { BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s!\n", f_name); return 0; @@ -2016,11 +2257,17 @@ bd->seamless_angle_change = 0; bd->s_pos = 0; - bd->bdj_end_of_playlist = 0; + bd->end_of_playlist = 0; + bd->st0.ig_pid = 0; bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name)); bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1); - bd_psr_write(bd->regs, PSR_CHAPTER, 1); + + if (_is_interactive_title(bd)) { + bd_psr_write(bd->regs, PSR_CHAPTER, 0xffff); + } else { + bd_psr_write(bd->regs, PSR_CHAPTER, 1); + } // Get the initial clip of the playlist bd->st0.clip = nav_next_clip(bd->title, NULL); @@ -2062,6 +2309,73 @@ return result; } +#ifdef USING_BDJAVA +int bd_bdj_seek(BLURAY *bd, int playitem, int playmark, int64_t time) +{ + bd_mutex_lock(&bd->mutex); + + if (playitem > 0) { + bd_seek_playitem(bd, playitem); + } + if (playmark >= 0) { + bd_seek_mark(bd, playmark); + } + if (time >= 0) { + bd_seek_time(bd, time); + } + + bd_mutex_unlock(&bd->mutex); + + return 1; +} + +static int _play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time) +{ + if (playlist < 0) { + _close_playlist(bd); + return 1; + } + + if (!bd_select_playlist(bd, playlist)) { + return 0; + } + +#ifdef USING_BDJAVA + bd->bdj_wait_start = 1; /* playback is triggered by bd_select_rate() */ +#endif + + bd_bdj_seek(bd, playitem, playmark, time); + + return 1; +} + +int bd_play_playlist_at(BLURAY *bd, int playlist, int playitem, int playmark, int64_t time) +{ + int result; + + /* select + seek should be atomic (= player can't read data between select and seek to start position) */ + bd_mutex_lock(&bd->mutex); + result = _play_playlist_at(bd, playlist, playitem, playmark, time); + bd_mutex_unlock(&bd->mutex); + + return result; +} + +int bd_bdj_sound_effect(BLURAY *bd, int id) +{ + if (bd->sound_effects && id >= bd->sound_effects->num_sounds) { + return -1; + } + if (id < 0 || id > 0xff) { + return -1; + } + + _queue_event(bd, BD_EVENT_SOUND_EFFECT, id); + return 0; +} + +#endif /* USING_BDJAVA */ + // Select a title for playback // The title index is an index into the list // established by bd_get_titles() @@ -2176,17 +2490,14 @@ if (bd->title_list != NULL) { nav_free_title_list(bd->title_list); } - bd->title_list = nav_get_title_list(bd->device_path, flags, min_title_length); + bd->title_list = nav_get_title_list(bd->disc, flags, min_title_length); if (!bd->title_list) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "nav_get_title_list(%s) failed\n", bd->device_path); + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "nav_get_title_list(%s) failed\n", disc_root(bd->disc)); return 0; } - /* start BD+. No real title info will be passed to BD+ VM ... */ - if (bd->libbdplus) { - libbdplus_event(bd->libbdplus, 0xffffffff, bd->index->num_titles, 0); - } + disc_event(bd->disc, DISC_EVENT_START, bd->disc_info.num_titles); return bd->title_list->count; } @@ -2247,11 +2558,11 @@ title_info->marks = calloc(title_info->mark_count, sizeof(BLURAY_TITLE_MARK)); for (ii = 0; ii < title_info->mark_count; ii++) { title_info->marks[ii].idx = ii; - title_info->marks[ii].type = title->mark_list.mark[ii].mark_type; + title_info->marks[ii].type = title->mark_list.mark[ii].mark_type; title_info->marks[ii].start = (uint64_t)title->mark_list.mark[ii].title_time * 2; title_info->marks[ii].duration = (uint64_t)title->mark_list.mark[ii].duration * 2; title_info->marks[ii].offset = (uint64_t)title->mark_list.mark[ii].title_pkt * 192L; - title_info->marks[ii].clip_ref = title->mark_list.mark[ii].clip_ref; + title_info->marks[ii].clip_ref = title->mark_list.mark[ii].clip_ref; } title_info->clip_count = title->clip_list.count; title_info->clips = calloc(title_info->clip_count, sizeof(BLURAY_CLIP_INFO)); @@ -2261,7 +2572,7 @@ NAV_CLIP *nc = &title->clip_list.clip[ii]; ci->pkt_count = nc->end_pkt - nc->start_pkt; - ci->start_time = (uint64_t)nc->start_time * 2; + ci->start_time = (uint64_t)nc->title_time * 2; ci->in_time = (uint64_t)pi->in_time * 2; ci->out_time = (uint64_t)pi->out_time * 2; ci->still_mode = pi->still_mode; @@ -2295,7 +2606,7 @@ NAV_TITLE *title; BLURAY_TITLE_INFO *title_info; - title = nav_title_open(bd->device_path, mpls_name, angle); + title = nav_title_open(bd->disc, mpls_name, angle); if (title == NULL) { BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Unable to open title %s!\n", mpls_name); return NULL; @@ -2381,12 +2692,11 @@ if (idx == BLURAY_PLAYER_SETTING_DECODE_PG) { bd_mutex_lock(&bd->mutex); - bd->decode_pg = !!value; - bd_psr_lock(bd->regs); - value = (bd_psr_read(bd->regs, PSR_PG_STREAM) & (0x7fffffff)) | ((!!value)<<31); - result = !bd_psr_setting_write(bd->regs, PSR_PG_STREAM, value); - bd_psr_unlock(bd->regs); + bd->decode_pg = !!value; + result = bd_psr_write_bits(bd->regs, PSR_PG_STREAM, + (!!value) << 31, + 0x80000000); bd_mutex_unlock(&bd->mutex); return result; @@ -2415,6 +2725,27 @@ case BLURAY_PLAYER_SETTING_COUNTRY_CODE: return bd_set_player_setting(bd, idx, str_to_uint32(s, 2)); +#ifdef USING_BDJAVA + case BLURAY_PLAYER_CACHE_ROOT: + case BLURAY_PLAYER_PERSISTENT_ROOT: + switch (idx) { + case BLURAY_PLAYER_CACHE_ROOT: + bd_mutex_lock(&bd->mutex); + X_FREE(bd->bdjstorage.cache_root); + bd->bdjstorage.cache_root = str_dup(s); + bd_mutex_unlock(&bd->mutex); + BD_DEBUG(DBG_BDJ, "Cache root dir set to %s\n", bd->bdjstorage.cache_root); + return 1; + + case BLURAY_PLAYER_PERSISTENT_ROOT: + bd_mutex_lock(&bd->mutex); + X_FREE(bd->bdjstorage.persistent_root); + bd->bdjstorage.persistent_root = str_dup(s); + bd_mutex_unlock(&bd->mutex); + BD_DEBUG(DBG_BDJ, "Persistent root dir set to %s\n", bd->bdjstorage.persistent_root); + return 1; + } +#endif /* USING_BDJAVA */ default: return 0; } @@ -2422,15 +2753,13 @@ void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag) { - uint32_t val; - bd_mutex_lock(&bd->mutex); - bd_psr_lock(bd->regs); switch (stream_type) { case BLURAY_PG_TEXTST_STREAM: - val = bd_psr_read(bd->regs, PSR_PG_STREAM); - bd_psr_write(bd->regs, PSR_PG_STREAM, ((!!enable_flag)<<31) | (stream_id & 0xfff) | (val & 0x7ffff000)); + bd_psr_write_bits(bd->regs, PSR_PG_STREAM, + ((!!enable_flag)<<31) | (stream_id & 0xfff), + 0x80000fff); break; /* case BLURAY_SECONDARY_VIDEO_STREAM: @@ -2438,7 +2767,6 @@ */ } - bd_psr_unlock(bd->regs); bd_mutex_unlock(&bd->mutex); } @@ -2448,35 +2776,35 @@ int bd_start_bdj(BLURAY *bd, const char *start_object) { + const BLURAY_TITLE *t; + unsigned int title_num = atoi(start_object); unsigned ii; - if (!bd || !bd->index) { + if (!bd) { return 0; } /* first play object ? */ - if (bd->index->first_play.object_type == indx_object_type_bdj && - !strcmp(start_object, bd->index->first_play.bdj.name)) { - return _start_bdj(bd, BLURAY_TITLE_FIRST_PLAY); - } - - /* top menu ? */ - if (bd->index->first_play.object_type == indx_object_type_bdj && - !strcmp(start_object, bd->index->top_menu.bdj.name)) { - return _start_bdj(bd, BLURAY_TITLE_TOP_MENU); + if (bd->disc_info.first_play_supported) { + t = bd->disc_info.first_play; + if (t && t->bdj && t->id_ref == title_num) { + return _start_bdj(bd, BLURAY_TITLE_FIRST_PLAY); + } } /* valid BD-J title from disc index ? */ - for (ii = 0; ii < bd->index->num_titles; ii++) { - INDX_TITLE *t = &bd->index->titles[ii]; - - if (t->object_type == indx_object_type_bdj && - !strcmp(start_object, t->bdj.name)) { - return _start_bdj(bd, ii + 1); + if (bd->disc_info.titles) { + for (ii = 0; ii <= bd->disc_info.num_titles; ii++) { + t = bd->disc_info.titles[ii]; + if (t && t->bdj && t->id_ref == title_num) { + return _start_bdj(bd, ii); + } } + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No %s.bdjo in disc index\n", start_object); + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No disc index\n"); } - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No %s.bdjo in disc index\n", start_object); return 0; } @@ -2554,9 +2882,9 @@ break; case PSR_TITLE_NUMBER: _queue_event(bd, BD_EVENT_TITLE, ev->new_val); - libbdplus_event(bd->libbdplus, 0x110, ev->new_val, 0); break; case PSR_PLAYLIST: + _bdj_event (bd, BDJ_EVENT_PLAYLIST,ev->new_val); _queue_event(bd, BD_EVENT_PLAYLIST, ev->new_val); break; case PSR_PLAYITEM: @@ -2575,7 +2903,7 @@ _bdj_event (bd, BDJ_EVENT_PSR102, ev->new_val); break; case 103: - libbdplus_event(bd->libbdplus, 0x210, ev->new_val, 0); + disc_event(bd->disc, DISC_EVENT_APPLICATION, ev->new_val); break; default:; @@ -2590,6 +2918,12 @@ switch (ev->psr_idx) { + /* current playback position */ + + case PSR_TITLE_NUMBER: + disc_event(bd->disc, DISC_EVENT_TITLE, ev->new_val); + break; + /* stream selection */ case PSR_IG_STREAM_ID: @@ -2597,6 +2931,7 @@ break; case PSR_PRIMARY_AUDIO_ID: + _bdj_event(bd, BDJ_EVENT_AUDIO_STREAM, ev->new_val); _queue_event(bd, BD_EVENT_AUDIO_STREAM, ev->new_val); break; @@ -2608,10 +2943,12 @@ } bd_mutex_lock(&bd->mutex); - _init_pg_stream(bd); - if (bd->st_textst.clip) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Changing TextST stream\n"); - _preload_textst_subpath(bd); + if (bd->st0.clip) { + _init_pg_stream(bd); + if (bd->st_textst.clip) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Changing TextST stream\n"); + _preload_textst_subpath(bd); + } } bd_mutex_unlock(&bd->mutex); @@ -2629,6 +2966,7 @@ _queue_event(bd, BD_EVENT_SECONDARY_AUDIO, !!(ev->new_val & 0x40000000)); _queue_event(bd, BD_EVENT_SECONDARY_AUDIO_STREAM, ev->new_val & 0xff); } + _bdj_event(bd, BDJ_EVENT_SECONDARY_STREAM, ev->new_val); break; /* 3D status */ @@ -2690,17 +3028,13 @@ static int _play_bdj(BLURAY *bd, unsigned title) { - if (!bd->disc_info.bdj_handled) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't play BD-J title %d\n", title); - return 0; - } - int result; bd->title_type = title_bdj; result = _start_bdj(bd, title); if (result <= 0) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Can't play BD-J title %d\n", title); bd->title_type = title_undef; _queue_event(bd, BD_EVENT_ERROR, BD_ERROR_BDJ); } @@ -2717,7 +3051,8 @@ bd->title_type = title_hdmv; if (!bd->hdmv_vm) { - bd->hdmv_vm = hdmv_vm_init(bd->device_path, bd->regs, bd->index); + bd->hdmv_vm = hdmv_vm_init(bd->disc, bd->regs, bd->disc_info.num_titles, + bd->disc_info.first_play_supported, bd->disc_info.top_menu_supported); } if (hdmv_vm_select_object(bd->hdmv_vm, id_ref)) { @@ -2736,26 +3071,28 @@ static int _play_title(BLURAY *bd, unsigned title) { + if (!bd->disc_info.titles) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_play_title(#%d): No disc index\n", title); + return 0; + } + /* first play object ? */ if (title == BLURAY_TITLE_FIRST_PLAY) { - INDX_PLAY_ITEM *p = &bd->index->first_play; bd_psr_write(bd->regs, PSR_TITLE_NUMBER, 0xffff); /* 5.2.3.3 */ - if (p->object_type == indx_object_type_hdmv) { - if (p->hdmv.id_ref == 0xffff) { - /* no first play title (5.2.3.3) */ - bd->title_type = title_hdmv; - return 1; - } - return _play_hdmv(bd, p->hdmv.id_ref); + if (!bd->disc_info.first_play_supported) { + /* no first play title (5.2.3.3) */ + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_play_title(): No first play title\n"); + bd->title_type = title_hdmv; + return 1; } - if (p->object_type == indx_object_type_bdj) { + if (bd->disc_info.first_play->bdj) { return _play_bdj(bd, title); + } else { + return _play_hdmv(bd, bd->disc_info.first_play->id_ref); } - - return 0; } /* bd_play not called ? */ @@ -2766,37 +3103,36 @@ /* top menu ? */ if (title == BLURAY_TITLE_TOP_MENU) { - INDX_PLAY_ITEM *p = &bd->index->top_menu; bd_psr_write(bd->regs, PSR_TITLE_NUMBER, 0); /* 5.2.3.3 */ - if (p->object_type == indx_object_type_hdmv) { - if (p->hdmv.id_ref == 0xffff) { - /* no top menu (5.2.3.3) */ - bd->title_type = title_hdmv; - return 0; - } - return _play_hdmv(bd, p->hdmv.id_ref); + 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 (p->object_type == indx_object_type_bdj) { + 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->index->num_titles) { - INDX_TITLE *t = &bd->index->titles[title-1]; + if (title > 0 && title <= bd->disc_info.num_titles) { bd_psr_write(bd->regs, PSR_TITLE_NUMBER, title); /* 5.2.3.3 */ - - if (t->object_type == indx_object_type_hdmv) { - return _play_hdmv(bd, t->hdmv.id_ref); - } else { + if (bd->disc_info.titles[title]->bdj) { return _play_bdj(bd, title); + } else { + return _play_hdmv(bd, bd->disc_info.titles[title]->id_ref); } + } else { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "_play_title(#%d): Title not found\n", title); } return 0; @@ -2828,15 +3164,16 @@ hdmv_vm_free(&bd->hdmv_vm); } - _init_event_queue(bd); + if (!bd->event_queue) { + _init_event_queue(bd); - bd_psr_lock(bd->regs); - bd_psr_register_cb(bd->regs, _process_psr_event, bd); - _queue_initial_psr_events(bd); - bd_psr_unlock(bd->regs); + bd_psr_lock(bd->regs); + bd_psr_register_cb(bd->regs, _process_psr_event, bd); + _queue_initial_psr_events(bd); + bd_psr_unlock(bd->regs); + } - /* start BD+ VM */ - libbdplus_start(bd->libbdplus); + disc_event(bd->disc, DISC_EVENT_START, 0); /* start playback from FIRST PLAY title */ @@ -2854,27 +3191,12 @@ return 0; } - if (bd->st0.uo_mask.title_search) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by stream\n"); + if (bd->uo_mask.title_search) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked\n"); + _bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_TITLE_SEARCH_INDEX); return 0; } - if (bd->title_type == title_hdmv) { - if (hdmv_vm_get_uo_mask(bd->hdmv_vm) & HDMV_TITLE_SEARCH_MASK) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by movie object\n"); - return 0; - } - } - -#ifdef USING_BDJAVA - if (bd->title_type == title_bdj) { - if (bdj_get_uo_mask(bd->bdjava) & BDJ_TITLE_SEARCH_MASK) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "title search masked by BD-J\n"); - return 0; - } - } -#endif - return _play_title(bd, title); } @@ -2898,31 +3220,18 @@ return 0; } - if (bd->st0.uo_mask.menu_call) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by stream\n"); + if (bd->uo_mask.menu_call) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked\n"); + _bdj_event(bd, BDJ_EVENT_UO_MASKED, UO_MASK_MENU_CALL_INDEX); return 0; } if (bd->title_type == title_hdmv) { - if (hdmv_vm_get_uo_mask(bd->hdmv_vm) & HDMV_MENU_CALL_MASK) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by movie object\n"); - return 0; - } - if (hdmv_vm_suspend_pl(bd->hdmv_vm) < 0) { BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_menu_call(): error storing playback location\n"); } } -#ifdef USING_BDJAVA - if (bd->title_type == title_bdj) { - if (bdj_get_uo_mask(bd->bdjava) & BDJ_MENU_CALL_MASK) { - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "menu call masked by BD-J\n"); - return 0; - } - } -#endif - return _play_title(bd, BLURAY_TITLE_TOP_MENU); } @@ -3018,6 +3327,9 @@ /* update VM state */ bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm); + /* update UO mask */ + _update_hdmv_uo_mask(bd); + return 0; } @@ -3030,6 +3342,7 @@ /* run HDMV VM ? */ if (bd->title_type == title_hdmv) { + int loops = 0; while (!bd->hdmv_suspended) { if (_run_hdmv(bd) < 0) { @@ -3037,6 +3350,16 @@ bd->title_type = title_undef; return -1; } + if (loops++ > 100) { + /* Detect infinite loops. + * Broken disc may cause infinite loop between graphics controller and HDMV VM. + * This happens ex. with "Butterfly on a Wheel": + * Triggering unmasked "Menu Call" UO in language selection menu skips + * menu system initialization code, resulting in infinite loop in root menu. + */ + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_read_ext(): detected possible HDMV mode live lock (%d loops)\n", loops); + _queue_event(bd, BD_EVENT_ERROR, BD_ERROR_HDMV); + } if (_get_event(bd, event)) { return 0; } @@ -3052,16 +3375,26 @@ return 0; } - if (bd->bdj_end_of_playlist == 1) { - _bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, 0); - bd->bdj_end_of_playlist |= 2; - } +#ifdef USING_BDJAVA + if (bd->title_type == title_bdj) { + if (bd->end_of_playlist == 1) { + _bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, bd_psr_read(bd->regs, PSR_PLAYLIST)); + bd->end_of_playlist |= 2; + } - if (!bd->title && bd->title_type == title_bdj) { - /* BD-J title running but no playlist playing */ - _queue_event(bd, BD_EVENT_IDLE, 0); - return 0; + if (!bd->title) { + /* BD-J title running but no playlist playing */ + _queue_event(bd, BD_EVENT_IDLE, 0); + return 0; + } + + if (bd->bdj_wait_start) { + /* BD-J playlist prefethed but not yet playing */ + _queue_event(bd, BD_EVENT_IDLE, 1); + return 0; + } } +#endif int bytes = _bd_read(bd, buf, len); @@ -3150,8 +3483,10 @@ if (bd->title_type == title_hdmv) { result = _run_gc(bd, GC_CTRL_VK_KEY, key); +#ifdef USING_BDJAVA } else if (bd->title_type == title_bdj) { result = _bdj_event(bd, BDJ_EVENT_VK_KEY, key); +#endif } bd_mutex_unlock(&bd->mutex); @@ -3178,26 +3513,24 @@ void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, BD_ARGB_BUFFER *buf) { +#ifdef USING_BDJAVA if (!bd) { return; } - bd_mutex_lock(&bd->mutex); - - if (bd->argb_overlay_proc && bd->title_type == title_bdj) { - /* function can't be changed when BD-J is running */ - bd_mutex_unlock(&bd->mutex); - BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_register_argb_overlay_proc(): ARGB handler already registered and BD-J running !\n"); - return; - } - - _close_bdj(bd); + bd_mutex_lock(&bd->argb_buffer_mutex); bd->argb_overlay_proc = func; bd->argb_overlay_proc_handle = handle; bd->argb_buffer = buf; - bd_mutex_unlock(&bd->mutex); + bd_mutex_unlock(&bd->argb_buffer_mutex); +#else + (void)bd; + (void)handle; + (void)func; + (void)buf; +#endif } int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, BLURAY_SOUND_EFFECT *effect) @@ -3208,10 +3541,7 @@ if (!bd->sound_effects) { - char *file = str_printf("%s/BDMV/AUXDATA/sound.bdmv", bd->device_path); - bd->sound_effects = sound_parse(file); - X_FREE(file); - + bd->sound_effects = sound_get(bd->disc); if (!bd->sound_effects) { return -1; } @@ -3236,6 +3566,8 @@ const struct meta_dl *bd_get_meta(BLURAY *bd) { + const struct meta_dl *meta = NULL; + if (!bd) { return NULL; } @@ -3248,11 +3580,22 @@ if (psr_menu_lang != 0 && psr_menu_lang != 0xffffff) { const char language_code[] = {(psr_menu_lang >> 16) & 0xff, (psr_menu_lang >> 8) & 0xff, psr_menu_lang & 0xff, 0 }; - return meta_get(bd->meta, language_code); + meta = meta_get(bd->meta, language_code); + } else { + meta = meta_get(bd->meta, NULL); } - else { - return meta_get(bd->meta, NULL); + + /* assign title names to disc_info */ + if (meta && bd->titles) { + unsigned ii; + for (ii = 0; ii < meta->toc_count; ii++) { + if (meta->toc_entries[ii].title_number > 0 && meta->toc_entries[ii].title_number <= bd->disc_info.num_titles) { + bd->titles[meta->toc_entries[ii].title_number]->name = meta->toc_entries[ii].title_name; + } + } } + + return meta; } struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref) @@ -3273,3 +3616,42 @@ { clpi_free(cl); } + +struct mpls_pl *bd_read_mpls(const char *mpls_file) +{ + return mpls_parse(mpls_file); +} + +void bd_free_mpls(struct mpls_pl *pl) +{ + mpls_free(pl); +} + +struct mobj_objects *bd_read_mobj(const char *mobj_file) +{ + return mobj_parse(mobj_file); +} + +void bd_free_mobj(struct mobj_objects *obj) +{ + mobj_free(&obj); +} + +struct bdjo_data *bd_read_bdjo(const char *bdjo_file) +{ +#ifdef USING_BDJAVA + return bdjo_parse(bdjo_file); +#else + (void)bdjo_file; + return NULL; +#endif +} + +void bd_free_bdjo(struct bdjo_data *obj) +{ +#ifdef USING_BDJAVA + bdjo_free(&obj); +#else + (void)obj; +#endif +} diff -Nru libbluray-0.5.0/src/libbluray/bluray.h libbluray-0.8.1/src/libbluray/bluray.h --- libbluray-0.5.0/src/libbluray/bluray.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bluray.h 2015-05-15 09:25:06.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 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,6 +43,88 @@ typedef struct bluray BLURAY; +/* + * Disc info + */ + +/* AACS error codes */ +#define BD_AACS_CORRUPTED_DISC -1 +#define BD_AACS_NO_CONFIG -2 +#define BD_AACS_NO_PK -3 +#define BD_AACS_NO_CERT -4 +#define BD_AACS_CERT_REVOKED -5 +#define BD_AACS_MMC_FAILED -6 + +/* HDMV / BD-J title */ +typedef struct { + const char *name; /* optional title name in preferred language */ + uint8_t interactive; /* 1 if title is interactive (title length and playback position should not be shown in UI) */ + uint8_t accessible; /* 1 if it is allowed to jump into this title */ + uint8_t hidden; /* 1 if title number should not be shown during playback */ + + uint8_t bdj; /* 0 - HDMV title. 1 - BD-J title */ + uint32_t id_ref; /* Movie Object number / bdjo file number */ +} BLURAY_TITLE; + +typedef struct { + uint8_t bluray_detected; + + uint8_t first_play_supported; + uint8_t top_menu_supported; + + uint32_t num_hdmv_titles; + uint32_t num_bdj_titles; + uint32_t num_unsupported_titles; + + uint8_t aacs_detected; + uint8_t libaacs_detected; + uint8_t aacs_handled; + + uint8_t bdplus_detected; + uint8_t libbdplus_detected; + uint8_t bdplus_handled; + + /* aacs error code */ + int aacs_error_code; + /* aacs MKB version */ + int aacs_mkbv; + + /* Disc ID */ + uint8_t disc_id[20]; + + uint8_t bdj_detected; /* 1 if disc uses BD-J */ + uint8_t bdj_supported; /* 1 if BD-J support was compiled in */ + uint8_t libjvm_detected; /* 1 if usable Java VM was found */ + uint8_t bdj_handled; /* 1 if usable Java VM + libbluray.jar was found */ + + /* BD+ content code generation */ + uint8_t bdplus_gen; + /* BD+ content code relese date */ + uint32_t bdplus_date; /* (year << 16) | (month << 8) | day */ + + /* disc application info */ + uint8_t video_format; /* bd_video_format_e */ + uint8_t frame_rate; /* bd_frame_rate_e */ + uint8_t content_exist_3D; + uint8_t initial_output_mode_preference; /* 0 - 2D, 1 - 3D */ + uint8_t provider_data[32]; + + /* HDMV / BD-J titles */ + uint32_t num_titles; + const BLURAY_TITLE *const *titles; /* index is title number 1 ... N */ + const BLURAY_TITLE *first_play; /* titles[N+1]. NULL if not present on the disc. */ + const BLURAY_TITLE *top_menu; /* titles[0]. NULL if not present on the disc. */ + + char bdj_org_id[9]; /* (BD-J) disc organization ID */ + char bdj_disc_id[33]; /* (BD-J) disc ID */ + + const char *udf_volume_id; /* optional UDF volume identifier */ +} BLURAY_DISC_INFO; + +/* + * Playlist info + */ + typedef enum { BLURAY_STREAM_TYPE_VIDEO_MPEG1 = 0x01, BLURAY_STREAM_TYPE_VIDEO_MPEG2 = 0x02, @@ -186,19 +268,107 @@ BLURAY_TITLE_MARK *marks; } BLURAY_TITLE_INFO; +/* + * Sound effect data + */ + typedef struct bd_sound_effect { uint8_t num_channels; /* 1 - mono, 2 - stereo */ uint32_t num_frames; const int16_t *samples; /* 48000 Hz, 16 bit LPCM. interleaved if stereo */ } BLURAY_SOUND_EFFECT; + /** * Get library version * */ void bd_get_version(int *major, int *minor, int *micro); +/* + * Disc functions + */ + +/** + * Open BluRay disc + * + * Shortcut for bd_open_disc(bd_init(), device_path, keyfile_path) + * + * @param device_path path to mounted Blu-ray disc, device or image file + * @param keyfile_path path to KEYDB.cfg (may be NULL) + * @return allocated BLURAY object, NULL if error + */ +BLURAY *bd_open(const char *device_path, const char *keyfile_path); + +/** + * Initialize BLURAY object + * + * Resulting object can be passed to following bd_open_??? functions. + * + * @return allocated BLURAY object, NULL if error + */ +BLURAY *bd_init(void); + +/** + * Open BluRay disc + * + * @param bd BLURAY object + * @param device_path path to mounted Blu-ray disc, device or image file + * @param keyfile_path path to KEYDB.cfg (may be NULL) + * @return 1 on success, 0 if error + */ +int bd_open_disc(BLURAY *bd, const char *device_path, const char *keyfile_path); + +/** + * Open BluRay disc + * + * @param bd BLURAY object + * @param handle opaque handle for read_blocks + * @param read_blocks function used to read disc blocks + * @return 1 on success, 0 if error + */ +int bd_open_stream(BLURAY *bd, + void *read_blocks_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)); + /** + * Close BluRay disc + * + * @param bd BLURAY object + */ +void bd_close(BLURAY *bd); + +/** + * + * Get information about current BluRay disc + * + * @param bd BLURAY object + * @return pointer to BLURAY_DISC_INFO object, NULL on error + */ +const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd); + +/** + * + * Get meta information about current BluRay disc. + * + * Meta information is optional in BluRay discs. + * If information is provided in multiple languages, currently + * selected language (BLURAY_PLAYER_SETTING_MENU_LANG) is used. + * + * @param bd BLURAY object + * @return META_DL (disclib) object, NULL on error + */ +struct meta_dl; +const struct meta_dl *bd_get_meta(BLURAY *bd); + + +/* + * Title selection without on-disc menus + */ + +/** + * + * Get number of titles (playlists) * * This must be called after bd_open() and before bd_select_title(). * Populates the title list in BLURAY. @@ -234,17 +404,6 @@ /** * - * Get information about a playlist - * - * @param bd BLURAY object - * @param playlist playlist number - * @param angle angle number (chapter offsets and clip size depend on selected angle) - * @return allocated BLURAY_TITLE_INFO object, NULL on error - */ -BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle); - -/** - * * Free BLURAY_TITLE_INFO object * * @param title_info BLURAY_TITLE_INFO object @@ -252,39 +411,33 @@ void bd_free_title_info(BLURAY_TITLE_INFO *title_info); /** - * Initializes libbluray objects * - * @param device_path path to mounted Blu-ray disc or device - * @param keyfile_path path to KEYDB.cfg (may be NULL) - * @return allocated BLURAY object, NULL if error - */ -BLURAY *bd_open(const char* device_path, const char* keyfile_path); - -/** - * Free libbluray objects + * Select the title from the list created by bd_get_titles() * * @param bd BLURAY object + * @param title title to select + * @return 1 on success, 0 if error */ -void bd_close(BLURAY *bd); +int bd_select_title(BLURAY *bd, uint32_t title); /** - * Seek to pos in currently selected title + * + * Select a playlist * * @param bd BLURAY object - * @param pos position to seek to - * @return current seek position + * @param playlist playlist to select + * @return 1 on success, 0 if error */ -int64_t bd_seek(BLURAY *bd, uint64_t pos); +int bd_select_playlist(BLURAY *bd, uint32_t playlist); /** * - * Seek to specific time in 90Khz ticks + * Returns the current title index * - * @param bd BLURAY ojbect - * @param tick tick count - * @return current seek position + * @param bd BLURAY object + * @return current title index */ -int64_t bd_seek_time(BLURAY *bd, uint64_t tick); +uint32_t bd_get_current_title(BLURAY *bd); /** * @@ -297,43 +450,39 @@ */ int bd_read(BLURAY *bd, unsigned char *buf, int len); -/** - * - * Continue reading after still mode clip - * - * @param bd BLURAY object - * @return 0 on error + +/* + * Playback control functions */ -int bd_read_skip_still(BLURAY *bd); /** - * - * Seek to a chapter. First chapter is 0 + * Seek to pos in currently selected title * * @param bd BLURAY object - * @param chapter chapter to seek to + * @param pos position to seek to * @return current seek position */ -int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter); +int64_t bd_seek(BLURAY *bd, uint64_t pos); /** * - * Find the byte position of a chapter + * Seek to specific time in 90Khz ticks * - * @param bd BLURAY object - * @param chapter chapter to find position of - * @return seek position of chapter start + * @param bd BLURAY ojbect + * @param tick tick count + * @return current seek position */ -int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter); +int64_t bd_seek_time(BLURAY *bd, uint64_t tick); /** * - * Get the current chapter + * Seek to a chapter. First chapter is 0 * * @param bd BLURAY object - * @return current chapter + * @param chapter chapter to seek to + * @return current seek position */ -uint32_t bd_get_current_chapter(BLURAY *bd); +int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter); /** * @@ -357,62 +506,74 @@ /** * - * Select a playlist + * Set the angle to play * * @param bd BLURAY object - * @param playlist playlist to select + * @param angle angle to play * @return 1 on success, 0 if error */ -int bd_select_playlist(BLURAY *bd, uint32_t playlist); +int bd_select_angle(BLURAY *bd, unsigned angle); /** * - * Select the title from the list created by bd_get_titles() + * Initiate seamless angle change * * @param bd BLURAY object - * @param title title to select - * @return 1 on success, 0 if error + * @param angle angle to change to */ -int bd_select_title(BLURAY *bd, uint32_t title); +void bd_seamless_angle_change(BLURAY *bd, unsigned angle); /** * - * Set the angle to play + * Select stream (PG / TextST track) + * + * This function can be used to override automatic stream selection. + * Selecting the stream is useful only when using libbluray internal decoders + * or stream is stored in a sub-path. * * @param bd BLURAY object - * @param angle angle to play - * @return 1 on success, 0 if error + * @param stream_type BLURAY_*_STREAM + * @param stream_id stream number (1..N) + * @param enable_flag set to 0 to disable streams of this type + */ +#define BLURAY_PG_TEXTST_STREAM 1 + +void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag); + + +/* + * Playback status functions */ -int bd_select_angle(BLURAY *bd, unsigned angle); /** * - * Initiate seamless angle change + * Find the byte position of a chapter * * @param bd BLURAY object - * @param angle angle to change to + * @param chapter chapter to find position of + * @return seek position of chapter start */ -void bd_seamless_angle_change(BLURAY *bd, unsigned angle); +int64_t bd_chapter_pos(BLURAY *bd, unsigned chapter); /** * - * Returns file size in bytes of currently selected title, 0 in no title - * selected + * Get the current chapter * * @param bd BLURAY object - * @return file size in bytes of currently selected title, 0 if no title - * selected + * @return current chapter */ -uint64_t bd_get_title_size(BLURAY *bd); +uint32_t bd_get_current_chapter(BLURAY *bd); /** * - * Returns the current title index + * Returns file size in bytes of currently selected title, 0 in no title + * selected * * @param bd BLURAY object - * @return current title index + * @return file size in bytes of currently selected title, 0 if no title + * selected */ -uint32_t bd_get_current_title(BLURAY *bd); +uint64_t bd_get_title_size(BLURAY *bd); /** * @@ -441,121 +602,46 @@ */ uint64_t bd_tell_time(BLURAY *bd); -/** - * - * Select stream (PG / TextST track) - * - * This function can be used to override automatic stream selection. - * Selecting the stream is useful only when using libbluray internal decoders - * or stream is stored in a sub-path. - * - * @param bd BLURAY object - * @param stream_type BLURAY_*_STREAM - * @param stream_id stream number (1..N) - * @param enable_flag set to 0 to disable streams of this type - */ -#define BLURAY_PG_TEXTST_STREAM 1 - -void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag); - -/* - * Disc info - */ - -/* AACS error codes */ -#define BD_AACS_CORRUPTED_DISC -1 -#define BD_AACS_NO_CONFIG -2 -#define BD_AACS_NO_PK -3 -#define BD_AACS_NO_CERT -4 -#define BD_AACS_CERT_REVOKED -5 -#define BD_AACS_MMC_FAILED -6 - -typedef struct { - uint8_t bluray_detected; - - uint8_t first_play_supported; - uint8_t top_menu_supported; - - uint32_t num_hdmv_titles; - uint32_t num_bdj_titles; - uint32_t num_unsupported_titles; - - uint8_t aacs_detected; - uint8_t libaacs_detected; - uint8_t aacs_handled; - - uint8_t bdplus_detected; - uint8_t libbdplus_detected; - uint8_t bdplus_handled; - - /* aacs error code */ - int aacs_error_code; - /* aacs MKB version */ - int aacs_mkbv; - - /* Disc ID */ - uint8_t disc_id[20]; - - uint8_t bdj_detected; /* 1 if disc uses BD-J */ - uint8_t bdj_supported; /* 1 if BD-J support was compiled in */ - uint8_t libjvm_detected; /* 1 if usable Java VM was found */ - uint8_t bdj_handled; /* 1 if usable Java VM + libbluray.jar was found */ - - /* BD+ content code generation */ - uint8_t bdplus_gen; - /* BD+ content code relese date */ - uint32_t bdplus_date; /* (year << 16) | (month << 8) | day */ -} BLURAY_DISC_INFO; - -/** - * - * Get information about current BluRay disc - * - * @param bd BLURAY object - * @return pointer to BLURAY_DISC_INFO object, NULL on error - */ -const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY*); /* * player settings */ typedef enum { - BLURAY_PLAYER_SETTING_PARENTAL = 13, /* Age for parental control (years) */ - BLURAY_PLAYER_SETTING_AUDIO_CAP = 15, /* Player capability for audio (bit mask) */ - BLURAY_PLAYER_SETTING_AUDIO_LANG = 16, /* Initial audio language: ISO 639-2 string, ex. "eng" */ - BLURAY_PLAYER_SETTING_PG_LANG = 17, /* Initial PG/SPU language: ISO 639-2 string, ex. "eng" */ - BLURAY_PLAYER_SETTING_MENU_LANG = 18, /* Initial menu language: ISO 639-2 string, ex. "eng" */ - BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19, /* Player country code: ISO 3166-1 string, ex. "de" */ - BLURAY_PLAYER_SETTING_REGION_CODE = 20, /* Player region code: 1 - region A, 2 - B, 4 - C */ - BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21, /* output mode preference: 0 - 2D, 1 - 3D */ - BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23, /* Display capability (bit mask) */ - BLURAY_PLAYER_SETTING_3D_CAP = 24, /* 3D capability (bit mask) */ - BLURAY_PLAYER_SETTING_VIDEO_CAP = 29, /* Player capability for video (bit mask) */ - BLURAY_PLAYER_SETTING_TEXT_CAP = 30, /* Player capability for text subtitle (bit mask) */ - BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31, /* Profile1: 0, Profile1+: 1, Profile2: 3, Profile3: 8 */ - - BLURAY_PLAYER_SETTING_DECODE_PG = 0x100, /* enable/disable PG (subtitle) decoder */ + BLURAY_PLAYER_SETTING_AUDIO_LANG = 16, /* Initial audio language. String (ISO 639-2/T). */ + BLURAY_PLAYER_SETTING_PG_LANG = 17, /* Initial PG/SPU language. String (ISO 639-2/T). */ + BLURAY_PLAYER_SETTING_MENU_LANG = 18, /* Initial menu language. String (ISO 639-2/T). */ + BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19, /* Player country code. String (ISO 3166-1/alpha-2). */ + BLURAY_PLAYER_SETTING_REGION_CODE = 20, /* Player region code. Integer. */ + BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21, /* Output mode preference. Integer. */ + BLURAY_PLAYER_SETTING_PARENTAL = 13, /* Age for parental control. Integer. */ + BLURAY_PLAYER_SETTING_AUDIO_CAP = 15, /* Audio capability. Bit mask. */ + BLURAY_PLAYER_SETTING_VIDEO_CAP = 29, /* Video capability. Bit mask. */ + BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23, /* Display capability. Bit mask. */ + BLURAY_PLAYER_SETTING_3D_CAP = 24, /* 3D capability. Bit mask. */ + BLURAY_PLAYER_SETTING_TEXT_CAP = 30, /* Text Subtitle capability. Bit mask. */ + BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31, /* Player profile and version. */ + + BLURAY_PLAYER_SETTING_DECODE_PG = 0x100, /* Enable/disable PG (subtitle) decoder. Integer. */ + BLURAY_PLAYER_PERSISTENT_ROOT = 400, /* Root path to the BD_J persistent storage location. String. */ + BLURAY_PLAYER_CACHE_ROOT = 401, /* Root path to the BD_J cache storage location. String. */ } bd_player_setting; /** * - * Update player setting registers + * Update player setting + * + * Bit masks and enumeration values are defined in player_settings.h. * * @param bd BLURAY object - * @param idx Player setting register - * @param value New value for player setting register + * @param idx Player setting to update + * @param value New value for player setting * @return 1 on success, 0 on error (invalid setting) */ int bd_set_player_setting(BLURAY *bd, uint32_t idx, uint32_t value); -int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s); +int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *value); -/* - * Java - */ -int bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string) -void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources /* * events @@ -606,6 +692,9 @@ * playback control */ + /* HDMV VM or JVM stopped playlist playback. Flush all buffers. */ + BD_EVENT_PLAYLIST_STOP = 31, + /* discontinuity in the stream (non-seamless connection). Reset demuxer PES buffers. */ BD_EVENT_DISCONTINUITY = 28, /* new timestamp (45 kHz) */ @@ -638,7 +727,13 @@ /* 3D */ BD_EVENT_STEREOSCOPIC_STATUS = 27, /* 0 - 2D, 1 - 3D */ - /*BD_EVENT_LAST = 30, */ + /* BD-J key interest table changed */ + BD_EVENT_KEY_INTEREST_TABLE = 32, /* bitmask, BLURAY_KIT_* */ + + /* UO mask changed */ + BD_EVENT_UO_MASK_CHANGED = 33, /* bitmask, BLURAY_UO_* */ + + /*BD_EVENT_LAST = 33, */ } bd_event_e; @@ -655,9 +750,27 @@ #define BD_ERROR_AACS 3 #define BD_ERROR_BDPLUS 4 - +/* BD_EVENT_TITLE special titles */ #define BLURAY_TITLE_FIRST_PLAY 0xffff #define BLURAY_TITLE_TOP_MENU 0 + +/* BD_EVENT_KEY_INTEREST flags */ +#define BLURAY_KIT_PLAY 0x1 +#define BLURAY_KIT_STOP 0x2 +#define BLURAY_KIT_FFW 0x4 +#define BLURAY_KIT_REW 0x8 +#define BLURAY_KIT_TRACK_NEXT 0x10 +#define BLURAY_KIT_TRACK_PREV 0x20 +#define BLURAY_KIT_PAUSE 0x40 +#define BLURAY_KIT_STILL_OFF 0x80 +#define BLURAY_KIT_SEC_AUDIO 0x100 +#define BLURAY_KIT_SEC_VIDEO 0x200 +#define BLURAY_KIT_PG_TEXTST 0x400 + +/* BD_EVENT_UO_MASK flags */ +#define BLURAY_UO_MENU_CALL 0x1 +#define BLURAY_UO_TITLE_SEARCH 0x2 + /** * * Get event from libbluray event queue. @@ -668,34 +781,70 @@ */ int bd_get_event(BLURAY *bd, BD_EVENT *event); + /* - * navigaton mode + * On-screen display */ +struct bd_overlay_s; /* defined in overlay.h */ +struct bd_argb_overlay_s; /* defined in overlay.h */ +struct bd_argb_buffer_s; /* defined in overlay.h */ +typedef void (*bd_overlay_proc_f)(void *, const struct bd_overlay_s * const); +typedef void (*bd_argb_overlay_proc_f)(void *, const struct bd_argb_overlay_s * const); + /** * - * Start playing disc in navigation mode (using on-disc menus). + * Register handler for compressed YUV overlays * - * Playback is started from "First Play" title. + * Compressed YUV overlays are used with presentation graphics (subtitles) + * and HDMV mode menus. + * This function can be used when player does not support full-screen ARGB overlays + * or player can optimize drawing of compressed overlays, color space conversion etc. + * + * Callback function is called from application thread context while bd_*() functions + * are called. + * + * Note that BD-J mode outputs only ARGB graphics. * * @param bd BLURAY object + * @param handle application-specific handle that will be passed to handler function + * @param func handler function pointer * @return 1 on success, 0 if error */ -int bd_play(BLURAY *bd); +void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func); /** * - * Read from currently playing title. + * Register handler for ARGB overlays * - * When playing disc in navigation mode this function must be used instead of bd_read(). + * ARGB overlays are used with BD-J (Java) menus. + * + * Callback function can be called at any time by a thread created by Java VM. + * No more than single call for each overlay plane are executed in paraller. * * @param bd BLURAY object - * @param buf buffer to read data into - * @param len size of data to be read - * @param event next BD_EVENT from event queue (BD_EVENT_NONE if no events) - * @return size of data read, -1 if error, 0 if event needs to be handled first, 0 if end of title was reached + * @param handle application-specific handle that will be passed to handler function + * @param func handler function pointer + * @param buf optional application-allocated frame buffer + * @return 1 on success, 0 if error */ -int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event); +void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf); + + +/* + * Playback with on-disc menus + */ + +/** + * + * Start playing disc with on-disc menus + * + * Playback is started from "First Play" title. + * + * @param bd BLURAY object + * @return 1 on success, 0 if error + */ +int bd_play(BLURAY *bd); /** * @@ -723,53 +872,55 @@ */ int bd_menu_call(BLURAY *bd, int64_t pts); -/* - * User interaction and On-screen display controller - */ - -struct bd_overlay_s; /* defined in overlay.h */ -struct bd_argb_overlay_s; /* defined in overlay.h */ -struct bd_argb_buffer_s; /* defined in overlay.h */ -typedef void (*bd_overlay_proc_f)(void *, const struct bd_overlay_s * const); -typedef void (*bd_argb_overlay_proc_f)(void *, const struct bd_argb_overlay_s * const); - - /** * - * Register YUV overlay graphics handler function. + * Read from currently playing title. * - * Only compressed YUV HDMV overlays will be passed to this function. - * This function can be used when player does not support full-screen ARGB overlays - * or player can optimize drawing of compressed overlays, color space conversion etc. + * When playing disc in navigation mode this function must be used instead of bd_read(). * - * Callback function is called from application thread context while bd_*() functions - * are called. + * @param bd BLURAY object + * @param buf buffer to read data into + * @param len size of data to be read + * @param event next BD_EVENT from event queue (BD_EVENT_NONE if no events) + * @return size of data read, -1 if error, 0 if event needs to be handled first, 0 if end of title was reached + */ +int bd_read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event); + +/** * - * Note that BD-J mode outputs only ARGB graphics. + * Continue reading after still mode clip * * @param bd BLURAY object - * @param handle application-specific handle that will be passed to handler function - * @param func handler function pointer - * @return 1 on success, 0 if error + * @return 0 on error */ -void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func); +int bd_read_skip_still(BLURAY *bd); /** * - * Register ARGB overlay graphics handler function. + * Get information about a playlist * - * BD-J graphics can be acquired only with this function. + * @param bd BLURAY object + * @param playlist playlist number + * @param angle angle number (chapter offsets and clip size depend on selected angle) + * @return allocated BLURAY_TITLE_INFO object, NULL on error + */ +BLURAY_TITLE_INFO* bd_get_playlist_info(BLURAY *bd, uint32_t playlist, unsigned angle); + +/** * - * Callback function can be called at any time by a thread created by JAVA VM. - * No more than single call for each overlay plane are executed in paraller. + * Get sound effect * * @param bd BLURAY object - * @param handle application-specific handle that will be passed to handler function - * @param func handler function pointer - * @param buf optional application-allocated frame buffer - * @return 1 on success, 0 if error + * @param effect_id sound effect id (0...N) + * @param effect sound effect data + * @return <0 when no effects, 0 when id out of range, 1 on success + */ +int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect); + + +/* + * User interaction */ -void bd_register_argb_overlay_proc(BLURAY *bd, void *handle, bd_argb_overlay_proc_f func, struct bd_argb_buffer_s *buf); /** * @@ -805,31 +956,12 @@ */ int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y); -/** - * - * Get sound effect - * - * @param bd BLURAY object - * @param effect_id sound effect id (0...N) - * @param effect sound effect data - * @return <0 when no effects, 0 when id out of range, 1 on success - */ -int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, struct bd_sound_effect *effect); /* - * - */ - -struct meta_dl; -/** - * - * Get meta information about the bluray disc. - * - * @param bd BLURAY object - * @return META_DL (disclib) object, NULL on error + * Testing and debugging */ -const struct meta_dl *bd_get_meta(BLURAY *bd); +/* access to internal information */ struct clpi_cl; /** @@ -851,8 +983,27 @@ */ void bd_free_clpi(struct clpi_cl *cl); + +struct mpls_pl; +struct mpls_pl *bd_read_mpls(const char *mpls_file); +void bd_free_mpls(struct mpls_pl *); + +struct mobj_objects; +struct mobj_objects *bd_read_mobj(const char *mobj_file); +void bd_free_mobj(struct mobj_objects *); + +struct bdjo_data; +struct bdjo_data *bd_read_bdjo(const char *bdjo_file); +void bd_free_bdjo(struct bdjo_data *); + +/* BD-J testing */ + +int bd_start_bdj(BLURAY *bd, const char* start_object); // start BD-J from the specified BD-J object (should be a 5 character string) +void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources + + #ifdef __cplusplus -}; +} #endif #endif /* BLURAY_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bluray_internal.h libbluray-0.8.1/src/libbluray/bluray_internal.h --- libbluray-0.5.0/src/libbluray/bluray_internal.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bluray_internal.h 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2012 libbluray + * Copyright (C) 2012-2014 libbluray * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,18 +20,72 @@ #if !defined(_BLURAY_INTERNAL_H_) #define _BLURAY_INTERNAL_H_ -#include - -#include "bluray.h" +#include "util/attributes.h" #include -BD_PRIVATE const uint8_t *bd_get_aacs_data(BLURAY *bd, int type); +struct bluray; +struct bd_disc; + +BD_PRIVATE const uint8_t *bd_get_aacs_data(struct bluray *bd, int type); + +/* + * VFS + */ + +BD_PRIVATE struct bd_disc *bd_get_disc(struct bluray *bd); + +BD_PRIVATE int bd_set_virtual_package(struct bluray *bd, const char *vp_path, int psr_init_backup); + +/* + * UO mask, KIT + */ + +#define BDJ_MENU_CALL_MASK 0x01 +#define BDJ_TITLE_SEARCH_MASK 0x02 + +BD_PRIVATE uint64_t bd_get_uo_mask(struct bluray *bd); +BD_PRIVATE void bd_set_bdj_uo_mask(struct bluray *bd, unsigned mask); +BD_PRIVATE void bd_set_bdj_kit(struct bluray *bd, int mask); + +/* + * title selection + */ + +BD_PRIVATE int bd_play_title_internal(struct bluray *bd, unsigned title); + +/* + * register access + */ + +BD_PRIVATE uint32_t bd_reg_read(struct bluray *bd, int psr, int reg); +BD_PRIVATE int bd_reg_write(struct bluray *bd, int psr, int reg, uint32_t value, uint32_t psr_value_mask); + +/* + * playback control + */ + +enum bd_select_rate_reason { + BDJ_RATE_SET = 0, + BDJ_PLAYBACK_START = 1, + BDJ_PLAYBACK_STOP = 2, +}; + +BD_PRIVATE int bd_play_playlist_at(struct bluray *bd, int playlist, int playitem, int playmark, int64_t time); +BD_PRIVATE void bd_select_rate(struct bluray *bd, float rate, int reason); +BD_PRIVATE int bd_bdj_seek(struct bluray *bd, int playitem, int playmark, int64_t time); +BD_PRIVATE int bd_bdj_sound_effect(struct bluray *bd, int id); + +/* + * BD-J overlay + */ + +struct bd_argb_buffer_s; -BD_PRIVATE uint64_t bd_get_uo_mask(BLURAY *bd); -BD_PRIVATE int bd_play_title_internal(BLURAY *bd, unsigned title); +BD_PRIVATE struct bd_argb_buffer_s *bd_lock_osd_buffer(struct bluray *bd); +BD_PRIVATE void bd_unlock_osd_buffer(struct bluray *bd); -BD_PRIVATE uint32_t bd_reg_read(BLURAY *bd, int psr, int reg); -BD_PRIVATE int bd_reg_write(BLURAY *bd, int psr, int reg, uint32_t value); +BD_PRIVATE void bd_bdj_osd_cb(struct bluray *bd, const unsigned *img, int w, int h, + int x0, int y0, int x1, int y1); #endif /* _BLURAY_INTERNAL_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/bluray-version.h libbluray-0.8.1/src/libbluray/bluray-version.h --- libbluray-0.5.0/src/libbluray/bluray-version.h 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/bluray-version.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * This file is part of libbluray - * Copyright (C) 2011 hpi1 - * - * 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 - * . - */ - -#ifndef BLURAY_VERSION_H_ -#define BLURAY_VERSION_H_ - -#define BLURAY_VERSION_CODE(major, minor, micro) \ - (((major) * 10000) + \ - ((minor) * 100) + \ - ((micro) * 1)) - -#define BLURAY_VERSION_MAJOR 0 -#define BLURAY_VERSION_MINOR 5 -#define BLURAY_VERSION_MICRO 0 - -#define BLURAY_VERSION_STRING "0.5.0" - -#define BLURAY_VERSION \ - BLURAY_VERSION_CODE(BLURAY_VERSION_MAJOR, BLURAY_VERSION_MINOR, BLURAY_VERSION_MICRO) - -#endif /* BLURAY_VERSION_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/graphics_controller.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/graphics_controller.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/graphics_controller.Plo 2013-12-21 08:36:31.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/graphics_controller.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/graphics_processor.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/graphics_processor.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/graphics_processor.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/graphics_processor.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/ig_decode.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/ig_decode.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/ig_decode.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/ig_decode.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/m2ts_demux.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/m2ts_demux.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/m2ts_demux.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/m2ts_demux.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/m2ts_filter.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/m2ts_filter.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/m2ts_filter.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/m2ts_filter.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/pes_buffer.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/pes_buffer.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/pes_buffer.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/pes_buffer.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/pg_decode.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/pg_decode.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/pg_decode.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/pg_decode.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/rle.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/rle.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/rle.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/rle.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/textst_decode.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/textst_decode.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/textst_decode.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/textst_decode.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/.deps/textst_render.Plo libbluray-0.8.1/src/libbluray/decoders/.deps/textst_render.Plo --- libbluray-0.5.0/src/libbluray/decoders/.deps/textst_render.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/.deps/textst_render.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_controller.c libbluray-0.8.1/src/libbluray/decoders/graphics_controller.c --- libbluray-0.5.0/src/libbluray/decoders/graphics_controller.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/graphics_controller.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,9 +17,14 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "graphics_controller.h" #include "graphics_processor.h" +#include "hdmv_pids.h" #include "ig.h" #include "overlay.h" #include "textst_render.h" @@ -33,6 +38,11 @@ #include "../register.h" #include "../keys.h" +#ifdef _WIN32 +/* mingw: PRId64 seems to expands to %d without stdio.h ... */ +#include +#endif + #include #include @@ -73,9 +83,10 @@ unsigned auto_action_triggered; BOG_DATA *bog_data; BOG_DATA *saved_bog_data; + BD_UO_MASK page_uo_mask; /* page effects */ - int effect_idx; + unsigned effect_idx; BD_IG_EFFECT_SEQUENCE *in_effects; BD_IG_EFFECT_SEQUENCE *out_effects; int64_t next_effect_time; /* 90 kHz */ @@ -367,6 +378,10 @@ X_FREE(gc->saved_bog_data); gc->saved_bog_data = calloc(page->num_bogs, sizeof(*gc->saved_bog_data)); + if (!gc->saved_bog_data) { + GC_ERROR("_save_page_state(): out of memory\n"); + return -1; + } for (ii = 0; ii < page->num_bogs; ii++) { gc->saved_bog_data[ii].enabled_button = gc->bog_data[ii].enabled_button; @@ -713,6 +728,7 @@ gc->popup_visible = 0; gc->valid_mouse_position = 0; + gc->page_uo_mask = bd_empty_uo_mask(); graphics_processor_free(&gc->igp); graphics_processor_free(&gc->pgp); @@ -774,6 +790,10 @@ GRAPHICS_CONTROLLER *gc_init(BD_REGISTERS *regs, void *handle, gc_overlay_proc_f func) { GRAPHICS_CONTROLLER *p = calloc(1, sizeof(*p)); + if (!p) { + GC_ERROR("gc_init(): out of memory\n"); + return NULL; + } p->regs = regs; @@ -820,11 +840,14 @@ return -1; } - if (pid >= 0x1400 && pid < 0x1500) { + if (IS_HDMV_PID_IG(pid)) { /* IG stream */ if (!gc->igp) { gc->igp = graphics_processor_init(); + if (!gc->igp) { + return -1; + } } bd_mutex_lock(&gc->mutex); @@ -861,10 +884,13 @@ return 1; } - else if (pid >= 0x1200 && pid < 0x1300) { + else if (IS_HDMV_PID_PG(pid)) { /* PG stream */ if (!gc->pgp) { gc->pgp = graphics_processor_init(); + if (!gc->pgp) { + return -1; + } } graphics_processor_decode_ts(gc->pgp, &gc->pgs, pid, block, num_blocks, @@ -877,10 +903,13 @@ return 1; } - else if (pid == 0x1800) { + else if (IS_HDMV_PID_TEXTST(pid)) { /* TextST stream */ if (!gc->tgp) { gc->tgp = graphics_processor_init(); + if (!gc->tgp) { + return -1; + } } graphics_processor_decode_ts(gc->tgp, &gc->tgs, pid, block, num_blocks, @@ -908,28 +937,32 @@ return -1; } -int gc_add_font(GRAPHICS_CONTROLLER *p, const char *font_file) +int gc_add_font(GRAPHICS_CONTROLLER *p, void *data, size_t size) { if (!p) { return -1; } - if (!font_file) { + if (!data) { textst_render_free(&p->textst_render); return 0; } if (!p->textst_render) { p->textst_render = textst_render_init(); + if (!p->textst_render) { + return -1; + } } - return textst_render_add_font(p->textst_render, font_file); + return textst_render_add_font(p->textst_render, data, size); } static int _render_textst_region(GRAPHICS_CONTROLLER *p, int64_t pts, BD_TEXTST_REGION_STYLE *style, TEXTST_BITMAP *bmp, BD_PG_PALETTE_ENTRY *palette) { - unsigned y, bmp_y; + unsigned bmp_y; + uint16_t y; RLE_ENC rle; rle_begin(&rle); @@ -981,9 +1014,11 @@ /* next dialog too far in future ? */ if (now < 1 || dialog[ii].start_pts >= now + 90000) { - cmds->wakeup_time = dialog[ii].start_pts / 2; GC_TRACE("_render_textst(): next event #%d in %"PRId64" seconds (pts %"PRId64")\n", ii, (dialog[ii].start_pts - now)/90000, dialog[ii].start_pts); + if (cmds) { + cmds->wakeup_time = (uint32_t)(dialog[ii].start_pts / 2); + } return 1; } @@ -1042,15 +1077,19 @@ continue; } - TEXTST_BITMAP bmp = {NULL, style->text_box.width, style->text_box.height, style->text_box.width}; - bmp.mem = malloc(bmp.width * bmp.height); - memset(bmp.mem, style->region_info.background_color, bmp.width * bmp.height); + TEXTST_BITMAP bmp = {NULL, style->text_box.width, style->text_box.height, style->text_box.width, 0}; + bmp.mem = malloc((size_t)bmp.width * bmp.height); + if (bmp.mem) { + memset(bmp.mem, style->region_info.background_color, (size_t)bmp.width * bmp.height); - textst_render(p->textst_render, &bmp, style, region); + textst_render(p->textst_render, &bmp, style, region); - _render_textst_region(p, dialog[ii].start_pts, style, &bmp, s->style->palette); + _render_textst_region(p, dialog[ii].start_pts, style, &bmp, s->style->palette); - X_FREE(bmp.mem); + X_FREE(bmp.mem); + } else { + GC_ERROR("_render_textst(): out of memory\n"); + } } /* commit changes */ @@ -1329,6 +1368,8 @@ if (s->ics->interactive_composition.ui_model == IG_UI_MODEL_POPUP && !gc->popup_visible) { + gc->page_uo_mask = bd_empty_uo_mask(); + if (gc->ig_open) { GC_TRACE("_render_page(): popup menu not visible\n"); _close_osd(gc, BD_OVERLAY_IG); @@ -1346,13 +1387,6 @@ } gc->out_effects = NULL; } - if (gc->in_effects) { - if (gc->effect_idx < gc->in_effects->num_effects) { - _render_effect(gc, &gc->in_effects->effect[gc->effect_idx]); - return 1; - } - gc->in_effects = NULL; - } page = _find_page(&s->ics->interactive_composition, page_id); if (!page) { @@ -1361,6 +1395,16 @@ return -1; } + gc->page_uo_mask = page->uo_mask_table; + + if (gc->in_effects) { + if (gc->effect_idx < gc->in_effects->num_effects) { + _render_effect(gc, &gc->in_effects->effect[gc->effect_idx]); + return 1; + } + gc->in_effects = NULL; + } + palette = _find_palette(s, page->palette_id_ref); if (!palette) { GC_ERROR("_render_page: unknown palette id %d (have %d palettes)\n", @@ -1377,7 +1421,6 @@ s->ics->video_descriptor.video_height); } - for (ii = 0; ii < page->num_bogs; ii++) { BD_IG_BOG *bog = &page->bog[ii]; unsigned valid_id = gc->bog_data[ii].enabled_button; @@ -1429,11 +1472,13 @@ /* do not trigger auto action before single-loop animations have been terminated */ if (gc->button_effect_running) { GC_TRACE(" auto-activate #%d not triggered (ANIMATING)\n", auto_activate_button->id); - } else { + } else if (cmds) { cmds->num_nav_cmds = auto_activate_button->num_nav_cmds; cmds->nav_cmds = auto_activate_button->nav_cmds; gc->auto_action_triggered = 1; + } else { + GC_ERROR("_render_page(): auto-activate ignored (missing result buffer)\n"); } } @@ -1536,9 +1581,13 @@ case BD_VK_ENTER: activated_btn_id = cur_btn_id; - cmds->num_nav_cmds = button->num_nav_cmds; - cmds->nav_cmds = button->nav_cmds; - cmds->sound_id_ref = button->activated_sound_id_ref; + if (cmds) { + cmds->num_nav_cmds = button->num_nav_cmds; + cmds->nav_cmds = button->nav_cmds; + cmds->sound_id_ref = button->activated_sound_id_ref; + } else { + GC_ERROR("_user_input(): VD_VK_ENTER action ignored (missing result buffer)\n"); + } break; default:; } @@ -1546,7 +1595,7 @@ if (new_btn_id != cur_btn_id) { BD_IG_BUTTON *new_button = _find_button_page(page, new_btn_id, NULL); - if (new_button) { + if (new_button && cmds) { cmds->sound_id_ref = new_button->selected_sound_id_ref; } } @@ -1874,6 +1923,7 @@ cmds->nav_cmds = NULL; cmds->sound_id_ref = -1; cmds->status = GC_STATUS_NONE; + cmds->page_uo_mask = bd_empty_uo_mask(); } if (!gc) { @@ -2009,6 +2059,10 @@ cmds->status |= GC_STATUS_MENU_OPEN; } } + + if (gc->ig_open) { + cmds->page_uo_mask = gc->page_uo_mask; + } } bd_mutex_unlock(&gc->mutex); diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_controller.h libbluray-0.8.1/src/libbluray/decoders/graphics_controller.h --- libbluray-0.5.0/src/libbluray/decoders/graphics_controller.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/graphics_controller.h 2015-02-18 09:08:30.000000000 +0000 @@ -20,9 +20,12 @@ #if !defined(_GRAPHICS_CONTROLLER_H_) #define _GRAPHICS_CONTROLLER_H_ -#include +#include "util/attributes.h" + +#include "libbluray/bdnav/uo_mask_table.h" #include +#include /* size_t */ /* * @@ -85,6 +88,9 @@ /* */ uint32_t wakeup_time; + + BD_UO_MASK page_uo_mask; + } GC_NAV_CMDS; /* @@ -126,6 +132,6 @@ */ BD_PRIVATE int gc_add_font(GRAPHICS_CONTROLLER *p, - const char *font_file); + void *data, size_t size); #endif // _GRAPHICS_CONTROLLER_H_ diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_processor.c libbluray-0.8.1/src/libbluray/decoders/graphics_processor.c --- libbluray-0.5.0/src/libbluray/decoders/graphics_processor.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/graphics_processor.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "graphics_processor.h" #include "ig_decode.h" @@ -109,8 +113,16 @@ unsigned new_len = p1->len + p2->len - data_pos; if (p1->size < new_len) { + uint8_t *tmp; p1->size = new_len + 1; - p1->buf = realloc(p1->buf, p1->size); + tmp = realloc(p1->buf, p1->size); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + p1->size = 0; + p1->len = 0; + return; + } + p1->buf = tmp; } memcpy(p1->buf + p1->len, p2->buf + data_pos, p2->len - data_pos); @@ -121,7 +133,7 @@ /* return 1 if segment is ready for decoding, 0 if more data is needed */ static int _join_segment_fragments(struct pes_buffer_s *p) { - uint8_t type = p->buf[0]; + uint8_t type; unsigned id_pos = 0, id_len = 3, sd_pos = 6, data_pos = 0; if (p->len < 3) { @@ -130,6 +142,7 @@ /* check segment type */ + type = p->buf[0]; if (type == PGS_OBJECT) { id_pos = 3; sd_pos = 6; @@ -192,6 +205,11 @@ (void)p; + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan window definition segment\n"); + return 0; + } + s->num_window = 0; if (pg_decode_windows(bb, &w)) { @@ -201,11 +219,18 @@ return 1; } + pg_clean_windows(&w); + return 0; } static int _decode_ods(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan object definition segment\n"); + return 0; + } + /* search for object to be updated */ if (s->object) { @@ -219,6 +244,7 @@ s->object[ii].pts = p->pts; return 1; } + pg_clean_object(&s->object[ii]); return 0; } } @@ -226,7 +252,12 @@ /* add and decode new object */ - s->object = realloc(s->object, sizeof(s->object[0]) * (s->num_object + 1)); + BD_PG_OBJECT *tmp = realloc(s->object, sizeof(s->object[0]) * (s->num_object + 1)); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + s->object = tmp; memset(&s->object[s->num_object], 0, sizeof(s->object[0])); if (pg_decode_object(bb, &s->object[s->num_object])) { @@ -235,11 +266,18 @@ return 1; } + pg_clean_object(&s->object[s->num_object]); + return 0; } static int _decode_pds(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (!s->decoding) { + BD_DEBUG(DBG_DECODE, "skipping orphan palette definition segment\n"); + return 0; + } + /* search for palette to be updated */ if (s->palette) { @@ -268,7 +306,12 @@ /* add and decode new palette */ - s->palette = realloc(s->palette, sizeof(s->palette[0]) * (s->num_palette + 1)); + BD_PG_PALETTE *tmp = realloc(s->palette, sizeof(s->palette[0]) * (s->num_palette + 1)); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + s->palette = tmp; memset(&s->palette[s->num_palette], 0, sizeof(s->palette[0])); if (pg_decode_palette(bb, &s->palette[s->num_palette])) { @@ -304,8 +347,17 @@ static int _decode_pcs(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (s->complete) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "ERROR: updating complete (non-consumed) PG composition\n"); + s->complete = 0; + } + pg_free_composition(&s->pcs); s->pcs = calloc(1, sizeof(*s->pcs)); + if (!s->pcs) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } if (!pg_decode_composition(bb, s->pcs)) { pg_free_composition(&s->pcs); @@ -317,13 +369,24 @@ _check_epoch_start(s); + s->decoding = 1; + return 1; } static int _decode_ics(PG_DISPLAY_SET *s, BITBUFFER *bb, PES_BUFFER *p) { + if (s->complete) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "ERROR: updating complete (non-consumed) IG composition\n"); + s->complete = 0; + } + ig_free_interactive(&s->ics); s->ics = calloc(1, sizeof(*s->ics)); + if (!s->ics) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } if (!ig_decode_interactive(bb, s->ics)) { ig_free_interactive(&s->ics); @@ -335,6 +398,8 @@ _check_epoch_start(s); + s->decoding = 1; + return 1; } @@ -342,7 +407,14 @@ { _free_dialogs(s); + s->complete = 0; + s->style = calloc(1, sizeof(*s->style)); + if (!s->style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + if (!textst_decode_dialog_style(bb, s->style)) { textst_free_dialog_style(&s->style); return 0; @@ -362,6 +434,12 @@ } s->dialog = calloc(s->total_dialog, sizeof(*s->dialog)); + if (!s->dialog) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + s->total_dialog = 0; + return 0; + } + BD_DEBUG(DBG_DECODE, "_decode_dialog_style(): %d dialogs in stream\n", s->total_dialog); return 1; } @@ -415,7 +493,13 @@ return _decode_ics(s, &bb, p); case PGS_END_OF_DISPLAY: + if (!s->decoding) { + /* avoid duplicate initialization / presenataton */ + BD_DEBUG(DBG_DECODE, "skipping orphan end of display segment\n"); + return 0; + } s->complete = 1; + s->decoding = 0; return 1; case TGS_DIALOG_STYLE: @@ -444,6 +528,10 @@ if (*s == NULL) { *s = calloc(1, sizeof(PG_DISPLAY_SET)); + if (!*s) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } } while (*p) { @@ -468,7 +556,7 @@ if ((*p)->len <= 2) { BD_DEBUG(DBG_DECODE, "segment too short, skipping (%d bytes)\n", (*p)->len); - pes_buffer_remove(p, *p); + pes_buffer_next(p); continue; } @@ -477,11 +565,9 @@ GP_TRACE("Decoding segment, dts %010"PRId64" pts %010"PRId64" len %d\n", (*p)->dts, (*p)->pts, (*p)->len); - (*s)->complete = 0; - _decode_segment(*s, *p); - pes_buffer_remove(p, *p); + pes_buffer_next(p); if ((*s)->complete) { return 1; @@ -525,6 +611,7 @@ int64_t stc) { unsigned ii; + int result = 0; if (pid != p->pid) { m2ts_demux_free(&p->demux); @@ -532,6 +619,9 @@ } if (!p->demux) { p->demux = m2ts_demux_init(pid); + if (!p->demux) { + return 0; + } p->pid = pid; } @@ -541,8 +631,8 @@ } if (p->queue) { - return graphics_processor_decode_pes(s, &p->queue, stc); + result = graphics_processor_decode_pes(s, &p->queue, stc); } - return 0; + return result; } diff -Nru libbluray-0.5.0/src/libbluray/decoders/graphics_processor.h libbluray-0.8.1/src/libbluray/decoders/graphics_processor.h --- libbluray-0.5.0/src/libbluray/decoders/graphics_processor.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/graphics_processor.h 2015-01-26 08:01:57.000000000 +0000 @@ -24,7 +24,7 @@ #include "ig.h" #include "textst.h" -#include +#include "util/attributes.h" #include @@ -56,6 +56,8 @@ BD_PG_COMPOSITION *pcs; BD_TEXTST_DIALOG_STYLE *style; + uint8_t decoding; /* internal flag: PCS/ICS decoded, but no end of presentation seen yet */ + } PG_DISPLAY_SET; BD_PRIVATE void pg_display_set_free(PG_DISPLAY_SET **s); diff -Nru libbluray-0.5.0/src/libbluray/decoders/hdmv_pids.h libbluray-0.8.1/src/libbluray/decoders/hdmv_pids.h --- libbluray-0.5.0/src/libbluray/decoders/hdmv_pids.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/hdmv_pids.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * 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 + * . + */ + +#if !defined(_HDMV_PIDS_H_) +#define _HDMV_PIDS_H_ + +/* + * HDMV transport stream PIDs + */ + +#define HDMV_PID_PAT 0 +#define HDMV_PID_PMT 0x0100 +#define HDMV_PID_PCR 0x1001 + +/* primary streams */ + +#define HDMV_PID_VIDEO 0x1011 +#define HDMV_PID_VIDEO_SS 0x1012 + +#define HDMV_PID_AUDIO_FIRST 0x1100 +#define HDMV_PID_AUDIO_LAST 0x111f + +/* graphics streams */ + +#define HDMV_PID_PG_FIRST 0x1200 +#define HDMV_PID_PG_LAST 0x121f + +#define HDMV_PID_IG_FIRST 0x1400 +#define HDMV_PID_IG_LAST 0x141f + +#define HDMV_PID_TEXTST 0x1800 + +/* secondary streams */ + +#define HDMV_PID_SEC_AUDIO_FIRST 0x1a00 +#define HDMV_PID_SEC_AUDIO_LAST 0x1a1f + +#define HDMV_PID_SEC_VIDEO_FIRST 0x1b00 +#define HDMV_PID_SEC_VIDEO_LAST 0x1b1f + +/* + * + */ + +#define IS_HDMV_PID_PG(pid) ((pid) >= HDMV_PID_PG_FIRST && (pid) <= HDMV_PID_PG_LAST) +#define IS_HDMV_PID_IG(pid) ((pid) >= HDMV_PID_IG_FIRST && (pid) <= HDMV_PID_IG_LAST) +#define IS_HDMV_PID_TEXTST(pid) ((pid) == HDMV_PID_TEXTST) + + +#endif // _HDMV_PIDS_H_ diff -Nru libbluray-0.5.0/src/libbluray/decoders/ig_decode.c libbluray-0.8.1/src/libbluray/decoders/ig_decode.c --- libbluray-0.5.0/src/libbluray/decoders/ig_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/ig_decode.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,10 +17,15 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "ig_decode.h" #include "pg_decode.h" // pg_decode_*() #include "../hdmv/mobj_parse.h" // mobj_parse_cmd() +#include "../hdmv/mobj_data.h" // MOBJ_CMD #include "../bdnav/mpls_parse.h" // mpls_parse_uo() #include "util/macro.h" @@ -31,7 +36,7 @@ #include -static void _decode_button(BITBUFFER *bb, BD_IG_BUTTON *p) +static int _decode_button(BITBUFFER *bb, BD_IG_BUTTON *p) { unsigned ii; @@ -66,6 +71,10 @@ p->num_nav_cmds = bb_read(bb, 16); p->nav_cmds = calloc(p->num_nav_cmds, sizeof(MOBJ_CMD)); + if (!p->nav_cmds) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_nav_cmds; ii++) { uint8_t buf[12]; @@ -73,6 +82,8 @@ mobj_parse_cmd(buf, &p->nav_cmds[ii]); } + + return 1; } static void _clean_button(BD_IG_BUTTON *p) @@ -80,7 +91,7 @@ X_FREE(p->nav_cmds); } -static void _decode_bog(BITBUFFER *bb, BD_IG_BOG *p) +static int _decode_bog(BITBUFFER *bb, BD_IG_BOG *p) { unsigned ii; @@ -88,23 +99,34 @@ p->num_buttons = bb_read(bb, 8); p->button = calloc(p->num_buttons, sizeof(BD_IG_BUTTON)); + if (!p->button) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_buttons; ii++) { - _decode_button(bb, &p->button[ii]); + if (!_decode_button(bb, &p->button[ii])) { + return 0; + } } + + return 1; } static void _clean_bog(BD_IG_BOG *p) { unsigned ii; - for (ii = 0; ii < p->num_buttons; ii++) { - _clean_button(&p->button[ii]); + if (p->button) { + for (ii = 0; ii < p->num_buttons; ii++) { + _clean_button(&p->button[ii]); + } } + X_FREE(p->button); } -static void _decode_effect(BITBUFFER *bb, BD_IG_EFFECT *p) +static int _decode_effect(BITBUFFER *bb, BD_IG_EFFECT *p) { unsigned ii; @@ -113,10 +135,16 @@ p->num_composition_objects = bb_read(bb, 8); p->composition_object = calloc(p->num_composition_objects, sizeof(BD_PG_COMPOSITION_OBJECT)); + if (!p->composition_object) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_composition_objects; ii++) { pg_decode_composition_object(bb, &p->composition_object[ii]); } + + return 1; } static void _clean_effect(BD_IG_EFFECT *p) @@ -124,12 +152,16 @@ X_FREE(p->composition_object); } -static void _decode_effect_sequence(BITBUFFER *bb, BD_IG_EFFECT_SEQUENCE *p) +static int _decode_effect_sequence(BITBUFFER *bb, BD_IG_EFFECT_SEQUENCE *p) { unsigned ii; p->num_windows = bb_read(bb, 8); p->window = calloc(p->num_windows, sizeof(BD_PG_WINDOW)); + if (!p->window) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_windows; ii++) { pg_decode_window(bb, &p->window[ii]); @@ -137,19 +169,30 @@ p->num_effects = bb_read(bb, 8); p->effect = calloc(p->num_effects, sizeof(BD_IG_EFFECT)); + if (!p->effect) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_effects; ii++) { - _decode_effect(bb, &p->effect[ii]); + if (!_decode_effect(bb, &p->effect[ii])) { + return 0; + } } + + return 1; } static void _clean_effect_sequence(BD_IG_EFFECT_SEQUENCE *p) { unsigned ii; - for (ii = 0; ii < p->num_effects; ii++) { - _clean_effect(&p->effect[ii]); + if (p->effect) { + for (ii = 0; ii < p->num_effects; ii++) { + _clean_effect(&p->effect[ii]); + } } + X_FREE(p->effect); X_FREE(p->window); @@ -164,7 +207,7 @@ return mpls_parse_uo(buf, p); } -static void _decode_page(BITBUFFER *bb, BD_IG_PAGE *p) +static int _decode_page(BITBUFFER *bb, BD_IG_PAGE *p) { unsigned ii; @@ -173,8 +216,12 @@ _decode_uo_mask_table(bb, &p->uo_mask_table); - _decode_effect_sequence(bb, &p->in_effects); - _decode_effect_sequence(bb, &p->out_effects); + if (!_decode_effect_sequence(bb, &p->in_effects)) { + return 0; + } + if (!_decode_effect_sequence(bb, &p->out_effects)) { + return 0; + } p->animation_frame_rate_code = bb_read(bb, 8); p->default_selected_button_id_ref = bb_read(bb, 16); @@ -183,10 +230,18 @@ p->num_bogs = bb_read(bb, 8); p->bog = calloc(p->num_bogs, sizeof(BD_IG_BOG)); + if (!p->bog) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_bogs; ii++) { - _decode_bog(bb, &p->bog[ii]); + if (!_decode_bog(bb, &p->bog[ii])) { + return 0; + } } + + return 1; } static void _clean_page(BD_IG_PAGE *p) @@ -196,9 +251,12 @@ _clean_effect_sequence(&p->in_effects); _clean_effect_sequence(&p->out_effects); - for (ii = 0; ii < p->num_bogs; ii++) { - _clean_bog(&p->bog[ii]); + if (p->bog) { + for (ii = 0; ii < p->num_bogs; ii++) { + _clean_bog(&p->bog[ii]); + } } + X_FREE(p->bog); } @@ -239,9 +297,15 @@ p->num_pages = bb_read(bb, 8); p->page = calloc(p->num_pages, sizeof(BD_IG_PAGE)); + if (!p->page) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_pages; ii++) { - _decode_page(bb, &p->page[ii]); + if (!_decode_page(bb, &p->page[ii])) { + return 0; + } } return 1; @@ -251,9 +315,12 @@ { unsigned ii; - for (ii = 0; ii < p->num_pages; ii++) { - _clean_page(&p->page[ii]); + if (p->page) { + for (ii = 0; ii < p->num_pages; ii++) { + _clean_page(&p->page[ii]); + } } + X_FREE(p->page); } diff -Nru libbluray-0.5.0/src/libbluray/decoders/ig_decode.h libbluray-0.8.1/src/libbluray/decoders/ig_decode.h --- libbluray-0.5.0/src/libbluray/decoders/ig_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/ig_decode.h 2015-01-26 08:01:57.000000000 +0000 @@ -22,8 +22,8 @@ #include "ig.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/ig.h libbluray-0.8.1/src/libbluray/decoders/ig.h --- libbluray-0.5.0/src/libbluray/decoders/ig.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/ig.h 2015-01-26 08:01:57.000000000 +0000 @@ -25,7 +25,7 @@ #include -struct bd_mobj_cmd_s; +struct mobj_cmd; /* * @@ -64,7 +64,7 @@ /* navigation commands */ uint16_t num_nav_cmds; - struct bd_mobj_cmd_s *nav_cmds; + struct mobj_cmd *nav_cmds; } BD_IG_BUTTON; diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.c libbluray-0.8.1/src/libbluray/decoders/m2ts_demux.c --- libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/m2ts_demux.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "m2ts_demux.h" #include "pes_buffer.h" @@ -81,7 +85,7 @@ */ static int _add_ts(PES_BUFFER *p, unsigned pusi, uint8_t *buf, unsigned len) { - int result = 0; + unsigned result = 0; if (pusi) { @@ -131,9 +135,16 @@ // realloc if (p->size < p->len + len) { + uint8_t *tmp; p->size *= 2; p->size = BD_MAX(p->size, BD_MAX(result, 0x100)); - p->buf = realloc(p->buf, p->size); + tmp = realloc(p->buf, p->size); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + p->size = 0; + return -1; + } + p->buf = tmp; } // append diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.h libbluray-0.8.1/src/libbluray/decoders/m2ts_demux.h --- libbluray-0.5.0/src/libbluray/decoders/m2ts_demux.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/m2ts_demux.h 2015-01-26 08:01:57.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_M2TS_DEMUX_H_) #define _M2TS_DEMUX_H_ -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.c libbluray-0.8.1/src/libbluray/decoders/m2ts_filter.c --- libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/m2ts_filter.c 2015-01-26 08:01:57.000000000 +0000 @@ -23,6 +23,8 @@ #include "m2ts_filter.h" +#include "hdmv_pids.h" + #include "util/logging.h" #include "util/macro.h" @@ -30,7 +32,11 @@ #include #include -#define M2TS_TRACE(...) BD_DEBUG(DBG_CRIT,__VA_ARGS__) +#ifdef _WIN32 +#include +#endif + +#define M2TS_TRACE(...) BD_DEBUG(DBG_STREAM,__VA_ARGS__) //#define M2TS_TRACE(...) do {} while(0) /* @@ -49,7 +55,8 @@ }; M2TS_FILTER *m2ts_filter_init(int64_t in_pts, int64_t out_pts, - unsigned num_video, unsigned num_audio) + unsigned num_video, unsigned num_audio, + unsigned num_ig, unsigned num_pg) { M2TS_FILTER *p = calloc(1, sizeof(*p)); @@ -59,16 +66,26 @@ p->in_pts = in_pts; p->out_pts = out_pts; - p->wipe_pid = calloc(num_audio + num_video + 1, sizeof(uint16_t)); - p->pass_pid = calloc(num_audio + num_video + 1, sizeof(uint16_t)); + p->wipe_pid = calloc(num_audio + num_video + num_ig + num_pg + 1, sizeof(uint16_t)); + p->pass_pid = calloc(num_audio + num_video + num_ig + num_pg + 1, sizeof(uint16_t)); + if (!p->pass_pid || !p->wipe_pid) { + m2ts_filter_close(&p); + return NULL; + } pid = (in_pts >= 0) ? p->wipe_pid : p->pass_pid; for (ii = 0, npid = 0; ii < num_video; ii++) { - pid[npid++] = 0x1011 + ii; + pid[npid++] = HDMV_PID_VIDEO + ii; } for (ii = 0; ii < num_audio; ii++) { - pid[npid++] = 0x1100 + ii; + pid[npid++] = HDMV_PID_AUDIO_FIRST + ii; + } + for (ii = 0; ii < num_ig; ii++) { + pid[npid++] = HDMV_PID_IG_FIRST + ii; + } + for (ii = 0; ii < num_pg; ii++) { + pid[npid++] = HDMV_PID_PG_FIRST + ii; } } @@ -214,14 +231,25 @@ } } if (p->out_pts >= 0) { - + /* + * Note: we can't compare against in_pts here (after passing it once): + * PG / IG streams can have timestamps before in_time (except for composition segments), and those are valid. + */ if (_pid_in_list(p->pass_pid, pid)) { int64_t pts = _es_timestamp(buf + 4 + payload_offset, 188 - payload_offset); - if (pts > p->out_pts) { + if (pts >= p->out_pts) { + /* + * audio/video streams are cutted after out_time (unit with pts==out_time is included in the clip). + * PG/IG streams are cutted before out_time (unit with pts==out_time is dropped out). + */ + if (pts > p->out_pts || + IS_HDMV_PID_PG(pid) || + IS_HDMV_PID_IG(pid)) { M2TS_TRACE("Pid 0x%04x passed OUT timestamp %"PRId64" (pts %"PRId64") -> start wiping\n", pid, p->out_pts, pts); _remove_pid(p->pass_pid, pid); _add_pid(p->wipe_pid, pid); + } } } } @@ -244,7 +272,7 @@ for (; buf < end; buf += 192) { uint16_t pid = ((buf[4+1] & 0x1f) << 8) | buf[4+2]; - if (!pid) { + if (pid == HDMV_PID_PAT) { p->pat_seen = 1; p->pat_packets = 0; continue; @@ -258,7 +286,8 @@ } M2TS_TRACE("NOT Wiping pid 0x%04x (inside seek buffer, PAT seen)\n", pid); } - if (pid < 0x1011) { + if (pid < HDMV_PID_VIDEO) { + /* pass PMT, PCR, SIT */ /*M2TS_TRACE("NOT Wiping pid 0x%04x (< 0x1011)\n", pid);*/ continue; } diff -Nru libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.h libbluray-0.8.1/src/libbluray/decoders/m2ts_filter.h --- libbluray-0.5.0/src/libbluray/decoders/m2ts_filter.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/m2ts_filter.h 2015-01-26 08:01:57.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_M2TS_FILTER_H_) #define _M2TS_FILTER_H_ -#include +#include "util/attributes.h" #include @@ -32,7 +32,8 @@ typedef struct m2ts_filter_s M2TS_FILTER; BD_PRIVATE M2TS_FILTER *m2ts_filter_init(int64_t in_pts, int64_t out_pts, - unsigned num_video, unsigned num_audio); + unsigned num_video, unsigned num_audio, + unsigned num_ig, unsigned num_pg); BD_PRIVATE void m2ts_filter_close(M2TS_FILTER **); /* diff -Nru libbluray-0.5.0/src/libbluray/decoders/pes_buffer.c libbluray-0.8.1/src/libbluray/decoders/pes_buffer.c --- libbluray-0.5.0/src/libbluray/decoders/pes_buffer.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/pes_buffer.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "pes_buffer.h" #include "util/macro.h" @@ -89,3 +93,13 @@ } } } + +void pes_buffer_next(PES_BUFFER **head) +{ + if (head && *head) { + PES_BUFFER *p = *head; + *head = (*head)->next; + p->next = NULL; + pes_buffer_free(&p); + } +} diff -Nru libbluray-0.5.0/src/libbluray/decoders/pes_buffer.h libbluray-0.8.1/src/libbluray/decoders/pes_buffer.h --- libbluray-0.5.0/src/libbluray/decoders/pes_buffer.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/pes_buffer.h 2015-01-26 08:01:57.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_PES_BUFFER_H_) #define _PES_BUFFER_H_ -#include +#include "util/attributes.h" #include @@ -44,4 +44,6 @@ BD_PRIVATE void pes_buffer_append(PES_BUFFER **head, PES_BUFFER *buf); // append buf to list BD_PRIVATE void pes_buffer_remove(PES_BUFFER **head, PES_BUFFER *buf); // remove buf from list and free it +BD_PRIVATE void pes_buffer_next(PES_BUFFER **head); // free first buffer and advance head to next buffer + #endif // _PES_BUFFER_H_ diff -Nru libbluray-0.5.0/src/libbluray/decoders/pg_decode.c libbluray-0.8.1/src/libbluray/decoders/pg_decode.c --- libbluray-0.5.0/src/libbluray/decoders/pg_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/pg_decode.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "pg_decode.h" #include "util/refcnt.h" @@ -117,6 +121,7 @@ static int _decode_rle(BITBUFFER *bb, BD_PG_OBJECT *p) { + BD_PG_RLE_ELEM *tmp; int pixels_left = p->width * p->height; int num_rle = 0; int rle_size = p->width * p->height / 4; @@ -124,11 +129,12 @@ if (rle_size < 1) rle_size = 1; - p->img = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); - if (!p->img) { + tmp = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); + if (!tmp) { BD_DEBUG(DBG_DECODE | DBG_CRIT, "pg_decode_object(): realloc failed\n"); return 0; } + p->img = tmp; while (!bb_eof(bb)) { uint32_t len = 1; @@ -163,14 +169,13 @@ num_rle++; if (num_rle >= rle_size) { - void *tmp = p->img; rle_size *= 2; - p->img = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); - if (!p->img) { + tmp = refcnt_realloc(p->img, rle_size * sizeof(BD_PG_RLE_ELEM)); + if (!tmp) { BD_DEBUG(DBG_DECODE | DBG_CRIT, "pg_decode_object(): realloc failed\n"); - X_FREE(tmp); return 0; } + p->img = tmp; } } @@ -233,6 +238,10 @@ p->num_composition_objects = bb_read(bb, 8); p->composition_object = calloc(p->num_composition_objects, sizeof(BD_PG_COMPOSITION_OBJECT)); + if (!p->composition_object) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_composition_objects; ii++) { pg_decode_composition_object(bb, &p->composition_object[ii]); @@ -247,6 +256,10 @@ p->num_windows = bb_read(bb, 8); p->window = calloc(p->num_windows, sizeof(BD_PG_WINDOW)); + if (!p->window) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->num_windows; ii++) { pg_decode_window(bb, &p->window[ii]); @@ -267,6 +280,13 @@ } } +void pg_clean_windows(BD_PG_WINDOWS *p) +{ + if (p) { + X_FREE(p->window); + } +} + static void pg_clean_composition(BD_PG_COMPOSITION *p) { if (p) { diff -Nru libbluray-0.5.0/src/libbluray/decoders/pg_decode.h libbluray-0.8.1/src/libbluray/decoders/pg_decode.h --- libbluray-0.5.0/src/libbluray/decoders/pg_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/pg_decode.h 2015-01-26 08:01:57.000000000 +0000 @@ -22,8 +22,8 @@ #include "pg.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" /* * elements @@ -51,6 +51,7 @@ */ BD_PRIVATE void pg_clean_object(BD_PG_OBJECT *p); +BD_PRIVATE void pg_clean_windows(BD_PG_WINDOWS *p); BD_PRIVATE void pg_free_composition(BD_PG_COMPOSITION **p); diff -Nru libbluray-0.5.0/src/libbluray/decoders/rle.c libbluray-0.8.1/src/libbluray/decoders/rle.c --- libbluray-0.5.0/src/libbluray/decoders/rle.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/rle.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "rle.h" #include "util/logging.h" diff -Nru libbluray-0.5.0/src/libbluray/decoders/rle.h libbluray-0.8.1/src/libbluray/decoders/rle.h --- libbluray-0.5.0/src/libbluray/decoders/rle.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/rle.h 2015-01-26 08:01:57.000000000 +0000 @@ -22,7 +22,7 @@ #include "overlay.h" -#include +#include "util/attributes.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_decode.c libbluray-0.8.1/src/libbluray/decoders/textst_decode.c --- libbluray-0.5.0/src/libbluray/decoders/textst_decode.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/textst_decode.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "textst_decode.h" #include "pg_decode.h" // pg_decode_*() @@ -105,7 +109,7 @@ p->line_space_delta = _decode_int8(bb); } -static void _decode_dialog_region(BITBUFFER *bb, BD_TEXTST_DIALOG_REGION *p) +static int _decode_dialog_region(BITBUFFER *bb, BD_TEXTST_DIALOG_REGION *p) { p->continous_present_flag = bb_read(bb, 1); p->forced_on_flag = bb_read(bb, 1); @@ -119,6 +123,10 @@ p->elem = malloc(bytes_allocated); p->elem_count = 0; p->line_count = 1; + if (!p->elem) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } uint8_t *ptr = (uint8_t *)p->elem; @@ -143,7 +151,12 @@ int need = bytes_used + length + sizeof(BD_TEXTST_DATA); if (bytes_allocated < need) { bytes_allocated = need * 2; - p->elem = realloc(p->elem, bytes_allocated); + BD_TEXTST_DATA *tmp = realloc(p->elem, bytes_allocated); + if (!tmp) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } + p->elem = tmp; ptr = ((uint8_t *)p->elem) + bytes_used; } @@ -186,6 +199,8 @@ ptr += sizeof(BD_TEXTST_DATA); p->elem_count++; } + + return 1; } static void _decode_palette(BITBUFFER *bb, BD_PG_PALETTE_ENTRY *p) @@ -215,6 +230,10 @@ if (p->region_style_count) { p->region_style = calloc(p->region_style_count, sizeof(BD_TEXTST_REGION_STYLE)); + if (!p->region_style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->region_style_count; ii++) { _decode_region_style(bb, &p->region_style[ii]); } @@ -222,6 +241,10 @@ if (p->user_style_count) { p->user_style = calloc(p->user_style_count, sizeof(BD_TEXTST_USER_STYLE)); + if (!p->user_style) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } for (ii = 0; ii < p->user_style_count; ii++) { _decode_user_style(bb, &p->user_style[ii]); } @@ -246,13 +269,23 @@ if (palette_update_flag) { p->palette_update = calloc(256, sizeof(BD_PG_PALETTE_ENTRY)); + if (!p->palette_update) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "out of memory\n"); + return 0; + } _decode_palette(bb, p->palette_update); } p->region_count = bb_read(bb, 8); if (p->region_count) { + if (p->region_count > 2) { + BD_DEBUG(DBG_DECODE | DBG_CRIT, "too many regions (%d)\n", p->region_count); + return 0; + } for (ii = 0; ii < p->region_count; ii++) { - _decode_dialog_region(bb, &p->region[ii]); + if (!_decode_dialog_region(bb, &p->region[ii])) { + return 0; + } } } diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_decode.h libbluray-0.8.1/src/libbluray/decoders/textst_decode.h --- libbluray-0.5.0/src/libbluray/decoders/textst_decode.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/textst_decode.h 2015-01-26 08:01:57.000000000 +0000 @@ -22,8 +22,8 @@ #include "textst.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst.h libbluray-0.8.1/src/libbluray/decoders/textst.h --- libbluray-0.5.0/src/libbluray/decoders/textst.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/textst.h 2015-03-20 10:50:38.000000000 +0000 @@ -110,7 +110,7 @@ } style; struct { uint8_t length; - uint8_t string[0]; + uint8_t string[1]; } text; } data; } BD_TEXTST_DATA; diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_render.c libbluray-0.8.1/src/libbluray/decoders/textst_render.c --- libbluray-0.5.0/src/libbluray/decoders/textst_render.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/textst_render.c 2015-04-07 19:56:47.000000000 +0000 @@ -45,17 +45,25 @@ /* * data */ +#ifdef HAVE_FT2 +typedef struct { + + FT_Face face; + void *mem; + +} FONT_DATA; struct textst_render { -#ifdef HAVE_FT2 + FT_Library ft_lib; unsigned font_count; - FT_Face *face; + FONT_DATA *font; bd_char_code_e char_code; -#endif + }; +#endif /* * init / free @@ -88,9 +96,10 @@ /* free fonts */ unsigned ii; for (ii = 0; ii < p->font_count; ii++) { - if (p->face[ii]) { - FT_Done_Face(p->face[ii]); + if (p->font[ii].face) { + FT_Done_Face(p->font[ii].face); } + X_FREE(p->font[ii].mem); } FT_Done_FreeType(p->ft_lib); @@ -104,23 +113,35 @@ * settings */ -int textst_render_add_font(TEXTST_RENDER *p, const char *file) +int textst_render_add_font(TEXTST_RENDER *p, void *data, size_t size) { #ifdef HAVE_FT2 - p->face = realloc(p->face, sizeof(*(p->face)) * (p->font_count + 1)); + FONT_DATA *tmp = realloc(p->font, sizeof(*(p->font)) * (p->font_count + 1)); + if (!tmp) { + TEXTST_ERROR("out of memory\n"); + return -1; + } + p->font = tmp; - if (FT_New_Face(p->ft_lib, file, -1, NULL)) { - TEXTST_ERROR("Unsupport font file format (%s)\n", file); + if (FT_New_Memory_Face(p->ft_lib, (const FT_Byte*)data, (FT_Long)size, -1, NULL)) { + TEXTST_ERROR("Unsupport font file format\n"); return -1; } - if (!FT_New_Face(p->ft_lib, file, 0, &p->face[p->font_count])) { + if (!FT_New_Memory_Face(p->ft_lib, (const FT_Byte*)data, (FT_Long)size, 0, &p->font[p->font_count].face)) { + p->font[p->font_count].mem = data; p->font_count++; return 0; } - TEXTST_ERROR("Loading font %s failed\n", file); + TEXTST_ERROR("Loading font %d failed\n", p->font_count); + +#else + (void)p; + (void)data; + (void)size; #endif + return -1; } @@ -132,6 +153,10 @@ TEXTST_ERROR("WARNING: unsupported TextST coding type %d\n", char_code); return -1; } + +#else + (void)p; + (void)char_code; #endif return 0; @@ -193,7 +218,8 @@ { uint8_t color = style->font_color; unsigned char_code; - int ii, jj, kk; + int ii; + unsigned jj, kk; unsigned flags; if (length <= 0) { @@ -250,13 +276,13 @@ static void _update_face(TEXTST_RENDER *p, FT_Face *face, const BD_TEXTST_REGION_STYLE *style) { - if (style->font_id_ref >= p->font_count || !p->face[style->font_id_ref]) { + if (style->font_id_ref >= p->font_count || !p->font[style->font_id_ref].face) { TEXTST_ERROR("textst_Render: incorrect font index %d\n", style->font_id_ref); if (!*face) { - *face = p->face[0]; + *face = p->font[0].face; } } else { - *face = p->face[style->font_id_ref]; + *face = p->font[style->font_id_ref].face; } FT_Set_Char_Size(*face, 0, style->font_size << 6, 0, 0); } @@ -416,6 +442,11 @@ ypos += s.line_space - baseline; } +#else + (void)p; + (void)bmp; + (void)base_style; + (void)region; #endif /* HAVE_FT2 */ return 0; diff -Nru libbluray-0.5.0/src/libbluray/decoders/textst_render.h libbluray-0.8.1/src/libbluray/decoders/textst_render.h --- libbluray-0.5.0/src/libbluray/decoders/textst_render.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/decoders/textst_render.h 2015-02-18 09:08:30.000000000 +0000 @@ -22,8 +22,8 @@ #include "textst.h" -#include -#include +#include "util/attributes.h" +#include "util/bits.h" #include @@ -52,7 +52,7 @@ * */ -BD_PRIVATE int textst_render_add_font(TEXTST_RENDER *p, const char *file); +BD_PRIVATE int textst_render_add_font(TEXTST_RENDER *p, void *data, size_t size); BD_PRIVATE int textst_render_set_char_code(TEXTST_RENDER *p, int char_code); BD_PRIVATE int textst_render(TEXTST_RENDER *p, TEXTST_BITMAP *bmp, diff -Nru libbluray-0.5.0/src/libbluray/disc/aacs.c libbluray-0.8.1/src/libbluray/disc/aacs.c --- libbluray-0.5.0/src/libbluray/disc/aacs.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/aacs.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,318 @@ +/* + * This file is part of libbluray + * Copyright (C) 2013-2015 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "aacs.h" + +#include "file/dl.h" +#include "file/file.h" +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include + + +struct bd_aacs { + void *h_libaacs; /* library handle from dlopen */ + void *aacs; /* aacs handle from aacs_open() */ + + const uint8_t *disc_id; + uint32_t mkbv; + + /* function pointers */ + fptr_int decrypt_unit; + + fptr_p_void get_vid; + fptr_p_void get_pmsn; + fptr_p_void get_device_binding_id; + fptr_p_void get_device_nonce; + fptr_p_void get_media_key; +}; + + +static void _libaacs_close(BD_AACS *p) +{ + if (p->aacs) { + DL_CALL(p->h_libaacs, aacs_close, p->aacs); + p->aacs = NULL; + } +} + +void libaacs_unload(BD_AACS **p) +{ + if (p && *p) { + _libaacs_close(*p); + + if ((*p)->h_libaacs) { + dl_dlclose((*p)->h_libaacs); + } + + X_FREE(*p); + } +} + +int libaacs_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *)) +{ + if (have_file(have_file_handle, "AACS", "Unit_Key_RO.inf")) { + BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf found. Disc seems to be AACS protected.\n"); + return 1; + } + + BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf not found. No AACS protection.\n"); + return 0; +} + +static void *_open_libaacs(void) +{ + const char * const libaacs[] = { + getenv("LIBAACS_PATH"), + "libaacs", + "libmmbd", + }; + unsigned ii; + + for (ii = 0; ii < sizeof(libaacs) / sizeof(libaacs[0]); ii++) { + if (libaacs[ii]) { + void *handle = dl_dlopen(libaacs[ii], "0"); + if (handle) { + BD_DEBUG(DBG_BLURAY, "Using %s for AACS\n", libaacs[ii]); + return handle; + } + } + } + + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No usable AACS libraries found!\n"); + return NULL; +} + +BD_AACS *libaacs_load(void) +{ + BD_AACS *p = calloc(1, sizeof(BD_AACS)); + + p->h_libaacs = _open_libaacs(); + if (!p->h_libaacs) { + X_FREE(p); + return NULL; + } + + BD_DEBUG(DBG_BLURAY, "Loading aacs library (%p)\n", p->h_libaacs); + + *(void **)(&p->decrypt_unit) = dl_dlsym(p->h_libaacs, "aacs_decrypt_unit"); + *(void **)(&p->get_vid) = dl_dlsym(p->h_libaacs, "aacs_get_vid"); + *(void **)(&p->get_pmsn) = dl_dlsym(p->h_libaacs, "aacs_get_pmsn"); + *(void **)(&p->get_device_binding_id) = dl_dlsym(p->h_libaacs, "aacs_get_device_binding_id"); + *(void **)(&p->get_device_nonce) = dl_dlsym(p->h_libaacs, "aacs_get_device_nonce"); + *(void **)(&p->get_media_key) = dl_dlsym(p->h_libaacs, "aacs_get_mk"); + + if (!p->decrypt_unit) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libaacs dlsym failed! (%p)\n", p->h_libaacs); + libaacs_unload(&p); + return NULL; + } + + BD_DEBUG(DBG_BLURAY, "Loaded libaacs (%p)\n", p->h_libaacs); + + if (file_open != file_open_default()) { + BD_DEBUG(DBG_BLURAY, "Registering libaacs filesystem handler %p (%p)\n", (void *)(intptr_t)file_open, p->h_libaacs); + DL_CALL(p->h_libaacs, aacs_register_file, file_open); + } + + return p; +} + +int libaacs_open(BD_AACS *p, const char *device, + void *file_open_handle, void *file_open_fp, + const char *keyfile_path) + +{ + int error_code = 0; + + fptr_p_void open; + fptr_p_void open2; + fptr_p_void init; + fptr_int open_device; + fptr_int aacs_get_mkb_version; + fptr_p_void aacs_get_disc_id; + + _libaacs_close(p); + + *(void **)(&open) = dl_dlsym(p->h_libaacs, "aacs_open"); + *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2"); + *(void **)(&init) = dl_dlsym(p->h_libaacs, "aacs_init"); + *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version"); + *(void **)(&aacs_get_disc_id) = dl_dlsym(p->h_libaacs, "aacs_get_disc_id"); + *(void **)(&open_device) = dl_dlsym(p->h_libaacs, "aacs_open_device"); + + if (init && open_device) { + p->aacs = init(); + DL_CALL(p->h_libaacs, aacs_set_fopen, p->aacs, file_open_handle, file_open_fp); + error_code = open_device(p->aacs, device, keyfile_path); + } else if (open2) { + BD_DEBUG(DBG_BLURAY, "Using old aacs_open2(), no UDF support available\n"); + p->aacs = open2(device, keyfile_path, &error_code); + } else if (open) { + BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n"); + p->aacs = open(device, keyfile_path); + } else { + BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n"); + } + + if (p->aacs) { + if (aacs_get_mkb_version) { + p->mkbv = aacs_get_mkb_version(p->aacs); + } + if (aacs_get_disc_id) { + p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs); + } + return error_code; + } + + return error_code ? error_code : 1; +} + +/* + * + */ + +void libaacs_select_title(BD_AACS *p, uint32_t title) +{ + if (p && p->aacs) { + DL_CALL(p->h_libaacs, aacs_select_title, p->aacs, title); + } +} + +int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf) +{ + if (p && p->aacs) { + if (!p->decrypt_unit(p->aacs, buf)) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable decrypt unit (AACS)!\n"); + + return -1; + } // decrypt + } // aacs + + return 0; +} + +/* + * + */ + +static const uint8_t *_get_vid(BD_AACS *p) +{ + if (!p->get_vid) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_vid() dlsym failed!\n"); + return NULL; + } + + return (const uint8_t*)p->get_vid(p->aacs); +} + +static const uint8_t *_get_pmsn(BD_AACS *p) +{ + if (!p->get_pmsn) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_pmsn() dlsym failed!\n"); + return NULL; + } + + return (const uint8_t*)p->get_pmsn(p->aacs); +} + +static const uint8_t *_get_device_binding_id(BD_AACS *p) +{ + if (!p->get_device_binding_id) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_device_binding_id() dlsym failed!\n"); + return NULL; + } + + return (const uint8_t*)p->get_device_binding_id(p->aacs); +} + +static const uint8_t *_get_device_nonce(BD_AACS *p) +{ + if (!p->get_device_nonce) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_device_nonce() dlsym failed!\n"); + return NULL; + } + + return (const uint8_t*)p->get_device_nonce(p->aacs); +} + +static const uint8_t *_get_media_key(BD_AACS *p) +{ + if (!p->get_media_key) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_get_mk() dlsym failed!\n"); + return NULL; + } + + return (const uint8_t*)p->get_media_key(p->aacs); +} + +uint32_t libaacs_get_mkbv(BD_AACS *p) +{ + return p ? p->mkbv : 0; +} + +static const char *_type2str(int type) +{ + switch (type) { + case BD_AACS_DISC_ID: return "DISC_ID"; + case BD_AACS_MEDIA_VID: return "MEDIA_VID"; + case BD_AACS_MEDIA_PMSN: return "MEDIA_PMSN"; + case BD_AACS_DEVICE_BINDING_ID: return "DEVICE_BINDING_ID"; + case BD_AACS_DEVICE_NONCE: return "DEVICE_NONCE"; + case BD_AACS_MEDIA_KEY: return "MEDIA_KEY"; + default: return "???"; + } +} + +BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type) +{ + if (!p || !p->aacs) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "get_aacs_data(%s): libaacs not initialized!\n", _type2str(type)); + return NULL; + } + + switch (type) { + case BD_AACS_DISC_ID: + return p->disc_id; + + case BD_AACS_MEDIA_VID: + return _get_vid(p); + + case BD_AACS_MEDIA_PMSN: + return _get_pmsn(p); + + case BD_AACS_DEVICE_BINDING_ID: + return _get_device_binding_id(p); + + case BD_AACS_DEVICE_NONCE: + return _get_device_nonce(p); + + case BD_AACS_MEDIA_KEY: + return _get_media_key(p); + } + + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "get_aacs_data(): unknown query %d\n", type); + return NULL; +} diff -Nru libbluray-0.5.0/src/libbluray/disc/aacs.h libbluray-0.8.1/src/libbluray/disc/aacs.h --- libbluray-0.5.0/src/libbluray/disc/aacs.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/aacs.h 2015-02-12 09:56:04.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * This file is part of libbluray + * Copyright (C) 2013-2015 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 + * . + */ + +#ifndef _BD_LIBAACS_H_ +#define _BD_LIBAACS_H_ + +#include "util/attributes.h" + +#include + + +typedef struct bd_aacs BD_AACS; + +BD_PRIVATE int libaacs_required(void *h, int (*have_file)(void *, const char *, const char *)); +BD_PRIVATE BD_AACS *libaacs_load(void); +BD_PRIVATE int libaacs_open(BD_AACS *p, const char *device, + void *file_open_handle, void *file_open_fp, + const char *keyfile_path); +BD_PRIVATE void libaacs_unload(BD_AACS **p); + +BD_PRIVATE void libaacs_select_title(BD_AACS *p, uint32_t title); +BD_PRIVATE int libaacs_decrypt_unit(BD_AACS *p, uint8_t *buf); + +BD_PRIVATE uint32_t libaacs_get_mkbv(BD_AACS *p); + +#define BD_AACS_DISC_ID 1 +#define BD_AACS_MEDIA_VID 2 +#define BD_AACS_MEDIA_PMSN 3 +#define BD_AACS_DEVICE_BINDING_ID 4 +#define BD_AACS_DEVICE_NONCE 5 +#define BD_AACS_MEDIA_KEY 6 + +BD_PRIVATE const uint8_t *libaacs_get_aacs_data(BD_AACS *p, int type); + + +#endif /* _BD_LIBAACS_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/disc/bdplus.c libbluray-0.8.1/src/libbluray/disc/bdplus.c --- libbluray-0.5.0/src/libbluray/disc/bdplus.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/bdplus.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,317 @@ +/* + * This file is part of libbluray + * Copyright (C) 2013-2015 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bdplus.h" + +#include "file/dl.h" +#include "file/file.h" +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include + + +struct bd_bdplus { + void *h_libbdplus; /* library handle from dlopen */ + + void *bdplus; /* bdplus handle from bdplus_open() */ + + /* functions */ + fptr_int32 event; + fptr_p_void m2ts; + fptr_int32 m2ts_close; + fptr_int32 seek; + fptr_int32 fixup; + + /* old API */ + fptr_p_void title; +}; + + +static void _libbdplus_close(BD_BDPLUS *p) +{ + if (p->bdplus) { + DL_CALL(p->h_libbdplus, bdplus_free, p->bdplus); + p->bdplus = NULL; + } +} + +void libbdplus_unload(BD_BDPLUS **p) +{ + if (p && *p) { + _libbdplus_close(*p); + + if ((*p)->h_libbdplus) { + dl_dlclose((*p)->h_libbdplus); + } + + X_FREE(*p); + } +} + +int libbdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *)) +{ + if (have_file(have_file_handle, "BDSVM", "00000.svm")) { + BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm found. Disc seems to be BD+ protected.\n"); + return 1; + } + + BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm not found. No BD+ protection.\n"); + return 0; +} + +static void *_libbdplus_open(void) +{ + const char * const libbdplus[] = { + getenv("LIBBDPLUS_PATH"), + "libbdplus", + "libmmbd", + }; + unsigned ii; + + for (ii = 0; ii < sizeof(libbdplus) / sizeof(libbdplus[0]); ii++) { + if (libbdplus[ii]) { + void *handle = dl_dlopen(libbdplus[ii], "0"); + if (handle) { + BD_DEBUG(DBG_BLURAY, "Using %s for BD+\n", libbdplus[ii]); + return handle; + } + } + } + + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "No usable BD+ libraries found!\n"); + return NULL; +} + +BD_BDPLUS *libbdplus_load(void) +{ + BD_BDPLUS *p = calloc(1, sizeof(BD_BDPLUS)); + + BD_DEBUG(DBG_BDPLUS, "attempting to load libbdplus\n"); + + p->h_libbdplus = _libbdplus_open(); + if (!p->h_libbdplus) { + X_FREE(p); + return NULL; + } + + BD_DEBUG(DBG_BLURAY, "Loading libbdplus (%p)\n", p->h_libbdplus); + + *(void **)(&p->event) = dl_dlsym(p->h_libbdplus, "bdplus_event"); + *(void **)(&p->m2ts) = dl_dlsym(p->h_libbdplus, "bdplus_m2ts"); + *(void **)(&p->seek) = dl_dlsym(p->h_libbdplus, "bdplus_seek"); + *(void **)(&p->fixup) = dl_dlsym(p->h_libbdplus, "bdplus_fixup"); + *(void **)(&p->m2ts_close) = dl_dlsym(p->h_libbdplus, "bdplus_m2ts_close"); + if (!p->m2ts) { + /* Old API */ + *(void **)(&p->title) = dl_dlsym(p->h_libbdplus, "bdplus_set_title"); + if (!p->title) { + *(void **)(&p->title) = dl_dlsym(p->h_libbdplus, "bdplus_set_m2ts"); + } + } + + if (!p->seek || !p->fixup || !((p->m2ts && p->m2ts_close) || p->title)) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libbdplus dlsym failed! (%p)\n", p->h_libbdplus); + libbdplus_unload(&p); + return NULL; + } + + BD_DEBUG(DBG_BLURAY, "Loaded libbdplus (%p)\n", p->h_libbdplus); + return p; +} + +int libbdplus_init(BD_BDPLUS *p, const char *root, + void *file_open_handle, void *file_open_fp, + const uint8_t *vid, const uint8_t *mk) +{ + fptr_p_void bdplus_init; + fptr_void set_fopen; + + _libbdplus_close(p); + + *(void **)(&bdplus_init) = dl_dlsym(p->h_libbdplus, "bdplus_init"); + *(void **)(&set_fopen) = dl_dlsym(p->h_libbdplus, "bdplus_set_fopen"); + + if (!bdplus_init) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "libbdplus dlsym(bdplus_init) failed! (%p)\n", p->h_libbdplus); + return -1; + } + + if (set_fopen) { + p->bdplus = bdplus_init(NULL, NULL, vid); + set_fopen(p->bdplus, file_open_handle, file_open_fp); + } else { + p->bdplus = bdplus_init(root, NULL, vid); + } + + if (!p->bdplus) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bdplus_init() failed! (%p)\n", p->h_libbdplus); + return -1; + } + + DL_CALL(p->h_libbdplus, bdplus_set_mk, p->bdplus, mk); + + return 0; +} + +static uint32_t _bdplus_get(BD_BDPLUS *p, const char *func) +{ + if (p && p->bdplus) { + fptr_int32 fp; + *(void **)(&fp) = dl_dlsym(p->h_libbdplus, func); + if (fp) { + return fp(p->bdplus); + } + } + return 0; +} + +int libbdplus_get_gen(BD_BDPLUS *p) +{ + return _bdplus_get(p, "bdplus_get_code_gen"); +} + +int libbdplus_get_date(BD_BDPLUS *p) +{ + return _bdplus_get(p, "bdplus_get_code_date"); +} + +void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2) +{ + if (p && p->bdplus && p->event) { + p->event(p->bdplus, event, param1, param2); + } +} + +void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem) +{ + if (p && p->bdplus) { + DL_CALL(p->h_libbdplus, bdplus_mmap, p->bdplus, region_id, mem); + } +} + +void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write) +{ + if (p && p->bdplus) { + DL_CALL(p->h_libbdplus, bdplus_psr, p->bdplus, regs, read, write); + } +} + +void libbdplus_start(BD_BDPLUS *p) +{ + if (p && p->bdplus) { + DL_CALL(p->h_libbdplus, bdplus_start, p->bdplus); + } +} + +/* + * stream layer + */ + +struct bd_bdplus_st { + BD_BDPLUS *lib; + void *st; +}; + +BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos) +{ + if (p && p->bdplus) { + + if (!p->m2ts) { + /* use old API */ + BD_BDPLUS_ST *ret = calloc(1, sizeof(BD_BDPLUS_ST)); + ret->lib = p; + ret->st = NULL; + p->title(p->bdplus, clip_id); + p->seek(p->bdplus, pos); + return ret; + } + + void *st = p->m2ts(p->bdplus, clip_id); + + if (!st) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ failed for clip %05d.m2ts\n", clip_id); + + } else if (p->seek(st, pos) < 0) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ seek failed for clip %05d.m2ts\n", clip_id); + p->m2ts_close(st); + } else { + BD_BDPLUS_ST *ret = calloc(1, sizeof(BD_BDPLUS_ST)); + ret->lib = p; + ret->st = st; + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ active for clip %05d.m2ts\n", clip_id); + return ret; + } + } + + return NULL; +} + +int libbdplus_m2ts_close(BD_BDPLUS_ST **p) +{ + int result = -1; + if (p && *p) { + if ((*p)->lib && (*p)->st) { + result = (*p)->lib->m2ts_close((*p)->st); + } + X_FREE(*p); + } + + return result; +} + +int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos) +{ + if (p) { + if (p->st) { + return p->lib->seek(p->st, pos); + } else { + /* use old API */ + return p->lib->seek(p->lib->bdplus, pos); + } + } + + return -1; +} + +int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len) +{ + if (p && !p->lib->m2ts) { + /* use old API */ + return p->lib->fixup(p->lib->bdplus, len, buf); + } + + if (p && p->st) { + int32_t numFixes; + numFixes = p->lib->fixup(p->st, len, buf); +#if 1 + if (numFixes) { + BD_DEBUG(DBG_BDPLUS, "BD+ did %d fixups\n", numFixes); + } +#endif + return numFixes; + } + + return -1; +} diff -Nru libbluray-0.5.0/src/libbluray/disc/bdplus.h libbluray-0.8.1/src/libbluray/disc/bdplus.h --- libbluray-0.5.0/src/libbluray/disc/bdplus.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/bdplus.h 2015-02-12 09:56:04.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * This file is part of libbluray + * Copyright (C) 2013-2015 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 + * . + */ + +#ifndef _BD_LIBBDPLUS_H_ +#define _BD_LIBBDPLUS_H_ + +#include "util/attributes.h" + +#include + + +typedef struct bd_bdplus BD_BDPLUS; + +BD_PRIVATE int libbdplus_required(void *have_file_handle, int (*have_file)(void *, const char *, const char *)); +BD_PRIVATE BD_BDPLUS *libbdplus_load(void); +BD_PRIVATE int libbdplus_init(BD_BDPLUS *p, const char *root, + void *open_file_handle, void *open_file_fp, + const uint8_t *vid, const uint8_t *mk); +BD_PRIVATE void libbdplus_unload(BD_BDPLUS **p); + +BD_PRIVATE int libbdplus_get_gen(BD_BDPLUS *p); +BD_PRIVATE int libbdplus_get_date(BD_BDPLUS *p); + +BD_PRIVATE void libbdplus_mmap(BD_BDPLUS *p, uint32_t region_id, void *mem); +BD_PRIVATE void libbdplus_psr(BD_BDPLUS *p, void *regs, void *read, void *write); +BD_PRIVATE void libbdplus_start(BD_BDPLUS *p); +BD_PRIVATE void libbdplus_event(BD_BDPLUS *p, uint32_t event, uint32_t param1, uint32_t param2); + +/* + * stream layer + */ + +typedef struct bd_bdplus_st BD_BDPLUS_ST; + +BD_PRIVATE BD_BDPLUS_ST *libbdplus_m2ts(BD_BDPLUS *p, uint32_t clip_id, uint64_t pos); +BD_PRIVATE int libbdplus_seek(BD_BDPLUS_ST *p, uint64_t pos); +BD_PRIVATE int libbdplus_fixup(BD_BDPLUS_ST *p, uint8_t *buf, int len); +BD_PRIVATE int libbdplus_m2ts_close(BD_BDPLUS_ST **p); + + +#endif /* _BD_BDPLUS_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/disc/dec.c libbluray-0.8.1/src/libbluray/disc/dec.c --- libbluray-0.5.0/src/libbluray/disc/dec.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/dec.c 2015-02-18 17:16:19.000000000 +0000 @@ -0,0 +1,334 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dec.h" + +#include "enc_info.h" +#include "aacs.h" +#include "bdplus.h" + +#include "file/file.h" +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include + +struct bd_dec { + int use_menus; + BD_AACS *aacs; + BD_BDPLUS *bdplus; +}; + +/* + * stream + */ + +typedef struct { + BD_FILE_H *fp; + BD_AACS *aacs; + BD_BDPLUS_ST *bdplus; +} DEC_STREAM; + +static int64_t _stream_read(BD_FILE_H *fp, uint8_t *buf, int64_t size) +{ + DEC_STREAM *st = (DEC_STREAM *)fp->internal; + int64_t result; + + if (size != 6144) { + BD_DEBUG(DBG_CRIT, "read size != unit size\n"); + return 0; + } + + result = st->fp->read(st->fp, buf, size); + if (result <= 0) { + return result; + } + + if (st->aacs) { + if (libaacs_decrypt_unit(st->aacs, buf)) { + /* failure is detected from TP header */ + } + } + + if (st->bdplus) { + if (libbdplus_fixup(st->bdplus, buf, (int)size) < 0) { + /* there's no way to verify if the stream was decoded correctly */ + } + } + + return result; +} + +static int64_t _stream_seek(BD_FILE_H *fp, int64_t offset, int32_t origin) +{ + DEC_STREAM *st = (DEC_STREAM *)fp->internal; + int64_t result = st->fp->seek(st->fp, offset, origin); + if (result >= 0 && st->bdplus) { + libbdplus_seek(st->bdplus, st->fp->tell(st->fp)); + } + return result; +} + +static int64_t _stream_tell(BD_FILE_H *fp) +{ + DEC_STREAM *st = (DEC_STREAM *)fp->internal; + return st->fp->tell(st->fp); +} + +static void _stream_close(BD_FILE_H *fp) +{ + DEC_STREAM *st = (DEC_STREAM *)fp->internal; + if (st->bdplus) { + libbdplus_m2ts_close(&st->bdplus); + } + st->fp->close(st->fp); + X_FREE(fp->internal); + X_FREE(fp); +} + +BD_FILE_H *dec_open_stream(BD_DEC *dec, BD_FILE_H *fp, uint32_t clip_id) +{ + DEC_STREAM *st; + BD_FILE_H *p = calloc(1, sizeof(BD_FILE_H)); + if (!p) { + return NULL; + } + + st = calloc(1, sizeof(DEC_STREAM)); + if (!st) { + X_FREE(p); + return NULL; + } + st->fp = fp; + + if (dec->bdplus) { + st->bdplus = libbdplus_m2ts(dec->bdplus, clip_id, 0); + } + + if (dec->aacs) { + st->aacs = dec->aacs; + if (!dec->use_menus) { + /* There won't be title events --> need to manually reset AACS CPS */ + libaacs_select_title(dec->aacs, 0xffff); + } + } + + p->internal = st; + p->read = _stream_read; + p->seek = _stream_seek; + p->tell = _stream_tell; + p->close = _stream_close; + + return p; +} + +/* + * + */ + +/* + * + */ + +static int _bdrom_have_file(void *p, const char *dir, const char *file) +{ + struct dec_dev *dev = (struct dec_dev *)p; + BD_FILE_H *fp; + char *path; + + path = str_printf("%s" DIR_SEP "%s", dir, file); + fp = dev->pf_file_open_bdrom(dev->file_open_bdrom_handle, path); + X_FREE(path); + + if (fp) { + file_close(fp); + return 1; + } + + return 0; +} + +static int _libaacs_init(BD_DEC *dec, struct dec_dev *dev, + BD_ENC_INFO *i, const char *keyfile_path) +{ + int result; + const uint8_t *disc_id; + + libaacs_unload(&dec->aacs); + + i->aacs_detected = libaacs_required((void*)dev, _bdrom_have_file); + if (!i->aacs_detected) { + /* no AACS */ + return 1; /* no error if libaacs is not needed */ + } + + dec->aacs = libaacs_load(); + i->libaacs_detected = !!dec->aacs; + if (!dec->aacs) { + /* no libaacs */ + return 0; + } + + result = libaacs_open(dec->aacs, dev->device, dev->file_open_vfs_handle, (void*)dev->pf_file_open_vfs, keyfile_path); + + i->aacs_error_code = result; + i->aacs_handled = !result; + i->aacs_mkbv = libaacs_get_mkbv(dec->aacs); + disc_id = libaacs_get_aacs_data(dec->aacs, BD_AACS_DISC_ID); + if (disc_id) { + memcpy(i->disc_id, disc_id, 20); + } + + if (result) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "aacs_open() failed!\n"); + libaacs_unload(&dec->aacs); + return 0; + } + + BD_DEBUG(DBG_BLURAY, "Opened libaacs\n"); + return 1; +} + +static int _libbdplus_init(BD_DEC *dec, struct dec_dev *dev, + BD_ENC_INFO *i, + void *regs, void *psr_read, void *psr_write) +{ + libbdplus_unload(&dec->bdplus); + + i->bdplus_detected = libbdplus_required((void*)dev, _bdrom_have_file); + if (!i->bdplus_detected) { + return 0; + } + + dec->bdplus = libbdplus_load(); + i->libbdplus_detected = !!dec->bdplus; + if (!dec->bdplus) { + return 0; + } + + const uint8_t *vid = libaacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_VID); + const uint8_t *mk = libaacs_get_aacs_data(dec->aacs, BD_AACS_MEDIA_KEY); + if (!vid) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "BD+ initialization failed (no AACS ?)\n"); + libbdplus_unload(&dec->bdplus); + return 0; + } + + if (libbdplus_init(dec->bdplus, dev->root, dev->file_open_bdrom_handle, (void*)dev->pf_file_open_bdrom, vid, mk)) { + BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bdplus_init() failed\n"); + + i->bdplus_handled = 0; + libbdplus_unload(&dec->bdplus); + return 0; + } + + BD_DEBUG(DBG_BLURAY, "libbdplus initialized\n"); + + /* map player memory regions */ + libbdplus_mmap(dec->bdplus, 0, regs); + libbdplus_mmap(dec->bdplus, 1, (void*)((uint8_t *)regs + sizeof(uint32_t) * 128)); + + /* connect registers */ + libbdplus_psr(dec->bdplus, regs, psr_read, psr_write); + + i->bdplus_gen = libbdplus_get_gen(dec->bdplus); + i->bdplus_date = libbdplus_get_date(dec->bdplus); + i->bdplus_handled = 1; + return 1; +} + +/* + * + */ + +BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write) +{ + BD_DEC *dec = calloc(1, sizeof(BD_DEC)); + if (dec) { + memset(enc_info, 0, sizeof(*enc_info)); + _libaacs_init(dec, dev, enc_info, keyfile_path); + _libbdplus_init(dec, dev, enc_info, regs, psr_read, psr_write); + + if (!enc_info->bdplus_handled && !enc_info->aacs_handled) { + X_FREE(dec); + } + } + return dec; +} + +void dec_close(BD_DEC **pp) +{ + if (pp && *pp) { + BD_DEC *p = *pp; + libaacs_unload(&p->aacs); + libbdplus_unload(&p->bdplus); + X_FREE(*pp); + } +} + +/* + * + */ + +const uint8_t *dec_data(BD_DEC *dec, int type) +{ + if (dec->aacs) { + return libaacs_get_aacs_data(dec->aacs, type); + } + return NULL; +} + +void dec_start(BD_DEC *dec, uint32_t num_titles) +{ + if (num_titles == 0) { + dec->use_menus = 1; + if (dec->bdplus) { + libbdplus_start(dec->bdplus); + libbdplus_event(dec->bdplus, 0x110, 0xffff, 0); + } + } else { + if (dec->bdplus) { + libbdplus_event(dec->bdplus, 0xffffffff, num_titles, 0); + } + } +} + +void dec_title(BD_DEC *dec, uint32_t title) +{ + if (dec->aacs) { + libaacs_select_title(dec->aacs, title); + } + if (dec->bdplus) { + libbdplus_event(dec->bdplus, 0x110, title, 0); + } +} + +void dec_application(BD_DEC *dec, uint32_t data) +{ + if (dec->bdplus) { + libbdplus_event(dec->bdplus, 0x210, data, 0); + } +} diff -Nru libbluray-0.5.0/src/libbluray/disc/dec.h libbluray-0.8.1/src/libbluray/disc/dec.h --- libbluray-0.5.0/src/libbluray/disc/dec.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/dec.h 2015-02-12 09:56:04.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#if !defined(_BD_DISC_DEC_H_) +#define _BD_DISC_DEC_H_ + +/* + * low-level stream decoding + */ + +#include "util/attributes.h" + +#include + +struct bd_file_s; +struct bd_enc_info; + +typedef struct bd_file_s * (*file_openFp)(void *, const char *); + +/* device to use */ +struct dec_dev { + void *file_open_bdrom_handle; + file_openFp pf_file_open_bdrom; + void *file_open_vfs_handle; + file_openFp pf_file_open_vfs; + const char *root; /* may be NULL if disc is not mounted */ + const char *device; /* may be null if not reading from real device */ +}; + +typedef struct bd_dec BD_DEC; + +BD_PRIVATE BD_DEC *dec_init(struct dec_dev *dev, + struct bd_enc_info *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write); +BD_PRIVATE void dec_close(BD_DEC **); + +/* get decoder data */ +BD_PRIVATE const uint8_t *dec_data(BD_DEC *, int type); + +/* status events from upper layers */ +BD_PRIVATE void dec_start(BD_DEC *, uint32_t num_titles); +BD_PRIVATE void dec_title(BD_DEC *, uint32_t title); +BD_PRIVATE void dec_application(BD_DEC *, uint32_t data); + +/* open low-level stream */ +BD_PRIVATE struct bd_file_s *dec_open_stream(BD_DEC *dec, struct bd_file_s *fp, uint32_t clip_id); + + +#endif /* _BD_DISC_DEC_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/disc/disc.c libbluray-0.8.1/src/libbluray/disc/disc.c --- libbluray-0.5.0/src/libbluray/disc/disc.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/disc.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,598 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "disc.h" + +#include "dec.h" + +#include "util/logging.h" +#include "util/macro.h" +#include "util/mutex.h" +#include "util/strutl.h" +#include "file/file.h" +#include "file/mount.h" + +#include + +#ifdef ENABLE_UDF +#include "udf_fs.h" +#endif + +struct bd_disc { + BD_MUTEX ovl_mutex; /* protect access to overlay root */ + + char *disc_root; /* disc filesystem root (if disc is mounted) */ + char *overlay_root; /* overlay filesystem root (if set) */ + + BD_DEC *dec; + + void *fs_handle; + BD_FILE_H * (*pf_file_open_bdrom)(void *, const char *); + BD_DIR_H * (*pf_dir_open_bdrom)(void *, const char *); + void (*pf_fs_close)(void *); + + const char *udf_volid; +}; + +/* + * BD-ROM filesystem + */ + +static BD_FILE_H *_bdrom_open_path(void *p, const char *rel_path) +{ + BD_DISC *disc = (BD_DISC *)p; + BD_FILE_H *fp; + char *abs_path; + + abs_path = str_printf("%s%s", disc->disc_root, rel_path); + fp = file_open(abs_path, "rb"); + X_FREE(abs_path); + + return fp; +} + +static BD_DIR_H *_bdrom_open_dir(void *p, const char *dir) +{ + BD_DISC *disc = (BD_DISC *)p; + BD_DIR_H *dp; + char *path; + + path = str_printf("%s%s", disc->disc_root, dir); + dp = dir_open(path); + X_FREE(path); + + return dp; +} + +/* + * overlay filesystem + */ + +static BD_FILE_H *_overlay_open_path(BD_DISC *p, const char *rel_path) +{ + BD_FILE_H *fp = NULL; + + bd_mutex_lock(&p->ovl_mutex); + + if (p->overlay_root) { + char *abs_path = str_printf("%s%s", p->overlay_root, rel_path); + fp = file_open(abs_path, "rb"); + X_FREE(abs_path); + } + + bd_mutex_unlock(&p->ovl_mutex); + + return fp; +} + +static BD_DIR_H *_overlay_open_dir(BD_DISC *p, const char *dir) +{ + BD_DIR_H *dp = NULL; + + bd_mutex_lock(&p->ovl_mutex); + + if (p->overlay_root) { + char *abs_path = str_printf("%s%s", p->disc_root, dir); + dp = dir_open_default()(abs_path); + X_FREE(abs_path); + } + + bd_mutex_unlock(&p->ovl_mutex); + + return dp; +} + +/* + * directory combining + */ + +typedef struct { + unsigned int count; + unsigned int pos; + BD_DIRENT entry[1]; /* VLA */ +} COMB_DIR; + +static void _comb_dir_close(BD_DIR_H *dp) +{ + X_FREE(dp->internal); + X_FREE(dp); +} + +static int _comb_dir_read(BD_DIR_H *dp, BD_DIRENT *entry) +{ + COMB_DIR *priv = (COMB_DIR *)dp->internal; + if (priv->pos < priv->count) { + strcpy(entry->d_name, priv->entry[priv->pos++].d_name); + return 0; + } + return 1; +} + +static void _comb_dir_append(BD_DIR_H *dp, BD_DIRENT *entry) +{ + COMB_DIR *priv = (COMB_DIR *)dp->internal; + unsigned int i; + + if (!priv) { + return; + } + + /* no duplicates */ + for (i = 0; i < priv->count; i++) { + if (!strcmp(priv->entry[i].d_name, entry->d_name)) { + return; + } + } + + /* append */ + priv = realloc(priv, sizeof(*priv) + priv->count * sizeof(BD_DIRENT)); + if (!priv) { + return; + } + strcpy(priv->entry[priv->count].d_name, entry->d_name); + priv->count++; + dp->internal = (void*)priv; +} + +static BD_DIR_H *_combine_dirs(BD_DIR_H *ovl, BD_DIR_H *rom) +{ + BD_DIR_H *dp = calloc(1, sizeof(BD_DIR_H)); + BD_DIRENT entry; + + if (dp) { + dp->read = _comb_dir_read; + dp->close = _comb_dir_close; + dp->internal = calloc(1, sizeof(COMB_DIR)); + + while (!dir_read(ovl, &entry)) { + _comb_dir_append(dp, &entry); + } + while (!dir_read(rom, &entry)) { + _comb_dir_append(dp, &entry); + } + } + dir_close(ovl); + dir_close(rom); + + return dp; +} + +/* + * disc open / close + */ + +static BD_DISC *_disc_init() +{ + BD_DISC *p = calloc(1, sizeof(BD_DISC)); + if (p) { + bd_mutex_init(&p->ovl_mutex); + + /* default file access functions */ + p->fs_handle = (void*)p; + p->pf_file_open_bdrom = _bdrom_open_path; + p->pf_dir_open_bdrom = _bdrom_open_dir; + } + return p; +} + +static void _set_paths(BD_DISC *p, const char *device_path) +{ + if (device_path) { + char *disc_root = mount_get_mountpoint(device_path); + + /* make sure path ends to slash */ + if (!disc_root || (disc_root[0] && disc_root[strlen(disc_root) - 1] == DIR_SEP_CHAR)) { + p->disc_root = disc_root; + } else { + p->disc_root = str_printf("%s%c", disc_root, DIR_SEP_CHAR); + X_FREE(disc_root); + } + } +} + +BD_DISC *disc_open(const char *device_path, + void *read_blocks_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks), + struct bd_enc_info *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write) +{ + BD_DISC *p = _disc_init(); + + if (p) { + _set_paths(p, device_path); + +#ifdef ENABLE_UDF + /* check if disc root directory can be opened. If not, treat it as device/image file. */ + BD_DIR_H *dp_img = device_path ? dir_open(device_path) : NULL; + if (!dp_img) { + void *udf = udf_image_open(device_path, read_blocks_handle, read_blocks); + if (!udf) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "failed opening UDF image %s\n", device_path); + } else { + p->fs_handle = udf; + p->pf_fs_close = udf_image_close; + p->pf_file_open_bdrom = udf_file_open; + p->pf_dir_open_bdrom = udf_dir_open; + + p->udf_volid = udf_volume_id(udf); + + /* root not accessible with stdio */ + X_FREE(p->disc_root); + } + } else { + dir_close(dp_img); + BD_DEBUG(DBG_FILE, "%s does not seem to be image file or device node\n", device_path); + } +#else + (void)read_blocks_handle; + (void)read_blocks; +#endif + + struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path }; + p->dec = dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write); + } + + return p; +} + +void disc_close(BD_DISC **pp) +{ + if (pp && *pp) { + BD_DISC *p = *pp; + + dec_close(&p->dec); + + if (p->pf_fs_close) { + p->pf_fs_close(p->fs_handle); + } + + bd_mutex_destroy(&p->ovl_mutex); + + X_FREE(p->disc_root); + X_FREE(*pp); + } +} + +/* + * + */ + +const char *disc_root(BD_DISC *p) +{ + return p->disc_root; +} + +const char *disc_volume_id(BD_DISC *p) +{ + return p ? p->udf_volid : NULL; +} + +BD_DIR_H *disc_open_bdrom_dir(BD_DISC *p, const char *rel_path) +{ + return p->pf_dir_open_bdrom(p->fs_handle, rel_path); +} + +/* + * VFS + */ + +BD_FILE_H *disc_open_path(BD_DISC *p, const char *rel_path) +{ + BD_FILE_H *fp; + + /* search file from overlay */ + fp = _overlay_open_path(p, rel_path); + + /* if not found, try BD-ROM */ + if (!fp) { + fp = p->pf_file_open_bdrom(p->fs_handle, rel_path); + + if (!fp) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "error opening file %s\n", rel_path); + } + } + + return fp; +} + +BD_FILE_H *disc_open_file(BD_DISC *p, const char *dir, const char *file) +{ + BD_FILE_H *fp; + char *path; + + path = str_printf("%s" DIR_SEP "%s", dir, file); + fp = disc_open_path(p, path); + X_FREE(path); + + return fp; +} + +BD_DIR_H *disc_open_dir(BD_DISC *p, const char *dir) +{ + BD_DIR_H *dp_rom; + BD_DIR_H *dp_ovl; + + dp_rom = p->pf_dir_open_bdrom(p->fs_handle, dir); + dp_ovl = _overlay_open_dir(p, dir); + + if (!dp_ovl) { + if (!dp_rom) { + BD_DEBUG(DBG_FILE, "error opening dir %s\n", dir); + } + return dp_rom; + } + if (!dp_rom) { + return dp_ovl; + } + + return _combine_dirs(dp_ovl, dp_rom); +} + +size_t disc_read_file(BD_DISC *disc, const char *dir, const char *file, + uint8_t **data) +{ + BD_FILE_H *fp; + int64_t size; + + *data = NULL; + + fp = disc_open_file(disc, dir, file); + if (!fp) { + return 0; + } + + size = file_size(fp); + if (size > 0 && size < BD_MAX_SSIZE) { + *data = malloc((size_t)size); + if (*data) { + int64_t got = file_read(fp, *data, size); + if (got != size) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error reading file %s from %s\n", file, dir); + X_FREE(*data); + size = 0; + } + } else { + size = 0; + } + } + else { + size = 0; + } + + file_close(fp); + return (size_t)size; +} + +/* + * filesystem update + */ + +void disc_update(BD_DISC *p, const char *overlay_root) +{ + bd_mutex_lock(&p->ovl_mutex); + + X_FREE(p->overlay_root); + if (overlay_root) { + p->overlay_root = str_dup(overlay_root); + } + + bd_mutex_unlock(&p->ovl_mutex); +} + +int disc_cache_bdrom_file(BD_DISC *p, const char *rel_path, const char *cache_path) +{ + BD_FILE_H *fp_in; + BD_FILE_H *fp_out; + int64_t got; + + /* input file from BD-ROM */ + fp_in = p->pf_file_open_bdrom(p->fs_handle, rel_path); + if (!fp_in) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "error caching file %s (does not exist ?)\n", rel_path); + return -1; + } + + /* make sure path exists */ + file_mkdirs(cache_path); + + /* output file in local filesystem */ + fp_out = file_open(cache_path, "wb"); + if (!fp_out) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "error creating cache file %s\n", cache_path); + file_close(fp_in); + return -1; + } + + while (1) { + uint8_t buf[16*2048]; + got = file_read(fp_in, buf, sizeof(buf)); + if (got <= 0) { + break; + } + if (fp_out->write(fp_out, buf, got) != got) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "error caching file %s\n", rel_path); + file_close(fp_out); + file_close(fp_in); + file_unlink(cache_path); + return -1; + } + } + BD_DEBUG(DBG_FILE, "cached %s to %s\n", rel_path, cache_path); + + file_close(fp_out); + file_close(fp_in); + return 0; +} + +/* + * streams + */ + +BD_FILE_H *disc_open_stream(BD_DISC *disc, const char *file) +{ + BD_FILE_H *fp = disc_open_file(disc, "BDMV" DIR_SEP "STREAM", file); + if (!fp) { + return NULL; + } + + if (disc->dec) { + BD_FILE_H *st = dec_open_stream(disc->dec, fp, atoi(file)); + if (st) { + return st; + } + } + + return fp; +} + +const uint8_t *disc_get_data(BD_DISC *disc, int type) +{ + if (disc->dec) { + return dec_data(disc->dec, type); + } + return NULL; +} + +void disc_event(BD_DISC *disc, uint32_t event, uint32_t param) +{ + if (disc->dec) { + switch (event) { + case DISC_EVENT_START: + dec_start(disc->dec, param); + return; + case DISC_EVENT_TITLE: + dec_title(disc->dec, param); + return; + case DISC_EVENT_APPLICATION: + dec_application(disc->dec, param); + return; + } + } +} + +/* + * Pseudo disc ID + * This is used when AACS disc ID is not available + */ + +#define ROTL64(k, n) (((k) << (n)) | ((k) >> (64 - (n)))) + +static uint64_t _fmix64(uint64_t k) +{ + k ^= k >> 33; + k *= UINT64_C(0xff51afd7ed558ccd); + k ^= k >> 33; + k *= UINT64_C(0xc4ceb9fe1a85ec53); + k ^= k >> 33; + return k; +} + +static void _murmurhash3_128(const uint8_t *in, size_t len, void *out) +{ + // original MurmurHash3 was written by Austin Appleby, and is placed in the public domain. + // https://code.google.com/p/smhasher/wiki/MurmurHash3 + const uint64_t c1 = UINT64_C(0x87c37b91114253d5); + const uint64_t c2 = UINT64_C(0x4cf5ad432745937f); + uint64_t h[2] = {0, 0}; + size_t i; + + /* use only N * 16 bytes, ignore tail */ + len &= ~15; + + for (i = 0; i < len; i += 16) { + uint64_t k1, k2; + memcpy(&k1, in + i, sizeof(uint64_t)); + memcpy(&k2, in + i + 8, sizeof(uint64_t)); + + k1 *= c1; k1 = ROTL64(k1, 31); k1 *= c2; h[0] ^= k1; + + h[0] = ROTL64(h[0], 27); h[0] += h[1]; h[0] = h[0] * 5 + 0x52dce729; + + k2 *= c2; k2 = ROTL64(k2, 33); k2 *= c1; h[1] ^= k2; + + h[1] = ROTL64(h[1], 31); h[1] += h[0]; h[1] = h[1] * 5 + 0x38495ab5; + } + + h[0] ^= len; + h[1] ^= len; + + h[0] += h[1]; + h[1] += h[0]; + + h[0] = _fmix64(h[0]); + h[1] = _fmix64(h[1]); + + h[0] += h[1]; + h[1] += h[0]; + + memcpy(out, h, 2*sizeof(uint64_t)); +} + +static int _hash_file(BD_DISC *p, const char *dir, const char *file, void *hash) +{ + uint8_t *data = NULL; + size_t sz; + + sz = disc_read_file(p, dir, file, &data); + if (sz > 16) { + _murmurhash3_128(data, sz, hash); + } + + X_FREE(data); + return sz > 16; +} + +BD_PRIVATE void disc_pseudo_id(BD_DISC *p, uint8_t *id/*[20]*/) +{ + uint8_t h[2][20]; + int i; + + memset(h, 0, sizeof(h)); + _hash_file(p, "BDMV", "MovieObject.bdmv", h[0]); + _hash_file(p, "BDMV", "index.bdmv", h[1]); + + for (i = 0; i < 20; i++) { + id[i] = h[0][i] ^ h[1][i]; + } +} diff -Nru libbluray-0.5.0/src/libbluray/disc/disc.h libbluray-0.8.1/src/libbluray/disc/disc.h --- libbluray-0.5.0/src/libbluray/disc/disc.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/disc.h 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if !defined(_BD_DISC_H_) +#define _BD_DISC_H_ + +#include "util/attributes.h" + +#include +#include /* size_t */ + +struct bd_file_s; +struct bd_dir_s; +struct bd_enc_info; + +/* + * BluRay Virtual File System + * + * Map file access to BD-ROM file system or binding unit data area + */ + +typedef struct bd_disc BD_DISC; + +BD_PRIVATE BD_DISC *disc_open(const char *device_path, + void *read_blocks_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks), + struct bd_enc_info *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write); + +BD_PRIVATE void disc_close(BD_DISC **); + +/* Get BD-ROM root path */ +BD_PRIVATE const char *disc_root(BD_DISC *disc); + +/* Get UDF volume ID */ +BD_PRIVATE const char *disc_volume_id(BD_DISC *); + +/* Generate pseudo disc ID */ +BD_PRIVATE void disc_pseudo_id(BD_DISC *, uint8_t *id/*[20]*/); + +/* Open VFS file (relative to disc root) */ +BD_PRIVATE struct bd_file_s *disc_open_file(BD_DISC *disc, const char *dir, const char *file); +BD_PRIVATE struct bd_file_s *disc_open_path(BD_DISC *disc, const char *path); + +/* Open VFS directory (relative to disc root) */ +BD_PRIVATE struct bd_dir_s *disc_open_dir (BD_DISC *disc, const char *dir); + +/* Read VFS file */ +BD_PRIVATE size_t disc_read_file(BD_DISC *disc, const char *dir, const char *file, + uint8_t **data); + +/* Update virtual package */ +BD_PRIVATE void disc_update(BD_DISC *disc, const char *overlay_root); + +BD_PRIVATE int disc_cache_bdrom_file(BD_DISC *p, const char *rel_path, const char *cache_path); + +/* open BD-ROM directory (relative to disc root) */ +BD_PRIVATE struct bd_dir_s *disc_open_bdrom_dir(BD_DISC *disc, const char *path); + +/* + * m2ts stream interface + */ + +BD_PRIVATE struct bd_file_s *disc_open_stream(BD_DISC *disc, const char *file); + +/* + * + */ + +BD_PRIVATE const uint8_t *disc_get_data(BD_DISC *, int type); + +enum { + DISC_EVENT_START, /* param: number of titles, 0 if playing with menus */ + DISC_EVENT_TITLE, /* param: title number */ + DISC_EVENT_APPLICATION, /* param: app data */ +}; + +BD_PRIVATE void disc_event(BD_DISC *, uint32_t event, uint32_t param); + + +#endif /* _BD_DISC_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/disc/enc_info.h libbluray-0.8.1/src/libbluray/disc/enc_info.h --- libbluray-0.5.0/src/libbluray/disc/enc_info.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/enc_info.h 2015-02-12 09:56:04.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#if !defined(_BD_DISC_ENC_INFO_H_) +#define _BD_DISC_ENC_INFO_H_ + +#include + +typedef struct bd_enc_info { + uint8_t aacs_detected; + uint8_t libaacs_detected; + uint8_t aacs_handled; + uint8_t bdplus_detected; + uint8_t libbdplus_detected; + uint8_t bdplus_handled; + int aacs_error_code; + int aacs_mkbv; + uint8_t disc_id[20]; + uint8_t bdplus_gen; + uint32_t bdplus_date; +} BD_ENC_INFO; + +#endif /* _BD_DISC_ENC_INFO_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/disc/udf_fs.c libbluray-0.8.1/src/libbluray/disc/udf_fs.c --- libbluray-0.5.0/src/libbluray/disc/udf_fs.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/udf_fs.c 2015-03-20 13:13:51.000000000 +0000 @@ -0,0 +1,287 @@ +/* + * This file is part of libbluray + * Copyright (C) 2015 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "udf_fs.h" + +#include "file/file.h" +#include "util/macro.h" +#include "util/mutex.h" +#include "util/logging.h" + +#include "udfread.h" +#include "blockinput.h" + +#include +#include // SEEK_SET +#include +#include + +/* + * file access + */ + +static void _file_close(BD_FILE_H *file) +{ + if (file) { + udfread_file_close((UDFFILE*)file->internal); + BD_DEBUG(DBG_FILE, "Closed UDF file (%p)\n", (void*)file); + X_FREE(file); + } +} + +static int64_t _file_seek(BD_FILE_H *file, int64_t offset, int32_t origin) +{ + return udfread_file_seek((UDFFILE*)file->internal, offset, origin); +} + +static int64_t _file_tell(BD_FILE_H *file) +{ + return udfread_file_tell((UDFFILE*)file->internal); +} + +static int64_t _file_read(BD_FILE_H *file, uint8_t *buf, int64_t size) +{ + return udfread_file_read((UDFFILE*)file->internal, buf, size); +} + +BD_FILE_H *udf_file_open(void *udf, const char *filename) +{ + BD_FILE_H *file = calloc(1, sizeof(BD_FILE_H)); + + BD_DEBUG(DBG_FILE, "Opening UDF file %s... (%p)\n", filename, (void*)file); + + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = NULL; + file->tell = _file_tell; + file->eof = NULL; + + file->internal = udfread_file_open((udfread*)udf, filename); + if (!file->internal) { + BD_DEBUG(DBG_FILE, "Error opening file %s!\n", filename); + X_FREE(file); + } + + return file; +} + +/* + * directory access + */ + +static void _dir_close(BD_DIR_H *dir) +{ + if (dir) { + udfread_closedir((UDFDIR*)dir->internal); + BD_DEBUG(DBG_DIR, "Closed UDF dir (%p)\n", (void*)dir); + X_FREE(dir); + } +} + +static int _dir_read(BD_DIR_H *dir, BD_DIRENT *entry) +{ + struct udfread_dirent e; + + if (!udfread_readdir((UDFDIR*)dir->internal, &e)) { + return -1; + } + + strncpy(entry->d_name, e.d_name, sizeof(entry->d_name)); + entry->d_name[sizeof(entry->d_name) - 1] = 0; + + return 0; +} + +BD_DIR_H *udf_dir_open(void *udf, const char* dirname) +{ + BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H)); + + BD_DEBUG(DBG_DIR, "Opening UDF dir %s... (%p)\n", dirname, (void*)dir); + + dir->close = _dir_close; + dir->read = _dir_read; + + dir->internal = udfread_opendir((udfread*)udf, dirname); + if (!dir->internal) { + BD_DEBUG(DBG_DIR, "Error opening %s\n", dirname); + X_FREE(dir); + } + + return dir; +} + +/* + * UDF image access + */ + +typedef struct { + struct udfread_block_input i; + BD_FILE_H *fp; + BD_MUTEX mutex; +} UDF_BI; + +static int _bi_close(struct udfread_block_input *bi_gen) +{ + UDF_BI *bi = (UDF_BI *)bi_gen; + file_close(bi->fp); + bd_mutex_destroy(&bi->mutex); + X_FREE(bi); + return 0; +} + +static uint32_t _bi_size(struct udfread_block_input *bi_gen) +{ + UDF_BI *bi = (UDF_BI *)bi_gen; + return file_size(bi->fp) / UDF_BLOCK_SIZE; +} + +static int _bi_read(struct udfread_block_input *bi_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags) +{ + (void)flags; + UDF_BI *bi = (UDF_BI *)bi_gen; + int got = -1; + + /* seek + read must be atomic */ + bd_mutex_lock(&bi->mutex); + + if (file_seek(bi->fp, SEEK_SET, (int64_t)lba * UDF_BLOCK_SIZE) >= 0) { + int64_t bytes = file_read(bi->fp, (uint8_t*)buf, (int64_t)nblocks * UDF_BLOCK_SIZE); + if (bytes > 0) { + got = bytes / UDF_BLOCK_SIZE; + } + } + + bd_mutex_unlock(&bi->mutex); + + return got; +} + +static struct udfread_block_input *_block_input(const char *img) +{ + BD_FILE_H *fp = file_open(img, "rb"); + if (fp) { + UDF_BI *bi = calloc(1, sizeof(*bi)); + if (bi) { + bi->fp = fp; + bi->i.close = _bi_close; + bi->i.read = _bi_read; + bi->i.size = _bi_size; + bd_mutex_init(&bi->mutex); + return &bi->i; + } + file_close(fp); + } + return NULL; +} + + +typedef struct { + struct udfread_block_input i; + void *read_block_handle; + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks); +} UDF_SI; + +static int _si_close(struct udfread_block_input *bi_gen) +{ + free(bi_gen); + return 0; +} + +static int _si_read(struct udfread_block_input *bi_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags) +{ + (void)flags; + UDF_SI *si = (UDF_SI *)bi_gen; + return si->read_blocks(si->read_block_handle, buf, lba, nblocks); +} + +static struct udfread_block_input *_stream_input(void *read_block_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)) +{ + UDF_SI *si = calloc(1, sizeof(*si)); + if (si) { + si->read_block_handle = read_block_handle; + si->read_blocks = read_blocks; + si->i.close = _si_close; + si->i.read = _si_read; + return &si->i; + } + return NULL; +} + + +void *udf_image_open(const char *img_path, + void *read_block_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)) +{ + udfread *udf = udfread_init(); + int result = -1; + + if (!udf) { + return NULL; + } + + /* stream ? */ + if (read_blocks) { + struct udfread_block_input *si = _stream_input(read_block_handle, read_blocks); + if (si) { + result = udfread_open_input(udf, si); + if (result < 0) { + si->close(si); + } + } + } 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); + } + } + } + + if (result < 0) { + result = udfread_open(udf, img_path); + } + } + + if (result < 0) { + udfread_close(udf); + return NULL; + } + + return (void*)udf; +} + +const char *udf_volume_id(void *udf) +{ + return udfread_get_volume_id((udfread*)udf); +} + +void udf_image_close(void *udf) +{ + udfread_close((udfread*)udf); +} diff -Nru libbluray-0.5.0/src/libbluray/disc/udf_fs.h libbluray-0.8.1/src/libbluray/disc/udf_fs.h --- libbluray-0.5.0/src/libbluray/disc/udf_fs.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/disc/udf_fs.h 2015-03-20 13:13:51.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * This file is part of libbluray + * Copyright (C) 2015 Petri Hintukainen + * + * 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 + * . + */ + +#ifndef _BD_UDF_FS_H_ +#define _BD_UDF_FS_H_ + +#include "util/attributes.h" + +struct bd_file_s; +struct bd_dir_s; + +BD_PRIVATE void *udf_image_open(const char *img_path, + void *read_block_handle, + int (*read_blocks)(void *handle, void *buf, int lba, int num_blocks)); +BD_PRIVATE void udf_image_close(void *udf); + +BD_PRIVATE const char *udf_volume_id(void *udf); +BD_PRIVATE struct bd_file_s *udf_file_open(void *udf, const char *filename); +BD_PRIVATE struct bd_dir_s *udf_dir_open(void *udf, const char* dirname); + +#endif /* _BD_UDF_FS_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/hdmv/.deps/hdmv_vm.Plo libbluray-0.8.1/src/libbluray/hdmv/.deps/hdmv_vm.Plo --- libbluray-0.5.0/src/libbluray/hdmv/.deps/hdmv_vm.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/.deps/hdmv_vm.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_dump-mobj_parse.Po libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_dump-mobj_parse.Po --- libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_dump-mobj_parse.Po 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_dump-mobj_parse.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_dump-mobj_print.Po libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_dump-mobj_print.Po --- libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_dump-mobj_print.Po 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_dump-mobj_print.Po 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_parse.Plo libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_parse.Plo --- libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_parse.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_parse.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_print.Plo libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_print.Plo --- libbluray-0.5.0/src/libbluray/hdmv/.deps/mobj_print.Plo 2013-12-21 08:36:32.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/.deps/mobj_print.Plo 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -# dummy diff -Nru libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.c libbluray-0.8.1/src/libbluray/hdmv/hdmv_vm.c --- libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/hdmv_vm.c 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010-2012 Petri Hintukainen + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,18 +17,23 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "hdmv_vm.h" -#include "mobj_parse.h" +#include "mobj_data.h" #include "hdmv_insn.h" +#include "mobj_parse.h" +#include "mobj_print.h" #include "../register.h" -#include "../bdnav/index_parse.h" #include "util/macro.h" -#include "util/strutl.h" #include "util/logging.h" #include "util/mutex.h" +#include #include #include #include @@ -46,7 +51,7 @@ /* state */ uint32_t pc; /* program counter */ BD_REGISTERS *regs; /* player registers */ - MOBJ_OBJECT *object; /* currently running object code */ + const MOBJ_OBJECT *object; /* currently running object code */ HDMV_EVENT event[5]; /* pending events to return */ @@ -57,18 +62,106 @@ MOBJ_OBJECT *ig_object; /* current object from IG stream */ /* object currently playing playlist */ - MOBJ_OBJECT *playing_object; - int playing_pc; + const MOBJ_OBJECT *playing_object; + uint32_t playing_pc; /* suspended object */ - MOBJ_OBJECT *suspended_object; - int suspended_pc; + const MOBJ_OBJECT *suspended_object; + uint32_t suspended_pc; - /* disc index (used to verify CALL_TITLE/JUMP_TITLE) */ - INDX_ROOT *indx; + /* Available titles. Used to validate CALL_TITLE/JUMP_TITLE. */ + uint8_t have_top_menu; + uint8_t have_first_play; + uint16_t num_titles; }; /* + * save / restore VM state + */ + +static int _save_state(HDMV_VM *p, uint32_t *s) +{ + memset(s, 0, sizeof(*s) * HDMV_STATE_SIZE); + + if (p->ig_object) { + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_save_state() failed: button object running\n"); + return -1; + } + if (p->object) { + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_save_state() failed: movie object running\n"); + return -1; + } + if (p->event[0].event != HDMV_EVENT_NONE) { + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_save_state() failed: unprocessed events\n"); + return -1; + } + + if (p->playing_object) { + s[0] = (uint32_t)(p->playing_object - p->movie_objects->objects); + s[1] = p->playing_pc; + } else { + s[0] = (uint32_t)-1; + } + + if (p->suspended_object) { + s[2] = (uint32_t)(p->suspended_object - p->movie_objects->objects); + s[3] = p->suspended_pc; + } else { + s[2] = (uint32_t)-1; + } + + /* nv timer ? */ + + return 0; +} + +static int _restore_state(HDMV_VM *p, const uint32_t *s) +{ + if (s[0] == (uint32_t)-1) { + p->playing_object = NULL; + } else if (s[0] >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_restore_state() failed: invalid playing object index\n"); + return -1; + } else { + p->playing_object = &p->movie_objects->objects[s[0]]; + } + p->playing_pc = s[1]; + + if (s[2] == (uint32_t)-1) { + p->suspended_object = NULL; + } else if (s[2] >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_restore_state() failed: invalid suspended object index\n"); + return -1; + } else { + p->suspended_object = &p->movie_objects->objects[s[2]]; + } + p->suspended_pc = s[3]; + + p->object = NULL; + p->ig_object = NULL; + memset(p->event, 0, sizeof(p->event)); + + return 0; +} + +int hdmv_vm_save_state(HDMV_VM *p, uint32_t *s) +{ + int result; + bd_mutex_lock(&p->mutex); + result = _save_state(p, s); + bd_mutex_unlock(&p->mutex); + return result; +} + +void hdmv_vm_restore_state(HDMV_VM *p, const uint32_t *s) +{ + bd_mutex_lock(&p->mutex); + _restore_state(p, s); + bd_mutex_unlock(&p->mutex); +} + + +/* * registers: PSR and GPR access */ @@ -146,7 +239,7 @@ /* store result to destination register(s) */ if (dst != dst0) { if (cmd->insn.imm_op1) { - BD_DEBUG(DBG_HDMV|DBG_CRIT, "ERROR: storing to imm ! "); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "storing to imm !\n"); return -1; } ret = _store_reg(p, cmd->dst, dst); @@ -154,7 +247,7 @@ if (src != src0) { if (cmd->insn.imm_op1) { - BD_DEBUG(DBG_HDMV|DBG_CRIT, "ERROR: storing to imm ! "); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "storing to imm !\n"); return -1; } ret += _store_reg(p, cmd->src, src); @@ -239,22 +332,27 @@ * vm init */ -HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs, INDX_ROOT *indx) +HDMV_VM *hdmv_vm_init(struct bd_disc *disc, BD_REGISTERS *regs, + unsigned num_titles, unsigned first_play_available, unsigned top_menu_available) { HDMV_VM *p = calloc(1, sizeof(HDMV_VM)); - char *file; + + if (!p) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return NULL; + } /* read movie objects */ - file = str_printf("%s/BDMV/MovieObject.bdmv", disc_root); - p->movie_objects = mobj_parse(file); - X_FREE(file); + p->movie_objects = mobj_get(disc); if (!p->movie_objects) { X_FREE(p); return NULL; } p->regs = regs; - p->indx = indx; + p->num_titles = num_titles; + p->have_top_menu = top_menu_available; + p->have_first_play = first_play_available; bd_mutex_init(&p->mutex); @@ -406,7 +504,7 @@ p->suspended_object = NULL; BD_DEBUG(DBG_HDMV, "resuming object %ld at %d\n", - (long)((p->movie_objects->objects - p->object) / sizeof(p->movie_objects->objects[0])), + (long)(p->object - p->movie_objects->objects), p->pc); _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); @@ -419,29 +517,26 @@ * branching */ -static int _is_valid_title(HDMV_VM *p, int title) +static int _is_valid_title(HDMV_VM *p, uint32_t title) { - if (title == 0 || title == 0xffff) { - INDX_PLAY_ITEM *pi = (!title) ? &p->indx->top_menu : &p->indx->first_play; - - if (pi->object_type == indx_object_type_hdmv && pi->hdmv.id_ref == 0xffff) { - /* no top menu or first play title (5.2.3.3) */ - return 0; - } - return 1; + if (title == 0) { + return p->have_top_menu; + } + if (title == 0xffff) { + return p->have_first_play; } - return title > 0 && title <= p->indx->num_titles; + return title > 0 && title <= p->num_titles; } -static int _jump_object(HDMV_VM *p, int object) +static int _jump_object(HDMV_VM *p, uint32_t object) { - if (object < 0 || object >= p->movie_objects->num_objects) { - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %d\n", object); + if (object >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_object(): invalid object %u\n", object); return -1; } - BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %d\n", object); + BD_DEBUG(DBG_HDMV, "_jump_object(): jumping to object %u\n", object); _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); @@ -457,10 +552,10 @@ return 0; } -static int _jump_title(HDMV_VM *p, int title) +static int _jump_title(HDMV_VM *p, uint32_t title) { if (_is_valid_title(p, title)) { - BD_DEBUG(DBG_HDMV, "_jump_title(%d)\n", title); + BD_DEBUG(DBG_HDMV, "_jump_title(%u)\n", title); /* discard suspended object */ p->suspended_object = NULL; @@ -471,25 +566,29 @@ return 0; } - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%d): invalid title number\n", title); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_jump_title(%u): invalid title number\n", title); return -1; } -static int _call_object(HDMV_VM *p, int object) +static int _call_object(HDMV_VM *p, uint32_t object) { - BD_DEBUG(DBG_HDMV, "_call_object(%d)\n", object); + if (object >= p->movie_objects->num_objects) { + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_object(): invalid object %u\n", object); + return -1; + } + + BD_DEBUG(DBG_HDMV, "_call_object(%u)\n", object); - _queue_event(p, HDMV_EVENT_PLAY_STOP, 0); _suspend_object(p, 1); return _jump_object(p, object); } -static int _call_title(HDMV_VM *p, int title) +static int _call_title(HDMV_VM *p, uint32_t title) { if (_is_valid_title(p, title)) { - BD_DEBUG(DBG_HDMV, "_call_title(%d)\n", title); + BD_DEBUG(DBG_HDMV, "_call_title(%u)\n", title); _suspend_object(p, 1); @@ -498,7 +597,7 @@ return 0; } - BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%d): invalid title number\n", title); + BD_DEBUG(DBG_HDMV|DBG_CRIT, "_call_title(%u): invalid title number\n", title); return -1; } @@ -510,14 +609,14 @@ static int _play_at(HDMV_VM *p, int playlist, int playitem, int playmark) { if (p->ig_object && playlist >= 0) { - BD_DEBUG(DBG_HDMV, "play_at(list %d, item %d, mark %d): " + BD_DEBUG(DBG_HDMV | DBG_CRIT, "play_at(list %d, item %d, mark %d): " "playlist change not allowed in interactive composition\n", playlist, playitem, playmark); return -1; } if (!p->ig_object && playlist < 0) { - BD_DEBUG(DBG_HDMV, "play_at(list %d, item %d, mark %d): " + BD_DEBUG(DBG_HDMV | DBG_CRIT, "play_at(list %d, item %d, mark %d): " "playlist not given in movie object (link commands not allowed)\n", playlist, playitem, playmark); return -1; @@ -545,7 +644,7 @@ static int _play_stop(HDMV_VM *p) { if (!p->ig_object) { - BD_DEBUG(DBG_HDMV, "_play_stop() not allowed in movie object\n"); + BD_DEBUG(DBG_HDMV | DBG_CRIT, "_play_stop() not allowed in movie object\n"); return -1; } @@ -846,7 +945,7 @@ dst += sprintf(dst, "%04d: ", pc); - dst += mobj_sprint_cmd(dst, cmd); + /*dst +=*/ mobj_sprint_cmd(dst, cmd); BD_DEBUG(DBG_HDMV, "%s\n", buf); } @@ -866,7 +965,7 @@ if (new_src != orig_src) { dst += sprintf(dst, " src 0x%x <== 0x%x ", orig_src, new_src); } - dst += sprintf(dst, "]"); + /*dst +=*/ sprintf(dst, "]"); BD_DEBUG(DBG_HDMV, "%s\n", buf); } @@ -1077,9 +1176,14 @@ * interface */ -int hdmv_vm_select_object(HDMV_VM *p, int object) +int hdmv_vm_select_object(HDMV_VM *p, uint32_t object) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _jump_object(p, object); @@ -1088,9 +1192,39 @@ return result; } +static int _set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds) +{ + MOBJ_OBJECT *ig_object = calloc(1, sizeof(MOBJ_OBJECT)); + if (!ig_object) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return -1; + } + + ig_object->num_cmds = num_nav_cmds; + ig_object->cmds = calloc(num_nav_cmds, sizeof(MOBJ_CMD)); + if (!ig_object->cmds) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + X_FREE(ig_object); + return -1; + } + + memcpy(ig_object->cmds, nav_cmds, num_nav_cmds * sizeof(MOBJ_CMD)); + + p->pc = 0; + p->ig_object = ig_object; + p->object = ig_object; + + return 0; +} + int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds) { int result = -1; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); p->object = NULL; @@ -1098,16 +1232,7 @@ _free_ig_object(p); if (nav_cmds && num_nav_cmds > 0) { - MOBJ_OBJECT *ig_object = calloc(1, sizeof(MOBJ_OBJECT)); - ig_object->num_cmds = num_nav_cmds; - ig_object->cmds = calloc(num_nav_cmds, sizeof(MOBJ_CMD)); - memcpy(ig_object->cmds, nav_cmds, num_nav_cmds * sizeof(MOBJ_CMD)); - - p->pc = 0; - p->ig_object = ig_object; - p->object = ig_object; - - result = 0; + result = _set_object(p, num_nav_cmds, nav_cmds); } bd_mutex_unlock(&p->mutex); @@ -1129,6 +1254,11 @@ int hdmv_vm_running(HDMV_VM *p) { int result; + + if (!p) { + return 0; + } + bd_mutex_lock(&p->mutex); result = !!p->object; @@ -1140,11 +1270,15 @@ uint32_t hdmv_vm_get_uo_mask(HDMV_VM *p) { uint32_t mask = 0; - MOBJ_OBJECT *o = NULL; + const MOBJ_OBJECT *o = NULL; + + if (!p) { + return 0; + } bd_mutex_lock(&p->mutex); - if ((o = p->object ? p->object : (p->playing_object ? p->playing_object : p->suspended_object))) { + if ((o = (p->object && !p->ig_object) ? p->object : (p->playing_object ? p->playing_object : p->suspended_object))) { mask |= o->menu_call_mask; mask |= o->title_search_mask << 1; } @@ -1156,6 +1290,11 @@ int hdmv_vm_resume(HDMV_VM *p) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _resume_from_play_pl(p); @@ -1167,6 +1306,11 @@ int hdmv_vm_suspend_pl(HDMV_VM *p) { int result = -1; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); if (p->object || p->ig_object) { @@ -1256,6 +1400,11 @@ int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev) { int result; + + if (!p) { + return -1; + } + bd_mutex_lock(&p->mutex); result = _vm_run(p, ev); diff -Nru libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.h libbluray-0.8.1/src/libbluray/hdmv/hdmv_vm.h --- libbluray-0.5.0/src/libbluray/hdmv/hdmv_vm.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/hdmv_vm.h 2015-05-15 09:25:06.000000000 +0000 @@ -20,7 +20,7 @@ #if !defined(_HDMV_VM_H_) #define _HDMV_VM_H_ -#include +#include "util/attributes.h" #include @@ -65,7 +65,7 @@ */ struct bd_registers_s; -struct indx_root_s; +struct bd_disc; /* * @@ -73,10 +73,11 @@ typedef struct hdmv_vm_s HDMV_VM; -BD_PRIVATE HDMV_VM *hdmv_vm_init(const char *disc_root, struct bd_registers_s *regs, struct indx_root_s *indx); +BD_PRIVATE HDMV_VM *hdmv_vm_init(struct bd_disc *disc, struct bd_registers_s *regs, + unsigned num_titles, unsigned first_play_available, unsigned top_menu_available); BD_PRIVATE void hdmv_vm_free(HDMV_VM **p); -BD_PRIVATE int hdmv_vm_select_object(HDMV_VM *p, int object); +BD_PRIVATE int hdmv_vm_select_object(HDMV_VM *p, uint32_t object); BD_PRIVATE int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds); BD_PRIVATE int hdmv_vm_run(HDMV_VM *p, HDMV_EVENT *ev); BD_PRIVATE int hdmv_vm_get_event(HDMV_VM *p, HDMV_EVENT *ev); @@ -118,4 +119,15 @@ */ BD_PRIVATE int hdmv_vm_resume(HDMV_VM *p); + +/* + * save / restore VM state + */ + +/* VM state size */ +#define HDMV_STATE_SIZE 10 /* * sizeof(uint32_t) */ + +BD_PRIVATE int hdmv_vm_save_state(HDMV_VM *p, uint32_t *s); +BD_PRIVATE void hdmv_vm_restore_state(HDMV_VM *p, const uint32_t *s); + #endif // _HDMV_VM_H_ diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_data.h libbluray-0.8.1/src/libbluray/hdmv/mobj_data.h --- libbluray-0.5.0/src/libbluray/hdmv/mobj_data.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/mobj_data.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 Petri Hintukainen + * + * 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 + * . + */ + +#if !defined(_MOBJ_DATA_H_) +#define _MOBJ_DATA_H_ + +#include + +typedef struct { + unsigned int sub_grp : 3; /* command sub-group */ + unsigned int op_cnt : 3; /* operand count */ + unsigned int grp : 2; /* command group */ + + unsigned int branch_opt : 4; /* branch option */ + unsigned int reserved1 : 2; + unsigned int imm_op2 : 1; /* I-flag for operand 2 */ + unsigned int imm_op1 : 1; /* I-flag for operand 1 */ + + unsigned int cmp_opt : 4; /* compare option */ + unsigned int reserved2 : 4; + + unsigned int set_opt : 5; /* set option */ + unsigned int reserved3 : 3; +} HDMV_INSN; + +typedef struct mobj_cmd { + HDMV_INSN insn; + uint32_t dst; + uint32_t src; +} MOBJ_CMD; + +typedef struct { + uint8_t resume_intention_flag /*: 1*/; + uint8_t menu_call_mask /*: 1*/; + uint8_t title_search_mask /*: 1*/; + + uint16_t num_cmds; + MOBJ_CMD *cmds; +} MOBJ_OBJECT; + +typedef struct mobj_objects { + uint16_t num_objects; + MOBJ_OBJECT *objects; +} MOBJ_OBJECTS; + +#endif // _MOBJ_DATA_H_ diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.c libbluray-0.8.1/src/libbluray/hdmv/mobj_parse.c --- libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/mobj_parse.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,11 +17,21 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mobj_parse.h" + +#include "mobj_data.h" + +#include "disc/disc.h" + #include "file/file.h" #include "util/bits.h" #include "util/logging.h" #include "util/macro.h" -#include "mobj_parse.h" +#include "util/strutl.h" #include #include @@ -87,6 +97,10 @@ obj->num_cmds = bs_read(bs, 16); obj->cmds = calloc(obj->num_cmds, sizeof(MOBJ_CMD)); + if (!obj->cmds) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + return 0; + } for (i = 0; i < obj->num_cmds; i++) { uint8_t buf[12]; @@ -101,88 +115,118 @@ { if (p && *p) { - int i; - for (i = 0 ; i < (*p)->num_objects; i++) { - X_FREE((*p)->objects[i].cmds); - } + if ((*p)->objects) { + int i; + for (i = 0 ; i < (*p)->num_objects; i++) { + X_FREE((*p)->objects[i].cmds); + } - X_FREE((*p)->objects); + X_FREE((*p)->objects); + } X_FREE(*p); } } -static MOBJ_OBJECTS *_mobj_parse(const char *file_name) +static MOBJ_OBJECTS *_mobj_parse(BD_FILE_H *fp) { BITSTREAM bs; - BD_FILE_H *fp; MOBJ_OBJECTS *objects = NULL; uint16_t num_objects; uint32_t data_len; int extension_data_start, i; - fp = file_open(file_name, "rb"); - if (!fp) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "error opening %s\n", file_name); - return NULL; - } - bs_init(&bs, fp); if (!_mobj_parse_header(&bs, &extension_data_start)) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: invalid header\n", file_name); + BD_DEBUG(DBG_NAV | DBG_CRIT, "MovieObject.bdmv: invalid header\n"); goto error; } + if (extension_data_start) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "MovieObject.bdmv: unknown extension data at %d\n", extension_data_start); + } + bs_seek_byte(&bs, 40); data_len = bs_read(&bs, 32); - if ((bs_end(&bs) - bs_pos(&bs))/8 < (off_t)data_len) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: invalid data_len %d !\n", file_name, data_len); + if ((bs_end(&bs) - bs_pos(&bs))/8 < (int64_t)data_len) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "MovieObject.bdmv: invalid data_len %d !\n", data_len); + goto error; + } + + objects = calloc(1, sizeof(MOBJ_OBJECTS)); + if (!objects) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); goto error; } bs_skip(&bs, 32); /* reserved */ num_objects = bs_read(&bs, 16); - objects = calloc(1, sizeof(MOBJ_OBJECTS)); objects->num_objects = num_objects; objects->objects = calloc(num_objects, sizeof(MOBJ_OBJECT)); + if (!objects->objects) { + BD_DEBUG(DBG_CRIT, "out of memory\n"); + goto error; + } for (i = 0; i < objects->num_objects; i++) { if (!_mobj_parse_object(&bs, &objects->objects[i])) { - BD_DEBUG(DBG_NAV | DBG_CRIT, "%s: error parsing object %d\n", file_name, i); + BD_DEBUG(DBG_NAV | DBG_CRIT, "MovieObject.bdmv: error parsing object %d\n", i); goto error; } } - file_close(fp); - return objects; error: mobj_free(&objects); - file_close(fp); return NULL; } MOBJ_OBJECTS *mobj_parse(const char *file_name) { - MOBJ_OBJECTS *objects = _mobj_parse(file_name); + BD_FILE_H *fp; + MOBJ_OBJECTS *objects; - /* if failed, try backup file */ - if (!objects) { - size_t len = strlen(file_name); - char *backup = malloc(len + 8); + fp = file_open(file_name, "rb"); + if (!fp) { + BD_DEBUG(DBG_NAV | DBG_CRIT, "error opening %s\n", file_name); + return NULL; + } + + objects = _mobj_parse(fp); + file_close(fp); + return objects; +} + +static MOBJ_OBJECTS *_mobj_get(BD_DISC *disc, const char *path) +{ + BD_FILE_H *fp; + MOBJ_OBJECTS *objects; + + fp = disc_open_path(disc, path); + if (!fp) { + return NULL; + } - strcpy(backup, file_name); - strcpy(backup + len - 16, "BACKUP/MovieObject.bdmv"); + objects = _mobj_parse(fp); + file_close(fp); + return objects; +} - objects = _mobj_parse(backup); +MOBJ_OBJECTS *mobj_get(BD_DISC *disc) +{ + MOBJ_OBJECTS *objects; - X_FREE(backup); + objects = _mobj_get(disc, "BDMV" DIR_SEP "MovieObject.bdmv"); + if (objects) { + return objects; } + /* if failed, try backup file */ + objects = _mobj_get(disc, "BDMV" DIR_SEP "BACKUP" DIR_SEP "MovieObject.bdmv"); return objects; } diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.h libbluray-0.8.1/src/libbluray/hdmv/mobj_parse.h --- libbluray-0.5.0/src/libbluray/hdmv/mobj_parse.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/mobj_parse.h 2015-02-12 09:56:04.000000000 +0000 @@ -20,52 +20,17 @@ #if !defined(_MOBJ_PARSE_H_) #define _MOBJ_PARSE_H_ -#include +#include "util/attributes.h" #include -typedef struct { - unsigned int sub_grp : 3; /* command sub-group */ - unsigned int op_cnt : 3; /* operand count */ - unsigned int grp : 2; /* command group */ - - unsigned int branch_opt : 4; /* branch option */ - unsigned int reserved1 : 2; - unsigned int imm_op2 : 1; /* I-flag for operand 2 */ - unsigned int imm_op1 : 1; /* I-flag for operand 1 */ - - unsigned int cmp_opt : 4; /* compare option */ - unsigned int reserved2 : 4; - - unsigned int set_opt : 5; /* set option */ - unsigned int reserved3 : 3; -} HDMV_INSN; - -typedef struct bd_mobj_cmd_s { - HDMV_INSN insn; - uint32_t dst; - uint32_t src; -} MOBJ_CMD; - -typedef struct { - uint8_t resume_intention_flag /*: 1*/; - uint8_t menu_call_mask /*: 1*/; - uint8_t title_search_mask /*: 1*/; - - uint16_t num_cmds; - MOBJ_CMD *cmds; -} MOBJ_OBJECT; - -typedef struct { - uint16_t num_objects; - MOBJ_OBJECT *objects; -} MOBJ_OBJECTS; - - -BD_PRIVATE MOBJ_OBJECTS* mobj_parse(const char *path) BD_ATTR_MALLOC; /* parse MovieObject.bdmv */ -BD_PRIVATE void mobj_parse_cmd(uint8_t *buf, MOBJ_CMD *cmd); -BD_PRIVATE void mobj_free(MOBJ_OBJECTS **index); - -BD_PRIVATE int mobj_sprint_cmd(char *buf, MOBJ_CMD *cmd); /* print MOBJ_CMD to string. buf is expected to be 256 bytes. */ +struct bd_disc; +struct mobj_objects; +struct mobj_cmd; + +BD_PRIVATE struct mobj_objects* mobj_parse(const char *file) BD_ATTR_MALLOC; /* parse MovieObject.bdmv */ +BD_PRIVATE struct mobj_objects* mobj_get(struct bd_disc *disc); /* parse MovieObject.bdmv */ +BD_PRIVATE void mobj_parse_cmd(uint8_t *buf, struct mobj_cmd *cmd); +BD_PRIVATE void mobj_free(struct mobj_objects **index); #endif // _MOBJ_PARSE_H_ diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_print.c libbluray-0.8.1/src/libbluray/hdmv/mobj_print.c --- libbluray-0.5.0/src/libbluray/hdmv/mobj_print.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/mobj_print.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,9 +17,13 @@ * . */ -#include "util/macro.h" +#if HAVE_CONFIG_H +#include "config.h" +#endif -#include "mobj_parse.h" +#include "mobj_print.h" + +#include "mobj_data.h" #include "hdmv_insn.h" #include @@ -308,12 +312,22 @@ return buf - start; } +static uint32_t _cmd_to_u32(HDMV_INSN *insn) +{ + union { + HDMV_INSN insn; + uint8_t u8[4]; + } tmp; + tmp.insn = *insn; + return (tmp.u8[0] << 24) | (tmp.u8[1] << 16) | (tmp.u8[2] << 8) | tmp.u8[3]; +} + int mobj_sprint_cmd(char *buf, MOBJ_CMD *cmd) { char *start = buf; HDMV_INSN *insn = &cmd->insn; - buf += sprintf(buf, "%08x %08x,%08x ", MKINT_BE32((uint8_t*)&cmd->insn), cmd->dst, cmd->src); + buf += sprintf(buf, "%08x %08x,%08x ", _cmd_to_u32(&cmd->insn), cmd->dst, cmd->src); switch(insn->grp) { case INSN_GROUP_BRANCH: diff -Nru libbluray-0.5.0/src/libbluray/hdmv/mobj_print.h libbluray-0.8.1/src/libbluray/hdmv/mobj_print.h --- libbluray-0.5.0/src/libbluray/hdmv/mobj_print.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/hdmv/mobj_print.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 Petri Hintukainen + * + * 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 + * . + */ + +#if !defined(_MOBJ_PRINT_H_) +#define _MOBJ_PRINT_H_ + +#include "util/attributes.h" + +struct mobj_cmd; + +BD_PRIVATE int mobj_sprint_cmd(char *buf, struct mobj_cmd *cmd); /* print MOBJ_CMD to string. buf is expected to be 256 bytes. */ + +#endif // _MOBJ_PRINT_H_ diff -Nru libbluray-0.5.0/src/libbluray/keys.h libbluray-0.8.1/src/libbluray/keys.h --- libbluray-0.5.0/src/libbluray/keys.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/keys.h 2015-01-26 08:01:57.000000000 +0000 @@ -54,6 +54,11 @@ /* Translated to BD_VK_ENTER if mouse is over valid button */ BD_VK_MOUSE_ACTIVATE = 17, + BD_VK_RED = 403, + BD_VK_GREEN = 404, + BD_VL_YELLOW = 405, + BD_VK_BLUE = 406, + } bd_vk_key_e; #endif // _BD_KEYS_H_ diff -Nru libbluray-0.5.0/src/libbluray/player_settings.h libbluray-0.8.1/src/libbluray/player_settings.h --- libbluray-0.5.0/src/libbluray/player_settings.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/player_settings.h 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,125 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 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 + * . + */ + +#ifndef BD_PLAYER_SETTINGS_H_ +#define BD_PLAYER_SETTINGS_H_ + +/* + * BLURAY_PLAYER_SETTING_AUDIO_CAP (PSR15) + * + * Player capability for audio (bitmask) + */ + +enum { + + /* LPCM */ + + /* 48/96kHz (mandatory) */ + BLURAY_ACAP_LPCM_48_96_STEREO_ONLY = 0x0001, /* LPCM 48kHz and 96kHz stereo */ + BLURAY_ACAP_LPCM_48_96_SURROUND = 0x0002, /* LPCM 48kHz and 96kHz surround */ + + /* 192kHz (optional) */ + BLURAY_ACAP_LPCM_192_STEREO_ONLY = 0x0004, /* LPCM 192kHz stereo */ + BLURAY_ACAP_LPCM_192_SURROUND = 0x0008, /* LPCM 192kHz surround */ + + /* Dolby Digital Plus */ + + /* independent substream (mandatory) */ + BLURAY_ACAP_DDPLUS_STEREO_ONLY = 0x0010, + BLURAY_ACAP_DDPLUS_SURROUND = 0x0020, + + /* dependent substream (optional) */ + BLURAY_ACAP_DDPLUS_DEP_STEREO_ONLY = 0x0040, + BLURAY_ACAP_DDPLUS_DEP_SURROUND = 0x0080, + + /* DTS-HD */ + + /* Core substream (mandatory) */ + BLURAY_ACAP_DTSHD_CORE_STEREO_ONLY = 0x0100, + BLURAY_ACAP_DTSHD_CORE_SURROUND = 0x0200, + + /* Extension substream (optional) */ + BLURAY_ACAP_DTSHD_EXT_STEREO_ONLY = 0x0400, + BLURAY_ACAP_DTSHD_EXT_SURROUND = 0x0800, + + /* Dolby lossless (TrueHD) */ + + /* Dolby Digital (mandatory) */ + BLURAY_ACAP_DD_STEREO_ONLY = 0x1000, + BLURAY_ACAP_DD_SURROUND = 0x2000, + + /* MLP (optional) */ + BLURAY_ACAP_MLP_STEREO_ONLY = 0x4000, + BLURAY_ACAP_MLP_SURROUND = 0x8000, +}; + + +/* + * BLURAY_PLAYER_SETTING_REGION_CODE (PSR20) + * + * Player region code (integer) + * + * Region A: the Americas, East and Southeast Asia, U.S. territories, and Bermuda. + * Region B: Africa, Europe, Oceania, the Middle East, the Kingdom of the Netherlands, + * British overseas territories, French territories, and Greenland. + * Region C: Central and South Asia, Mongolia, Russia, and the People's Republic of China. + * + */ + +enum { + BLURAY_REGION_A = 1, + BLURAY_REGION_B = 2, + BLURAY_REGION_C = 4, +}; + + +/* + * BLURAY_PLAYER_SETTING_OUTPUT_PREFER (PSR21) + * + * Output mode preference (integer) + */ + +enum { + BLURAY_OUTPUT_PREFER_2D = 0, + BLURAY_OUTPUT_PREFER_3D = 1, +}; + + +/* + * BLURAY_PLAYER_SETTING_VIDEO_CAP (PSR29) + * + * Player capability for video (bit mask) + */ + +enum { + BLURAY_VCAP_SECONDARY_HD = 0x01, /* player can play secondary stream in HD */ + BLURAY_VCAP_25Hz_50Hz = 0x02, /* player can play 25Hz and 50Hz video */ +}; + +/* + * BLURAY_PLAYER_SETTING_PLAYER_PROFILE (PSR31) + * + * Player profile and version + */ + +enum { + BLURAY_PLAYER_PROFILE_2_v2_0 = ((0x03 << 16) | (0x0200)), /* Profile 2, version 2.0 (network access, BdLive) */ +}; + +#endif /* BD_PLAYER_SETTINGS_H_ */ diff -Nru libbluray-0.5.0/src/libbluray/register.c libbluray-0.8.1/src/libbluray/register.c --- libbluray-0.5.0/src/libbluray/register.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/register.c 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,14 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "register.h" + +#include "player_settings.h" + #include "util/attributes.h" #include "util/macro.h" #include "util/logging.h" @@ -26,9 +33,6 @@ #include #include -#define BD_PSR_COUNT 128 -#define BD_GPR_COUNT 4096 - /* * Initial values for player status/setting registers (5.8.2). * @@ -51,13 +55,24 @@ 0xff, /* PSR12: User style number */ 0xff, /* PS: PSR13: User age */ 0xffff, /* PSR14: Secondary audio stream number and secondary video stream number */ - 0xffff, /* PS: PSR15: player capability for audio */ + /* PS: PSR15: player capability for audio */ + BLURAY_ACAP_LPCM_48_96_SURROUND | + BLURAY_ACAP_LPCM_192_SURROUND | + BLURAY_ACAP_DDPLUS_SURROUND | + BLURAY_ACAP_DDPLUS_DEP_SURROUND | + BLURAY_ACAP_DTSHD_CORE_SURROUND | + BLURAY_ACAP_DTSHD_EXT_SURROUND | + BLURAY_ACAP_DD_SURROUND | + BLURAY_ACAP_MLP_SURROUND, + 0xffffff, /* PS: PSR16: Language code for audio */ 0xffffff, /* PS: PSR17: Language code for PG and Text subtitles */ 0xffffff, /* PS: PSR18: Menu description language code */ 0xffff, /* PS: PSR19: Country code */ - 0x02, /* PS: PSR20: Region code */ /* 1 - A, 2 - B, 4 - C */ - 0, /* PS: PSR21: Output mode preference */ + /* PS: PSR20: Region code */ /* 1 - A, 2 - B, 4 - C */ + BLURAY_REGION_B, + /* PS: PSR21: Output mode preference */ + BLURAY_OUTPUT_PREFER_2D, 0, /* PSR22: Stereoscopic status */ 0, /* PS: PSR23: Display capability */ 0, /* PS: PSR24: 3D capability */ @@ -65,10 +80,13 @@ 0, /* PSR26 */ 0, /* PSR27 */ 0, /* PSR28 */ - 0x03, /* PS: PSR29: player capability for video */ + /* PS: PSR29: player capability for video */ + BLURAY_VCAP_SECONDARY_HD | + BLURAY_VCAP_25Hz_50Hz, + 0x1ffff, /* PS: PSR30: player capability for text subtitle */ - 0x030200, /* PS: PSR31: Player profile and version */ - /* BD-RO Profile 2 version 2.0 */ + /* PS: PSR31: Player profile and version */ + BLURAY_PLAYER_PROFILE_2_v2_0, 0, /* PSR32 */ 0, /* PSR33 */ 0, /* PSR34 */ @@ -165,9 +183,11 @@ { BD_REGISTERS *p = calloc(1, sizeof(BD_REGISTERS)); - memcpy(p->psr, bd_psr_init, sizeof(bd_psr_init)); + if (p) { + memcpy(p->psr, bd_psr_init, sizeof(bd_psr_init)); - bd_mutex_init(&p->mutex); + bd_mutex_init(&p->mutex); + } return p; } @@ -204,6 +224,7 @@ void bd_psr_register_cb (BD_REGISTERS *p, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle) { /* no duplicates ! */ + PSR_CB_DATA *cb; unsigned i; bd_psr_lock(p); @@ -216,11 +237,15 @@ } } - p->num_cb++; - p->cb = realloc(p->cb, p->num_cb * sizeof(PSR_CB_DATA)); - - p->cb[p->num_cb - 1].cb = callback; - p->cb[p->num_cb - 1].handle = cb_handle; + cb = realloc(p->cb, (p->num_cb + 1) * sizeof(PSR_CB_DATA)); + if (cb) { + p->cb = cb; + p->cb[p->num_cb].cb = callback; + p->cb[p->num_cb].handle = cb_handle; + p->num_cb++; + } else { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_psr_register_cb(): realloc failed\n"); + } bd_psr_unlock(p); } @@ -352,7 +377,7 @@ { if (reg < 0 || reg >= BD_GPR_COUNT) { BD_DEBUG(DBG_BLURAY, "bd_gpr_read(%d): invalid register\n", reg); - return -1; + return 0; } return p->gpr[reg]; @@ -436,3 +461,72 @@ return bd_psr_setting_write(p, reg, val); } +int bd_psr_write_bits(BD_REGISTERS *p, int reg, uint32_t val, uint32_t mask) +{ + int result; + + if (mask == 0xffffffff) { + return bd_psr_write(p, reg, val); + } + + bd_psr_lock(p); + + uint32_t psr_value = bd_psr_read(p, reg); + psr_value = (psr_value & (~mask)) | (val & mask); + result = bd_psr_write(p, reg, psr_value); + + bd_psr_unlock(p); + + return result; +} + +/* + * save / restore registers between playback sessions + */ + +void registers_save(BD_REGISTERS *p, uint32_t *psr, uint32_t *gpr) +{ + bd_psr_lock(p); + + memcpy(gpr, p->gpr, sizeof(p->gpr)); + memcpy(psr, p->psr, sizeof(p->psr)); + + bd_psr_unlock(p); +} + +void registers_restore(BD_REGISTERS *p, const uint32_t *psr, const uint32_t *gpr) +{ + uint32_t new_psr[13]; + + bd_psr_lock(p); + + memcpy(p->gpr, gpr, sizeof(p->gpr)); + memcpy(p->psr, psr, sizeof(p->psr)); + + memcpy(new_psr, p->psr, sizeof(new_psr[0]) * 13); + + /* generate restore events */ + if (p->num_cb) { + BD_PSR_EVENT ev; + unsigned i, j; + + ev.ev_type = BD_PSR_RESTORE; + ev.old_val = 0; /* not used with BD_PSR_RESTORE */ + + for (i = 4; i < 13; i++) { + if (i != PSR_NAV_TIMER) { + + p->psr[i] = new_psr[i]; + + ev.psr_idx = i; + ev.new_val = new_psr[i]; + + for (j = 0; j < p->num_cb; j++) { + p->cb[j].cb(p->cb[j].handle, &ev); + } + } + } + } + + bd_psr_unlock(p); +} diff -Nru libbluray-0.5.0/src/libbluray/register.h libbluray-0.8.1/src/libbluray/register.h --- libbluray-0.5.0/src/libbluray/register.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/libbluray/register.h 2015-05-15 09:25:06.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,10 +20,14 @@ #if !defined(_BD_REGISTER_H_) #define _BD_REGISTER_H_ -#include +#include "util/attributes.h" #include + +#define BD_PSR_COUNT 128 +#define BD_GPR_COUNT 4096 + /* * Player Status Registers */ @@ -68,8 +72,6 @@ /* 48-61: caps for characteristic text subtitle */ } bd_psr_idx; -#define DEFAULT_LANGUAGE "eng" - typedef struct bd_registers_s BD_REGISTERS; @@ -145,6 +147,22 @@ /** * + * Atomically change bits in player status register. + * + * Replace selected bits of player status register. + * New value for PSR is (CURRENT_PSR_VALUE & ~mask) | (val & mask) + * Writing to player setting registers will fail. + * + * @param registers BD_REGISTERS object + * @param reg register number + * @param val new value for register + * @param mask bit mask. bits to be written are set to 1. + * @return 0 on success, -1 on error (invalid register number) + */ +int bd_psr_write_bits(BD_REGISTERS *, int reg, uint32_t val, uint32_t mask); + +/** + * * Write to any PSR, including player setting registers. * * This should be called only by the application. @@ -246,4 +264,13 @@ void bd_psr_unregister_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle); +/* + * save / restore registers between playback sessions + * + * When state is restored, restore events will be generated and playback state is restored. + */ + +BD_PRIVATE void registers_save(BD_REGISTERS *p, uint32_t *psr, uint32_t *gpr); +BD_PRIVATE void registers_restore(BD_REGISTERS *p, const uint32_t *psr, const uint32_t *gpr); + #endif /* _BD_REGISTER_H_ */ diff -Nru libbluray-0.5.0/src/libbluray.pc.in libbluray-0.8.1/src/libbluray.pc.in --- libbluray-0.5.0/src/libbluray.pc.in 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/libbluray.pc.in 2015-01-26 08:01:57.000000000 +0000 @@ -7,5 +7,5 @@ Description: library supporting Blu-ray playback Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lbluray -Libs.private: @DLOPEN_LIBS@ @LIBXML2_LIBS@ @FT2_LIBS@ +Libs.private: @DLOPEN_LIBS@ @LIBXML2_LIBS@ @FT2_LIBS@ @FONTCONFIG_LIBS@ Cflags: -I${includedir} diff -Nru libbluray-0.5.0/src/Makefile.am libbluray-0.8.1/src/Makefile.am --- libbluray-0.5.0/src/Makefile.am 2013-12-21 08:10:02.000000000 +0000 +++ libbluray-0.8.1/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,270 +0,0 @@ -SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav - -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) $(FT2_CFLAGS) - -EXTRA_DIST = \ - libbluray/bdj/build.xml \ - libbluray/bdj/java \ - libbluray/bdj/java-j2me \ - libbluray/bdj/java-j2se - -lib_LTLIBRARIES=libbluray.la -libbluray_la_SOURCES = \ - libbluray/bluray.h \ - libbluray/bluray.c \ - libbluray/bluray_internal.h \ - libbluray/register.h \ - libbluray/register.c \ - libbluray/keys.h \ - libbluray/bdnav \ - libbluray/bdnav/bdparse.h \ - libbluray/bdnav/uo_mask_table.h \ - libbluray/bdnav/navigation.h \ - libbluray/bdnav/index_parse.c \ - libbluray/bdnav/navigation.c \ - libbluray/bdnav/sound_parse.c \ - libbluray/bdnav/sound_parse.h \ - libbluray/bdnav/mpls_parse.h \ - libbluray/bdnav/clpi_parse.c \ - libbluray/bdnav/mpls_parse.c \ - libbluray/bdnav/index_parse.h \ - libbluray/bdnav/clpi_parse.h \ - libbluray/bdnav/meta_data.h \ - libbluray/bdnav/meta_parse.c \ - libbluray/bdnav/meta_parse.h \ - libbluray/bdnav/extdata_parse.h \ - libbluray/bdnav/extdata_parse.c \ - libbluray/bdnav/bdid_parse.h \ - libbluray/bdnav/bdid_parse.c \ - libbluray/decoders \ - libbluray/decoders/pes_buffer.h \ - libbluray/decoders/pes_buffer.c \ - libbluray/decoders/m2ts_demux.h \ - libbluray/decoders/m2ts_demux.c \ - libbluray/decoders/m2ts_filter.h \ - libbluray/decoders/m2ts_filter.c \ - libbluray/decoders/overlay.h \ - libbluray/decoders/pg.h \ - libbluray/decoders/pg_decode.h \ - libbluray/decoders/pg_decode.c \ - libbluray/decoders/ig.h \ - libbluray/decoders/ig_decode.h \ - libbluray/decoders/ig_decode.c \ - libbluray/decoders/rle.h \ - libbluray/decoders/rle.c \ - libbluray/decoders/textst.h \ - libbluray/decoders/textst_decode.h \ - libbluray/decoders/textst_decode.c \ - libbluray/decoders/textst_render.h \ - libbluray/decoders/textst_render.c \ - libbluray/decoders/graphics_processor.h \ - libbluray/decoders/graphics_processor.c \ - libbluray/decoders/graphics_controller.h \ - libbluray/decoders/graphics_controller.c \ - libbluray/hdmv \ - libbluray/hdmv/hdmv_insn.h \ - libbluray/hdmv/hdmv_vm.h \ - libbluray/hdmv/hdmv_vm.c \ - libbluray/hdmv/mobj_parse.h \ - libbluray/hdmv/mobj_parse.c \ - libbluray/hdmv/mobj_print.c \ - file/file.h \ - file/file_posix.c \ - file/dirs.h \ - file/dl.h \ - file/filesystem.h \ - file/filesystem.c \ - file/libaacs.h \ - file/libaacs.c \ - file/libbdplus.h \ - file/libbdplus.c \ - util/attributes.h \ - util/refcnt.h \ - util/refcnt.c \ - util/strutl.c \ - util/strutl.h \ - util/macro.h \ - util/mutex.h \ - util/time.h \ - util/logging.c \ - util/log_control.h \ - util/bits.h \ - util/bits.c \ - util/logging.h - -if HAVE_DARWIN -libbluray_la_SOURCES+= \ - file/dir_posix.c \ - file/dl_posix.c \ - file/dirs_darwin.c -else -if HAVE_WIN32 -libbluray_la_SOURCES+= \ - file/dir_win32.c \ - file/dl_win32.c \ - file/dirs_win32.c -else -libbluray_la_SOURCES+= \ - file/dir_posix.c \ - file/dl_posix.c \ - file/dirs_xdg.c -endif -endif - - -libbluray_la_LDFLAGS= -version-info $(LT_VERSION_INFO) -libbluray_la_LIBADD= $(LIBXML2_LIBS) $(FT2_LIBS) - -pkginclude_HEADERS = \ - file/filesystem.h \ - libbluray/bdnav/clpi_data.h \ - libbluray/bdnav/meta_data.h \ - libbluray/bluray-version.h \ - libbluray/bluray.h \ - libbluray/decoders/overlay.h \ - libbluray/keys.h \ - util/log_control.h - -if USING_BDJAVA -jardir=$(libdir)/libbluray/ -jar_DATA=$(top_builddir)/src/.libs/libbluray.jar - -$(top_builddir)/src/.libs/libbluray.jar: all-local - -libbluray_la_SOURCES += \ - libbluray/bdj/bdj.h \ - libbluray/bdj/bdj_private.h \ - libbluray/bdj/bdj_util.h \ - libbluray/bdj/bdj_util.c \ - libbluray/bdj/bdj.c \ - libbluray/bdj/bdjo_parser.h \ - libbluray/bdj/bdjo_parser.c \ - libbluray/bdj/common.h \ - libbluray/bdj/native/java_awt_BDGraphics.h \ - libbluray/bdj/native/java_awt_BDGraphics.c \ - libbluray/bdj/native/java_awt_BDFontMetrics.h \ - libbluray/bdj/native/java_awt_BDFontMetrics.c \ - libbluray/bdj/native/org_videolan_Libbluray.h \ - libbluray/bdj/native/org_videolan_Libbluray.c \ - libbluray/bdj/native/org_videolan_Logger.h \ - libbluray/bdj/native/org_videolan_Logger.c \ - libbluray/bdj/native/register_native.h \ - libbluray/bdj/native/register_native.c - -AM_CFLAGS += $(BDJAVA_CFLAGS) - -all-local: - ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ - -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ - -Ddist='$(abs_builddir)/.libs' \ - -Dsrc_awt=:java-$(BDJ_TYPE) \ - -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" - -clean-local: - ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ - -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ - -Ddist='$(abs_builddir)/.libs' \ - clean -endif - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libbluray.pc - - -# -# examples -# - -#SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -#SET_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/file -I$(top_srcdir)/src/libbluray/bdnav - -if USING_EXAMPLES - -#AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) - -noinst_PROGRAMS = \ - bdsplice \ - clpi_dump \ - hdmv_test \ - index_dump \ - libbluray_test \ - list_titles \ - mobj_dump \ - mpls_dump \ - sound_dump - -if USING_BDJAVA -noinst_PROGRAMS += \ - bdj_test -endif - -bin_PROGRAMS = \ - bd_info - -bdsplice_SOURCES = examples/bdsplice.c -bdsplice_LDADD = libbluray.la - -mpls_dump_CFLAGS = $(AM_CFLAGS) -mpls_dump_SOURCES = \ - examples/mpls_dump.c \ - examples/util.c \ - examples/util.h \ - file/file_posix.c \ - libbluray/bdnav/clpi_parse.c \ - libbluray/bdnav/extdata_parse.c \ - libbluray/bdnav/mpls_parse.c \ - util/bits.c \ - util/logging.c \ - util/strutl.c -if HAVE_WIN32 -mpls_dump_SOURCES += \ - file/dir_win32.c -else -mpls_dump_SOURCES += \ - file/dir_posix.c -endif - -clpi_dump_CFLAGS = $(AM_CFLAGS) -clpi_dump_SOURCES = \ - examples/clpi_dump.c \ - examples/util.c \ - examples/util.h -clpi_dump_LDADD = libbluray.la - -index_dump_CFLAGS = $(AM_CFLAGS) -index_dump_SOURCES = \ - examples/index_dump.c \ - file/file_posix.c \ - libbluray/bdnav/index_parse.c \ - util/bits.c \ - util/logging.c - -mobj_dump_CFLAGS = $(AM_CFLAGS) -mobj_dump_SOURCES = \ - examples/mobj_dump.c \ - file/file_posix.c \ - libbluray/hdmv/mobj_parse.c \ - libbluray/hdmv/mobj_print.c \ - util/bits.c \ - util/logging.c - -sound_dump_SOURCES = examples/sound_dump.c -sound_dump_LDADD = libbluray.la - -libbluray_test_SOURCES = examples/libbluray_test.c -libbluray_test_LDADD = libbluray.la - -hdmv_test_SOURCES = examples/hdmv_test.c -hdmv_test_LDADD = libbluray.la - -list_titles_SOURCES = examples/list_titles.c -list_titles_LDADD = libbluray.la - -bd_info_SOURCES = examples/bd_info.c -bd_info_LDADD = libbluray.la - -bdj_test_SOURCES = examples/bdj_test.c -bdj_test_LDADD = libbluray.la - -endif diff -Nru libbluray-0.5.0/src/Makefile.in libbluray-0.8.1/src/Makefile.in --- libbluray-0.5.0/src/Makefile.in 2013-12-21 08:36:05.000000000 +0000 +++ libbluray-0.8.1/src/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,1932 +0,0 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@HAVE_DARWIN_TRUE@am__append_1 = \ -@HAVE_DARWIN_TRUE@ file/dir_posix.c \ -@HAVE_DARWIN_TRUE@ file/dl_posix.c \ -@HAVE_DARWIN_TRUE@ file/dirs_darwin.c - -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dir_win32.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dl_win32.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.c - -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__append_3 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dir_posix.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dl_posix.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dirs_xdg.c - -@USING_BDJAVA_TRUE@am__append_4 = \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj_private.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj_util.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj_util.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdjo_parser.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdjo_parser.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/common.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDGraphics.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDGraphics.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDFontMetrics.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDFontMetrics.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Libbluray.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Libbluray.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Logger.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Logger.c \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/register_native.h \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/register_native.c - -@USING_BDJAVA_TRUE@am__append_5 = $(BDJAVA_CFLAGS) -@USING_EXAMPLES_TRUE@noinst_PROGRAMS = bdsplice$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ clpi_dump$(EXEEXT) hdmv_test$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ index_dump$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ libbluray_test$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ list_titles$(EXEEXT) mobj_dump$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ mpls_dump$(EXEEXT) sound_dump$(EXEEXT) \ -@USING_EXAMPLES_TRUE@ $(am__EXEEXT_1) -@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@am__append_6 = \ -@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@ bdj_test - -@USING_EXAMPLES_TRUE@bin_PROGRAMS = bd_info$(EXEEXT) -@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@am__append_7 = \ -@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@ file/dir_win32.c - -@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@am__append_8 = \ -@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@ file/dir_posix.c - -subdir = src -DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/libbluray.pc.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ - $(top_srcdir)/m4/ax_prog_doxygen.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libbluray.pc -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(pkgincludedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libbluray_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am__libbluray_la_SOURCES_DIST = libbluray/bluray.h libbluray/bluray.c \ - libbluray/bluray_internal.h libbluray/register.h \ - libbluray/register.c libbluray/keys.h libbluray/bdnav \ - libbluray/bdnav/bdparse.h libbluray/bdnav/uo_mask_table.h \ - libbluray/bdnav/navigation.h libbluray/bdnav/index_parse.c \ - libbluray/bdnav/navigation.c libbluray/bdnav/sound_parse.c \ - libbluray/bdnav/sound_parse.h libbluray/bdnav/mpls_parse.h \ - libbluray/bdnav/clpi_parse.c libbluray/bdnav/mpls_parse.c \ - libbluray/bdnav/index_parse.h libbluray/bdnav/clpi_parse.h \ - libbluray/bdnav/meta_data.h libbluray/bdnav/meta_parse.c \ - libbluray/bdnav/meta_parse.h libbluray/bdnav/extdata_parse.h \ - libbluray/bdnav/extdata_parse.c libbluray/bdnav/bdid_parse.h \ - libbluray/bdnav/bdid_parse.c libbluray/decoders \ - libbluray/decoders/pes_buffer.h \ - libbluray/decoders/pes_buffer.c \ - libbluray/decoders/m2ts_demux.h \ - libbluray/decoders/m2ts_demux.c \ - libbluray/decoders/m2ts_filter.h \ - libbluray/decoders/m2ts_filter.c libbluray/decoders/overlay.h \ - libbluray/decoders/pg.h libbluray/decoders/pg_decode.h \ - libbluray/decoders/pg_decode.c libbluray/decoders/ig.h \ - libbluray/decoders/ig_decode.h libbluray/decoders/ig_decode.c \ - libbluray/decoders/rle.h libbluray/decoders/rle.c \ - libbluray/decoders/textst.h libbluray/decoders/textst_decode.h \ - libbluray/decoders/textst_decode.c \ - libbluray/decoders/textst_render.h \ - libbluray/decoders/textst_render.c \ - libbluray/decoders/graphics_processor.h \ - libbluray/decoders/graphics_processor.c \ - libbluray/decoders/graphics_controller.h \ - libbluray/decoders/graphics_controller.c libbluray/hdmv \ - libbluray/hdmv/hdmv_insn.h libbluray/hdmv/hdmv_vm.h \ - libbluray/hdmv/hdmv_vm.c libbluray/hdmv/mobj_parse.h \ - libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - file/file.h file/file_posix.c file/dirs.h file/dl.h \ - file/filesystem.h file/filesystem.c file/libaacs.h \ - file/libaacs.c file/libbdplus.h file/libbdplus.c \ - util/attributes.h util/refcnt.h util/refcnt.c util/strutl.c \ - util/strutl.h util/macro.h util/mutex.h util/time.h \ - util/logging.c util/log_control.h util/bits.h util/bits.c \ - util/logging.h file/dir_posix.c file/dl_posix.c \ - file/dirs_darwin.c file/dir_win32.c file/dl_win32.c \ - file/dirs_win32.c file/dirs_xdg.c libbluray/bdj/bdj.h \ - libbluray/bdj/bdj_private.h libbluray/bdj/bdj_util.h \ - libbluray/bdj/bdj_util.c libbluray/bdj/bdj.c \ - libbluray/bdj/bdjo_parser.h libbluray/bdj/bdjo_parser.c \ - libbluray/bdj/common.h \ - libbluray/bdj/native/java_awt_BDGraphics.h \ - libbluray/bdj/native/java_awt_BDGraphics.c \ - libbluray/bdj/native/java_awt_BDFontMetrics.h \ - libbluray/bdj/native/java_awt_BDFontMetrics.c \ - libbluray/bdj/native/org_videolan_Libbluray.h \ - libbluray/bdj/native/org_videolan_Libbluray.c \ - libbluray/bdj/native/org_videolan_Logger.h \ - libbluray/bdj/native/org_videolan_Logger.c \ - libbluray/bdj/native/register_native.h \ - libbluray/bdj/native/register_native.c -am__dirstamp = $(am__leading_dot)dirstamp -@HAVE_DARWIN_TRUE@am__objects_1 = file/dir_posix.lo file/dl_posix.lo \ -@HAVE_DARWIN_TRUE@ file/dirs_darwin.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = file/dir_win32.lo \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dl_win32.lo \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dir_posix.lo \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dl_posix.lo \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dirs_xdg.lo -@USING_BDJAVA_TRUE@am__objects_4 = libbluray/bdj/bdj_util.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdj.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/bdjo_parser.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDGraphics.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/java_awt_BDFontMetrics.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Libbluray.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/org_videolan_Logger.lo \ -@USING_BDJAVA_TRUE@ libbluray/bdj/native/register_native.lo -am_libbluray_la_OBJECTS = libbluray/bluray.lo libbluray/register.lo \ - libbluray/bdnav/index_parse.lo libbluray/bdnav/navigation.lo \ - libbluray/bdnav/sound_parse.lo libbluray/bdnav/clpi_parse.lo \ - libbluray/bdnav/mpls_parse.lo libbluray/bdnav/meta_parse.lo \ - libbluray/bdnav/extdata_parse.lo libbluray/bdnav/bdid_parse.lo \ - libbluray/decoders/pes_buffer.lo \ - libbluray/decoders/m2ts_demux.lo \ - libbluray/decoders/m2ts_filter.lo \ - libbluray/decoders/pg_decode.lo \ - libbluray/decoders/ig_decode.lo libbluray/decoders/rle.lo \ - libbluray/decoders/textst_decode.lo \ - libbluray/decoders/textst_render.lo \ - libbluray/decoders/graphics_processor.lo \ - libbluray/decoders/graphics_controller.lo \ - libbluray/hdmv/hdmv_vm.lo libbluray/hdmv/mobj_parse.lo \ - libbluray/hdmv/mobj_print.lo file/file_posix.lo \ - file/filesystem.lo file/libaacs.lo file/libbdplus.lo \ - util/refcnt.lo util/strutl.lo util/logging.lo util/bits.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) \ - $(am__objects_4) -libbluray_la_OBJECTS = $(am_libbluray_la_OBJECTS) -libbluray_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libbluray_la_LDFLAGS) $(LDFLAGS) -o $@ -@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@am__EXEEXT_1 = \ -@USING_BDJAVA_TRUE@@USING_EXAMPLES_TRUE@ bdj_test$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -am__bd_info_SOURCES_DIST = examples/bd_info.c -@USING_EXAMPLES_TRUE@am_bd_info_OBJECTS = examples/bd_info.$(OBJEXT) -bd_info_OBJECTS = $(am_bd_info_OBJECTS) -@USING_EXAMPLES_TRUE@bd_info_DEPENDENCIES = libbluray.la -am__bdj_test_SOURCES_DIST = examples/bdj_test.c -@USING_EXAMPLES_TRUE@am_bdj_test_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/bdj_test.$(OBJEXT) -bdj_test_OBJECTS = $(am_bdj_test_OBJECTS) -@USING_EXAMPLES_TRUE@bdj_test_DEPENDENCIES = libbluray.la -am__bdsplice_SOURCES_DIST = examples/bdsplice.c -@USING_EXAMPLES_TRUE@am_bdsplice_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/bdsplice.$(OBJEXT) -bdsplice_OBJECTS = $(am_bdsplice_OBJECTS) -@USING_EXAMPLES_TRUE@bdsplice_DEPENDENCIES = libbluray.la -am__clpi_dump_SOURCES_DIST = examples/clpi_dump.c examples/util.c \ - examples/util.h -@USING_EXAMPLES_TRUE@am_clpi_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/clpi_dump-clpi_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ examples/clpi_dump-util.$(OBJEXT) -clpi_dump_OBJECTS = $(am_clpi_dump_OBJECTS) -@USING_EXAMPLES_TRUE@clpi_dump_DEPENDENCIES = libbluray.la -clpi_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(clpi_dump_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__hdmv_test_SOURCES_DIST = examples/hdmv_test.c -@USING_EXAMPLES_TRUE@am_hdmv_test_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/hdmv_test.$(OBJEXT) -hdmv_test_OBJECTS = $(am_hdmv_test_OBJECTS) -@USING_EXAMPLES_TRUE@hdmv_test_DEPENDENCIES = libbluray.la -am__index_dump_SOURCES_DIST = examples/index_dump.c file/file_posix.c \ - libbluray/bdnav/index_parse.c util/bits.c util/logging.c -@USING_EXAMPLES_TRUE@am_index_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/index_dump-index_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/index_dump-file_posix.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/index_dump-index_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/index_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/index_dump-logging.$(OBJEXT) -index_dump_OBJECTS = $(am_index_dump_OBJECTS) -index_dump_LDADD = $(LDADD) -index_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(index_dump_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__libbluray_test_SOURCES_DIST = examples/libbluray_test.c -@USING_EXAMPLES_TRUE@am_libbluray_test_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/libbluray_test.$(OBJEXT) -libbluray_test_OBJECTS = $(am_libbluray_test_OBJECTS) -@USING_EXAMPLES_TRUE@libbluray_test_DEPENDENCIES = libbluray.la -am__list_titles_SOURCES_DIST = examples/list_titles.c -@USING_EXAMPLES_TRUE@am_list_titles_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/list_titles.$(OBJEXT) -list_titles_OBJECTS = $(am_list_titles_OBJECTS) -@USING_EXAMPLES_TRUE@list_titles_DEPENDENCIES = libbluray.la -am__mobj_dump_SOURCES_DIST = examples/mobj_dump.c file/file_posix.c \ - libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - util/bits.c util/logging.c -@USING_EXAMPLES_TRUE@am_mobj_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/mobj_dump-mobj_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/mobj_dump-file_posix.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mobj_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mobj_dump-logging.$(OBJEXT) -mobj_dump_OBJECTS = $(am_mobj_dump_OBJECTS) -mobj_dump_LDADD = $(LDADD) -mobj_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mobj_dump_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__mpls_dump_SOURCES_DIST = examples/mpls_dump.c examples/util.c \ - examples/util.h file/file_posix.c libbluray/bdnav/clpi_parse.c \ - libbluray/bdnav/extdata_parse.c libbluray/bdnav/mpls_parse.c \ - util/bits.c util/logging.c util/strutl.c file/dir_win32.c \ - file/dir_posix.c -@HAVE_WIN32_TRUE@@USING_EXAMPLES_TRUE@am__objects_5 = file/mpls_dump-dir_win32.$(OBJEXT) -@HAVE_WIN32_FALSE@@USING_EXAMPLES_TRUE@am__objects_6 = file/mpls_dump-dir_posix.$(OBJEXT) -@USING_EXAMPLES_TRUE@am_mpls_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/mpls_dump-mpls_dump.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ examples/mpls_dump-util.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ file/mpls_dump-file_posix.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-bits.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-logging.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ util/mpls_dump-strutl.$(OBJEXT) \ -@USING_EXAMPLES_TRUE@ $(am__objects_5) $(am__objects_6) -mpls_dump_OBJECTS = $(am_mpls_dump_OBJECTS) -mpls_dump_LDADD = $(LDADD) -mpls_dump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mpls_dump_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am__sound_dump_SOURCES_DIST = examples/sound_dump.c -@USING_EXAMPLES_TRUE@am_sound_dump_OBJECTS = \ -@USING_EXAMPLES_TRUE@ examples/sound_dump.$(OBJEXT) -sound_dump_OBJECTS = $(am_sound_dump_OBJECTS) -@USING_EXAMPLES_TRUE@sound_dump_DEPENDENCIES = libbluray.la -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libbluray_la_SOURCES) $(bd_info_SOURCES) \ - $(bdj_test_SOURCES) $(bdsplice_SOURCES) $(clpi_dump_SOURCES) \ - $(hdmv_test_SOURCES) $(index_dump_SOURCES) \ - $(libbluray_test_SOURCES) $(list_titles_SOURCES) \ - $(mobj_dump_SOURCES) $(mpls_dump_SOURCES) \ - $(sound_dump_SOURCES) -DIST_SOURCES = $(am__libbluray_la_SOURCES_DIST) \ - $(am__bd_info_SOURCES_DIST) $(am__bdj_test_SOURCES_DIST) \ - $(am__bdsplice_SOURCES_DIST) $(am__clpi_dump_SOURCES_DIST) \ - $(am__hdmv_test_SOURCES_DIST) $(am__index_dump_SOURCES_DIST) \ - $(am__libbluray_test_SOURCES_DIST) \ - $(am__list_titles_SOURCES_DIST) $(am__mobj_dump_SOURCES_DIST) \ - $(am__mpls_dump_SOURCES_DIST) $(am__sound_dump_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(jar_DATA) $(pkgconfig_DATA) -HEADERS = $(pkginclude_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BDJAVA_CFLAGS = @BDJAVA_CFLAGS@ -BDJ_BOOTCLASSPATH = @BDJ_BOOTCLASSPATH@ -BDJ_TYPE = @BDJ_TYPE@ -BLURAY_VERSION_MAJOR = @BLURAY_VERSION_MAJOR@ -BLURAY_VERSION_MICRO = @BLURAY_VERSION_MICRO@ -BLURAY_VERSION_MINOR = @BLURAY_VERSION_MINOR@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -DX_CONFIG = @DX_CONFIG@ -DX_DOCDIR = @DX_DOCDIR@ -DX_DOT = @DX_DOT@ -DX_DOXYGEN = @DX_DOXYGEN@ -DX_DVIPS = @DX_DVIPS@ -DX_EGREP = @DX_EGREP@ -DX_ENV = @DX_ENV@ -DX_FLAG_chi = @DX_FLAG_chi@ -DX_FLAG_chm = @DX_FLAG_chm@ -DX_FLAG_doc = @DX_FLAG_doc@ -DX_FLAG_dot = @DX_FLAG_dot@ -DX_FLAG_html = @DX_FLAG_html@ -DX_FLAG_man = @DX_FLAG_man@ -DX_FLAG_pdf = @DX_FLAG_pdf@ -DX_FLAG_ps = @DX_FLAG_ps@ -DX_FLAG_rtf = @DX_FLAG_rtf@ -DX_FLAG_xml = @DX_FLAG_xml@ -DX_HHC = @DX_HHC@ -DX_LATEX = @DX_LATEX@ -DX_MAKEINDEX = @DX_MAKEINDEX@ -DX_PDFLATEX = @DX_PDFLATEX@ -DX_PERL = @DX_PERL@ -DX_PROJECT = @DX_PROJECT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FT2_CFLAGS = @FT2_CFLAGS@ -FT2_LIBS = @FT2_LIBS@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JDK_HOME = @JDK_HOME@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ -LIBXML2_LIBS = @LIBXML2_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_VERSION_INFO = @LT_VERSION_INFO@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) \ - $(FT2_CFLAGS) $(am__append_5) -EXTRA_DIST = \ - libbluray/bdj/build.xml \ - libbluray/bdj/java \ - libbluray/bdj/java-j2me \ - libbluray/bdj/java-j2se - -lib_LTLIBRARIES = libbluray.la -libbluray_la_SOURCES = libbluray/bluray.h libbluray/bluray.c \ - libbluray/bluray_internal.h libbluray/register.h \ - libbluray/register.c libbluray/keys.h libbluray/bdnav \ - libbluray/bdnav/bdparse.h libbluray/bdnav/uo_mask_table.h \ - libbluray/bdnav/navigation.h libbluray/bdnav/index_parse.c \ - libbluray/bdnav/navigation.c libbluray/bdnav/sound_parse.c \ - libbluray/bdnav/sound_parse.h libbluray/bdnav/mpls_parse.h \ - libbluray/bdnav/clpi_parse.c libbluray/bdnav/mpls_parse.c \ - libbluray/bdnav/index_parse.h libbluray/bdnav/clpi_parse.h \ - libbluray/bdnav/meta_data.h libbluray/bdnav/meta_parse.c \ - libbluray/bdnav/meta_parse.h libbluray/bdnav/extdata_parse.h \ - libbluray/bdnav/extdata_parse.c libbluray/bdnav/bdid_parse.h \ - libbluray/bdnav/bdid_parse.c libbluray/decoders \ - libbluray/decoders/pes_buffer.h \ - libbluray/decoders/pes_buffer.c \ - libbluray/decoders/m2ts_demux.h \ - libbluray/decoders/m2ts_demux.c \ - libbluray/decoders/m2ts_filter.h \ - libbluray/decoders/m2ts_filter.c libbluray/decoders/overlay.h \ - libbluray/decoders/pg.h libbluray/decoders/pg_decode.h \ - libbluray/decoders/pg_decode.c libbluray/decoders/ig.h \ - libbluray/decoders/ig_decode.h libbluray/decoders/ig_decode.c \ - libbluray/decoders/rle.h libbluray/decoders/rle.c \ - libbluray/decoders/textst.h libbluray/decoders/textst_decode.h \ - libbluray/decoders/textst_decode.c \ - libbluray/decoders/textst_render.h \ - libbluray/decoders/textst_render.c \ - libbluray/decoders/graphics_processor.h \ - libbluray/decoders/graphics_processor.c \ - libbluray/decoders/graphics_controller.h \ - libbluray/decoders/graphics_controller.c libbluray/hdmv \ - libbluray/hdmv/hdmv_insn.h libbluray/hdmv/hdmv_vm.h \ - libbluray/hdmv/hdmv_vm.c libbluray/hdmv/mobj_parse.h \ - libbluray/hdmv/mobj_parse.c libbluray/hdmv/mobj_print.c \ - file/file.h file/file_posix.c file/dirs.h file/dl.h \ - file/filesystem.h file/filesystem.c file/libaacs.h \ - file/libaacs.c file/libbdplus.h file/libbdplus.c \ - util/attributes.h util/refcnt.h util/refcnt.c util/strutl.c \ - util/strutl.h util/macro.h util/mutex.h util/time.h \ - util/logging.c util/log_control.h util/bits.h util/bits.c \ - util/logging.h $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) -libbluray_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -libbluray_la_LIBADD = $(LIBXML2_LIBS) $(FT2_LIBS) -pkginclude_HEADERS = \ - file/filesystem.h \ - libbluray/bdnav/clpi_data.h \ - libbluray/bdnav/meta_data.h \ - libbluray/bluray-version.h \ - libbluray/bluray.h \ - libbluray/decoders/overlay.h \ - libbluray/keys.h \ - util/log_control.h - -@USING_BDJAVA_TRUE@jardir = $(libdir)/libbluray/ -@USING_BDJAVA_TRUE@jar_DATA = $(top_builddir)/src/.libs/libbluray.jar -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libbluray.pc -@USING_EXAMPLES_TRUE@bdsplice_SOURCES = examples/bdsplice.c -@USING_EXAMPLES_TRUE@bdsplice_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@mpls_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@mpls_dump_SOURCES = examples/mpls_dump.c \ -@USING_EXAMPLES_TRUE@ examples/util.c examples/util.h \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/clpi_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/extdata_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/mpls_parse.c util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c util/strutl.c \ -@USING_EXAMPLES_TRUE@ $(am__append_7) $(am__append_8) -@USING_EXAMPLES_TRUE@clpi_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@clpi_dump_SOURCES = \ -@USING_EXAMPLES_TRUE@ examples/clpi_dump.c \ -@USING_EXAMPLES_TRUE@ examples/util.c \ -@USING_EXAMPLES_TRUE@ examples/util.h - -@USING_EXAMPLES_TRUE@clpi_dump_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@index_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@index_dump_SOURCES = \ -@USING_EXAMPLES_TRUE@ examples/index_dump.c \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/bdnav/index_parse.c \ -@USING_EXAMPLES_TRUE@ util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c - -@USING_EXAMPLES_TRUE@mobj_dump_CFLAGS = $(AM_CFLAGS) -@USING_EXAMPLES_TRUE@mobj_dump_SOURCES = \ -@USING_EXAMPLES_TRUE@ examples/mobj_dump.c \ -@USING_EXAMPLES_TRUE@ file/file_posix.c \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_parse.c \ -@USING_EXAMPLES_TRUE@ libbluray/hdmv/mobj_print.c \ -@USING_EXAMPLES_TRUE@ util/bits.c \ -@USING_EXAMPLES_TRUE@ util/logging.c - -@USING_EXAMPLES_TRUE@sound_dump_SOURCES = examples/sound_dump.c -@USING_EXAMPLES_TRUE@sound_dump_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@libbluray_test_SOURCES = examples/libbluray_test.c -@USING_EXAMPLES_TRUE@libbluray_test_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@hdmv_test_SOURCES = examples/hdmv_test.c -@USING_EXAMPLES_TRUE@hdmv_test_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@list_titles_SOURCES = examples/list_titles.c -@USING_EXAMPLES_TRUE@list_titles_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@bd_info_SOURCES = examples/bd_info.c -@USING_EXAMPLES_TRUE@bd_info_LDADD = libbluray.la -@USING_EXAMPLES_TRUE@bdj_test_SOURCES = examples/bdj_test.c -@USING_EXAMPLES_TRUE@bdj_test_LDADD = libbluray.la -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -libbluray.pc: $(top_builddir)/config.status $(srcdir)/libbluray.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libbluray/$(am__dirstamp): - @$(MKDIR_P) libbluray - @: > libbluray/$(am__dirstamp) -libbluray/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/$(DEPDIR) - @: > libbluray/$(DEPDIR)/$(am__dirstamp) -libbluray/bluray.lo: libbluray/$(am__dirstamp) \ - libbluray/$(DEPDIR)/$(am__dirstamp) -libbluray/register.lo: libbluray/$(am__dirstamp) \ - libbluray/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdnav - @: > libbluray/bdnav/$(am__dirstamp) -libbluray/bdnav/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdnav/$(DEPDIR) - @: > libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/index_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/navigation.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/sound_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/clpi_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/meta_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/extdata_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/bdid_parse.lo: libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/$(am__dirstamp): - @$(MKDIR_P) libbluray/decoders - @: > libbluray/decoders/$(am__dirstamp) -libbluray/decoders/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/decoders/$(DEPDIR) - @: > libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/pes_buffer.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/m2ts_demux.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/m2ts_filter.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/pg_decode.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/ig_decode.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/rle.lo: libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/textst_decode.lo: \ - libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/textst_render.lo: \ - libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/graphics_processor.lo: \ - libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/decoders/graphics_controller.lo: \ - libbluray/decoders/$(am__dirstamp) \ - libbluray/decoders/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/$(am__dirstamp): - @$(MKDIR_P) libbluray/hdmv - @: > libbluray/hdmv/$(am__dirstamp) -libbluray/hdmv/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/hdmv/$(DEPDIR) - @: > libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/hdmv_vm.lo: libbluray/hdmv/$(am__dirstamp) \ - libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/mobj_parse.lo: libbluray/hdmv/$(am__dirstamp) \ - libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/mobj_print.lo: libbluray/hdmv/$(am__dirstamp) \ - libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -file/$(am__dirstamp): - @$(MKDIR_P) file - @: > file/$(am__dirstamp) -file/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) file/$(DEPDIR) - @: > file/$(DEPDIR)/$(am__dirstamp) -file/file_posix.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/filesystem.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/libaacs.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/libbdplus.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -util/$(am__dirstamp): - @$(MKDIR_P) util - @: > util/$(am__dirstamp) -util/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) util/$(DEPDIR) - @: > util/$(DEPDIR)/$(am__dirstamp) -util/refcnt.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -util/strutl.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -util/logging.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -util/bits.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -file/dir_posix.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/dl_posix.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/dirs_darwin.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/dir_win32.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/dl_win32.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/dirs_win32.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/dirs_xdg.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdj - @: > libbluray/bdj/$(am__dirstamp) -libbluray/bdj/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdj/$(DEPDIR) - @: > libbluray/bdj/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/bdj_util.lo: libbluray/bdj/$(am__dirstamp) \ - libbluray/bdj/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/bdj.lo: libbluray/bdj/$(am__dirstamp) \ - libbluray/bdj/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/bdjo_parser.lo: libbluray/bdj/$(am__dirstamp) \ - libbluray/bdj/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdj/native - @: > libbluray/bdj/native/$(am__dirstamp) -libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libbluray/bdj/native/$(DEPDIR) - @: > libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/java_awt_BDGraphics.lo: \ - libbluray/bdj/native/$(am__dirstamp) \ - libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/java_awt_BDFontMetrics.lo: \ - libbluray/bdj/native/$(am__dirstamp) \ - libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/org_videolan_Libbluray.lo: \ - libbluray/bdj/native/$(am__dirstamp) \ - libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/org_videolan_Logger.lo: \ - libbluray/bdj/native/$(am__dirstamp) \ - libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray/bdj/native/register_native.lo: \ - libbluray/bdj/native/$(am__dirstamp) \ - libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) -libbluray.la: $(libbluray_la_OBJECTS) $(libbluray_la_DEPENDENCIES) $(EXTRA_libbluray_la_DEPENDENCIES) - $(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 -examples/$(am__dirstamp): - @$(MKDIR_P) examples - @: > examples/$(am__dirstamp) -examples/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) examples/$(DEPDIR) - @: > examples/$(DEPDIR)/$(am__dirstamp) -examples/bd_info.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -bd_info$(EXEEXT): $(bd_info_OBJECTS) $(bd_info_DEPENDENCIES) $(EXTRA_bd_info_DEPENDENCIES) - @rm -f bd_info$(EXEEXT) - $(LINK) $(bd_info_OBJECTS) $(bd_info_LDADD) $(LIBS) -examples/bdj_test.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -bdj_test$(EXEEXT): $(bdj_test_OBJECTS) $(bdj_test_DEPENDENCIES) $(EXTRA_bdj_test_DEPENDENCIES) - @rm -f bdj_test$(EXEEXT) - $(LINK) $(bdj_test_OBJECTS) $(bdj_test_LDADD) $(LIBS) -examples/bdsplice.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -bdsplice$(EXEEXT): $(bdsplice_OBJECTS) $(bdsplice_DEPENDENCIES) $(EXTRA_bdsplice_DEPENDENCIES) - @rm -f bdsplice$(EXEEXT) - $(LINK) $(bdsplice_OBJECTS) $(bdsplice_LDADD) $(LIBS) -examples/clpi_dump-clpi_dump.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -examples/clpi_dump-util.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -clpi_dump$(EXEEXT): $(clpi_dump_OBJECTS) $(clpi_dump_DEPENDENCIES) $(EXTRA_clpi_dump_DEPENDENCIES) - @rm -f clpi_dump$(EXEEXT) - $(clpi_dump_LINK) $(clpi_dump_OBJECTS) $(clpi_dump_LDADD) $(LIBS) -examples/hdmv_test.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -hdmv_test$(EXEEXT): $(hdmv_test_OBJECTS) $(hdmv_test_DEPENDENCIES) $(EXTRA_hdmv_test_DEPENDENCIES) - @rm -f hdmv_test$(EXEEXT) - $(LINK) $(hdmv_test_OBJECTS) $(hdmv_test_LDADD) $(LIBS) -examples/index_dump-index_dump.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -file/index_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/index_dump-index_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -util/index_dump-bits.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/index_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -index_dump$(EXEEXT): $(index_dump_OBJECTS) $(index_dump_DEPENDENCIES) $(EXTRA_index_dump_DEPENDENCIES) - @rm -f index_dump$(EXEEXT) - $(index_dump_LINK) $(index_dump_OBJECTS) $(index_dump_LDADD) $(LIBS) -examples/libbluray_test.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -libbluray_test$(EXEEXT): $(libbluray_test_OBJECTS) $(libbluray_test_DEPENDENCIES) $(EXTRA_libbluray_test_DEPENDENCIES) - @rm -f libbluray_test$(EXEEXT) - $(LINK) $(libbluray_test_OBJECTS) $(libbluray_test_LDADD) $(LIBS) -examples/list_titles.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -list_titles$(EXEEXT): $(list_titles_OBJECTS) $(list_titles_DEPENDENCIES) $(EXTRA_list_titles_DEPENDENCIES) - @rm -f list_titles$(EXEEXT) - $(LINK) $(list_titles_OBJECTS) $(list_titles_LDADD) $(LIBS) -examples/mobj_dump-mobj_dump.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -file/mobj_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT): \ - libbluray/hdmv/$(am__dirstamp) \ - libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT): \ - libbluray/hdmv/$(am__dirstamp) \ - libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) -util/mobj_dump-bits.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/mobj_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -mobj_dump$(EXEEXT): $(mobj_dump_OBJECTS) $(mobj_dump_DEPENDENCIES) $(EXTRA_mobj_dump_DEPENDENCIES) - @rm -f mobj_dump$(EXEEXT) - $(mobj_dump_LINK) $(mobj_dump_OBJECTS) $(mobj_dump_LDADD) $(LIBS) -examples/mpls_dump-mpls_dump.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -examples/mpls_dump-util.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-file_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT): \ - libbluray/bdnav/$(am__dirstamp) \ - libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) -util/mpls_dump-bits.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/mpls_dump-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/mpls_dump-strutl.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-dir_win32.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/mpls_dump-dir_posix.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -mpls_dump$(EXEEXT): $(mpls_dump_OBJECTS) $(mpls_dump_DEPENDENCIES) $(EXTRA_mpls_dump_DEPENDENCIES) - @rm -f mpls_dump$(EXEEXT) - $(mpls_dump_LINK) $(mpls_dump_OBJECTS) $(mpls_dump_LDADD) $(LIBS) -examples/sound_dump.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -sound_dump$(EXEEXT): $(sound_dump_OBJECTS) $(sound_dump_DEPENDENCIES) $(EXTRA_sound_dump_DEPENDENCIES) - @rm -f sound_dump$(EXEEXT) - $(LINK) $(sound_dump_OBJECTS) $(sound_dump_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f examples/bd_info.$(OBJEXT) - -rm -f examples/bdj_test.$(OBJEXT) - -rm -f examples/bdsplice.$(OBJEXT) - -rm -f examples/clpi_dump-clpi_dump.$(OBJEXT) - -rm -f examples/clpi_dump-util.$(OBJEXT) - -rm -f examples/hdmv_test.$(OBJEXT) - -rm -f examples/index_dump-index_dump.$(OBJEXT) - -rm -f examples/libbluray_test.$(OBJEXT) - -rm -f examples/list_titles.$(OBJEXT) - -rm -f examples/mobj_dump-mobj_dump.$(OBJEXT) - -rm -f examples/mpls_dump-mpls_dump.$(OBJEXT) - -rm -f examples/mpls_dump-util.$(OBJEXT) - -rm -f examples/sound_dump.$(OBJEXT) - -rm -f file/dir_posix.$(OBJEXT) - -rm -f file/dir_posix.lo - -rm -f file/dir_win32.$(OBJEXT) - -rm -f file/dir_win32.lo - -rm -f file/dirs_darwin.$(OBJEXT) - -rm -f file/dirs_darwin.lo - -rm -f file/dirs_win32.$(OBJEXT) - -rm -f file/dirs_win32.lo - -rm -f file/dirs_xdg.$(OBJEXT) - -rm -f file/dirs_xdg.lo - -rm -f file/dl_posix.$(OBJEXT) - -rm -f file/dl_posix.lo - -rm -f file/dl_win32.$(OBJEXT) - -rm -f file/dl_win32.lo - -rm -f file/file_posix.$(OBJEXT) - -rm -f file/file_posix.lo - -rm -f file/filesystem.$(OBJEXT) - -rm -f file/filesystem.lo - -rm -f file/index_dump-file_posix.$(OBJEXT) - -rm -f file/libaacs.$(OBJEXT) - -rm -f file/libaacs.lo - -rm -f file/libbdplus.$(OBJEXT) - -rm -f file/libbdplus.lo - -rm -f file/mobj_dump-file_posix.$(OBJEXT) - -rm -f file/mpls_dump-dir_posix.$(OBJEXT) - -rm -f file/mpls_dump-dir_win32.$(OBJEXT) - -rm -f file/mpls_dump-file_posix.$(OBJEXT) - -rm -f libbluray/bdj/bdj.$(OBJEXT) - -rm -f libbluray/bdj/bdj.lo - -rm -f libbluray/bdj/bdj_util.$(OBJEXT) - -rm -f libbluray/bdj/bdj_util.lo - -rm -f libbluray/bdj/bdjo_parser.$(OBJEXT) - -rm -f libbluray/bdj/bdjo_parser.lo - -rm -f libbluray/bdj/native/java_awt_BDFontMetrics.$(OBJEXT) - -rm -f libbluray/bdj/native/java_awt_BDFontMetrics.lo - -rm -f libbluray/bdj/native/java_awt_BDGraphics.$(OBJEXT) - -rm -f libbluray/bdj/native/java_awt_BDGraphics.lo - -rm -f libbluray/bdj/native/org_videolan_Libbluray.$(OBJEXT) - -rm -f libbluray/bdj/native/org_videolan_Libbluray.lo - -rm -f libbluray/bdj/native/org_videolan_Logger.$(OBJEXT) - -rm -f libbluray/bdj/native/org_videolan_Logger.lo - -rm -f libbluray/bdj/native/register_native.$(OBJEXT) - -rm -f libbluray/bdj/native/register_native.lo - -rm -f libbluray/bdnav/bdid_parse.$(OBJEXT) - -rm -f libbluray/bdnav/bdid_parse.lo - -rm -f libbluray/bdnav/clpi_parse.$(OBJEXT) - -rm -f libbluray/bdnav/clpi_parse.lo - -rm -f libbluray/bdnav/extdata_parse.$(OBJEXT) - -rm -f libbluray/bdnav/extdata_parse.lo - -rm -f libbluray/bdnav/index_dump-index_parse.$(OBJEXT) - -rm -f libbluray/bdnav/index_parse.$(OBJEXT) - -rm -f libbluray/bdnav/index_parse.lo - -rm -f libbluray/bdnav/meta_parse.$(OBJEXT) - -rm -f libbluray/bdnav/meta_parse.lo - -rm -f libbluray/bdnav/mpls_dump-clpi_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_dump-extdata_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_dump-mpls_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_parse.$(OBJEXT) - -rm -f libbluray/bdnav/mpls_parse.lo - -rm -f libbluray/bdnav/navigation.$(OBJEXT) - -rm -f libbluray/bdnav/navigation.lo - -rm -f libbluray/bdnav/sound_parse.$(OBJEXT) - -rm -f libbluray/bdnav/sound_parse.lo - -rm -f libbluray/bluray.$(OBJEXT) - -rm -f libbluray/bluray.lo - -rm -f libbluray/decoders/graphics_controller.$(OBJEXT) - -rm -f libbluray/decoders/graphics_controller.lo - -rm -f libbluray/decoders/graphics_processor.$(OBJEXT) - -rm -f libbluray/decoders/graphics_processor.lo - -rm -f libbluray/decoders/ig_decode.$(OBJEXT) - -rm -f libbluray/decoders/ig_decode.lo - -rm -f libbluray/decoders/m2ts_demux.$(OBJEXT) - -rm -f libbluray/decoders/m2ts_demux.lo - -rm -f libbluray/decoders/m2ts_filter.$(OBJEXT) - -rm -f libbluray/decoders/m2ts_filter.lo - -rm -f libbluray/decoders/pes_buffer.$(OBJEXT) - -rm -f libbluray/decoders/pes_buffer.lo - -rm -f libbluray/decoders/pg_decode.$(OBJEXT) - -rm -f libbluray/decoders/pg_decode.lo - -rm -f libbluray/decoders/rle.$(OBJEXT) - -rm -f libbluray/decoders/rle.lo - -rm -f libbluray/decoders/textst_decode.$(OBJEXT) - -rm -f libbluray/decoders/textst_decode.lo - -rm -f libbluray/decoders/textst_render.$(OBJEXT) - -rm -f libbluray/decoders/textst_render.lo - -rm -f libbluray/hdmv/hdmv_vm.$(OBJEXT) - -rm -f libbluray/hdmv/hdmv_vm.lo - -rm -f libbluray/hdmv/mobj_dump-mobj_parse.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_dump-mobj_print.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_parse.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_parse.lo - -rm -f libbluray/hdmv/mobj_print.$(OBJEXT) - -rm -f libbluray/hdmv/mobj_print.lo - -rm -f libbluray/register.$(OBJEXT) - -rm -f libbluray/register.lo - -rm -f util/bits.$(OBJEXT) - -rm -f util/bits.lo - -rm -f util/index_dump-bits.$(OBJEXT) - -rm -f util/index_dump-logging.$(OBJEXT) - -rm -f util/logging.$(OBJEXT) - -rm -f util/logging.lo - -rm -f util/mobj_dump-bits.$(OBJEXT) - -rm -f util/mobj_dump-logging.$(OBJEXT) - -rm -f util/mpls_dump-bits.$(OBJEXT) - -rm -f util/mpls_dump-logging.$(OBJEXT) - -rm -f util/mpls_dump-strutl.$(OBJEXT) - -rm -f util/refcnt.$(OBJEXT) - -rm -f util/refcnt.lo - -rm -f util/strutl.$(OBJEXT) - -rm -f util/strutl.lo - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/bd_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/bdj_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/bdsplice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/clpi_dump-clpi_dump.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/clpi_dump-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/hdmv_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/index_dump-index_dump.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/libbluray_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/list_titles.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/mobj_dump-mobj_dump.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/mpls_dump-mpls_dump.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/mpls_dump-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/sound_dump.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dir_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dir_win32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_darwin.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_win32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_xdg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dl_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dl_win32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/file_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/filesystem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/index_dump-file_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/libaacs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/libbdplus.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mobj_dump-file_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-dir_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-dir_win32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/mpls_dump-file_posix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/$(DEPDIR)/bluray.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/$(DEPDIR)/register.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/$(DEPDIR)/bdj.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/$(DEPDIR)/bdj_util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/$(DEPDIR)/bdjo_parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/native/$(DEPDIR)/java_awt_BDFontMetrics.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/native/$(DEPDIR)/java_awt_BDGraphics.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/native/$(DEPDIR)/org_videolan_Libbluray.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/native/$(DEPDIR)/org_videolan_Logger.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdj/native/$(DEPDIR)/register_native.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/bdid_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/clpi_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/extdata_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/index_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/meta_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/mpls_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/navigation.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/bdnav/$(DEPDIR)/sound_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/graphics_controller.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/graphics_processor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/ig_decode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/m2ts_demux.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/m2ts_filter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/pes_buffer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/pg_decode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/rle.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/textst_decode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/decoders/$(DEPDIR)/textst_render.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/hdmv_vm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libbluray/hdmv/$(DEPDIR)/mobj_print.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/bits.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/index_dump-bits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/index_dump-logging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/logging.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mobj_dump-bits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mobj_dump-logging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-bits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-logging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/mpls_dump-strutl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/refcnt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/strutl.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -examples/clpi_dump-clpi_dump.o: examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.o `test -f 'examples/clpi_dump.c' || echo '$(srcdir)/'`examples/clpi_dump.c - -examples/clpi_dump-clpi_dump.obj: examples/clpi_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-clpi_dump.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-clpi_dump.Tpo examples/$(DEPDIR)/clpi_dump-clpi_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/clpi_dump.c' object='examples/clpi_dump-clpi_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-clpi_dump.obj `if test -f 'examples/clpi_dump.c'; then $(CYGPATH_W) 'examples/clpi_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/clpi_dump.c'; fi` - -examples/clpi_dump-util.o: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.o -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/clpi_dump-util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c - -examples/clpi_dump-util.obj: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -MT examples/clpi_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/clpi_dump-util.Tpo -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/clpi_dump-util.Tpo examples/$(DEPDIR)/clpi_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/clpi_dump-util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(clpi_dump_CFLAGS) $(CFLAGS) -c -o examples/clpi_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` - -examples/index_dump-index_dump.o: examples/index_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT examples/index_dump-index_dump.o -MD -MP -MF examples/$(DEPDIR)/index_dump-index_dump.Tpo -c -o examples/index_dump-index_dump.o `test -f 'examples/index_dump.c' || echo '$(srcdir)/'`examples/index_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/index_dump-index_dump.Tpo examples/$(DEPDIR)/index_dump-index_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/index_dump.c' object='examples/index_dump-index_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o examples/index_dump-index_dump.o `test -f 'examples/index_dump.c' || echo '$(srcdir)/'`examples/index_dump.c - -examples/index_dump-index_dump.obj: examples/index_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT examples/index_dump-index_dump.obj -MD -MP -MF examples/$(DEPDIR)/index_dump-index_dump.Tpo -c -o examples/index_dump-index_dump.obj `if test -f 'examples/index_dump.c'; then $(CYGPATH_W) 'examples/index_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/index_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/index_dump-index_dump.Tpo examples/$(DEPDIR)/index_dump-index_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/index_dump.c' object='examples/index_dump-index_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o examples/index_dump-index_dump.obj `if test -f 'examples/index_dump.c'; then $(CYGPATH_W) 'examples/index_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/index_dump.c'; fi` - -file/index_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT file/index_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/index_dump-file_posix.Tpo -c -o file/index_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/index_dump-file_posix.Tpo file/$(DEPDIR)/index_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/index_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o file/index_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c - -file/index_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT file/index_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/index_dump-file_posix.Tpo -c -o file/index_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/index_dump-file_posix.Tpo file/$(DEPDIR)/index_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/index_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o file/index_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` - -libbluray/bdnav/index_dump-index_parse.o: libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/index_dump-index_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo -c -o libbluray/bdnav/index_dump-index_parse.o `test -f 'libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/index_parse.c' object='libbluray/bdnav/index_dump-index_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/index_dump-index_parse.o `test -f 'libbluray/bdnav/index_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/index_parse.c - -libbluray/bdnav/index_dump-index_parse.obj: libbluray/bdnav/index_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/index_dump-index_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo -c -o libbluray/bdnav/index_dump-index_parse.obj `if test -f 'libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/index_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Tpo libbluray/bdnav/$(DEPDIR)/index_dump-index_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/index_parse.c' object='libbluray/bdnav/index_dump-index_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/index_dump-index_parse.obj `if test -f 'libbluray/bdnav/index_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/index_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/index_parse.c'; fi` - -util/index_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-bits.o -MD -MP -MF util/$(DEPDIR)/index_dump-bits.Tpo -c -o util/index_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-bits.Tpo util/$(DEPDIR)/index_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/index_dump-bits.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c - -util/index_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/index_dump-bits.Tpo -c -o util/index_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-bits.Tpo util/$(DEPDIR)/index_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/index_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` - -util/index_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-logging.o -MD -MP -MF util/$(DEPDIR)/index_dump-logging.Tpo -c -o util/index_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-logging.Tpo util/$(DEPDIR)/index_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/index_dump-logging.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c - -util/index_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -MT util/index_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/index_dump-logging.Tpo -c -o util/index_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/index_dump-logging.Tpo util/$(DEPDIR)/index_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/index_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(index_dump_CFLAGS) $(CFLAGS) -c -o util/index_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` - -examples/mobj_dump-mobj_dump.o: examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.o -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.o `test -f 'examples/mobj_dump.c' || echo '$(srcdir)/'`examples/mobj_dump.c - -examples/mobj_dump-mobj_dump.obj: examples/mobj_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT examples/mobj_dump-mobj_dump.obj -MD -MP -MF examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mobj_dump-mobj_dump.Tpo examples/$(DEPDIR)/mobj_dump-mobj_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mobj_dump.c' object='examples/mobj_dump-mobj_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o examples/mobj_dump-mobj_dump.obj `if test -f 'examples/mobj_dump.c'; then $(CYGPATH_W) 'examples/mobj_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mobj_dump.c'; fi` - -file/mobj_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mobj_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c - -file/mobj_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT file/mobj_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/mobj_dump-file_posix.Tpo -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mobj_dump-file_posix.Tpo file/$(DEPDIR)/mobj_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mobj_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o file/mobj_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` - -libbluray/hdmv/mobj_dump-mobj_parse.o: libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.o `test -f 'libbluray/hdmv/mobj_parse.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_parse.c - -libbluray/hdmv/mobj_dump-mobj_parse.obj: libbluray/hdmv/mobj_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_parse.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_parse.c' object='libbluray/hdmv/mobj_dump-mobj_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_parse.obj `if test -f 'libbluray/hdmv/mobj_parse.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_parse.c'; fi` - -libbluray/hdmv/mobj_dump-mobj_print.o: libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.o -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.o `test -f 'libbluray/hdmv/mobj_print.c' || echo '$(srcdir)/'`libbluray/hdmv/mobj_print.c - -libbluray/hdmv/mobj_dump-mobj_print.obj: libbluray/hdmv/mobj_print.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT libbluray/hdmv/mobj_dump-mobj_print.obj -MD -MP -MF libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Tpo libbluray/hdmv/$(DEPDIR)/mobj_dump-mobj_print.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/hdmv/mobj_print.c' object='libbluray/hdmv/mobj_dump-mobj_print.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o libbluray/hdmv/mobj_dump-mobj_print.obj `if test -f 'libbluray/hdmv/mobj_print.c'; then $(CYGPATH_W) 'libbluray/hdmv/mobj_print.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/hdmv/mobj_print.c'; fi` - -util/mobj_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mobj_dump-bits.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c - -util/mobj_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-bits.Tpo -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-bits.Tpo util/$(DEPDIR)/mobj_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mobj_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` - -util/mobj_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.o -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mobj_dump-logging.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c - -util/mobj_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -MT util/mobj_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/mobj_dump-logging.Tpo -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mobj_dump-logging.Tpo util/$(DEPDIR)/mobj_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mobj_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mobj_dump_CFLAGS) $(CFLAGS) -c -o util/mobj_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` - -examples/mpls_dump-mpls_dump.o: examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.o `test -f 'examples/mpls_dump.c' || echo '$(srcdir)/'`examples/mpls_dump.c - -examples/mpls_dump-mpls_dump.obj: examples/mpls_dump.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-mpls_dump.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-mpls_dump.Tpo examples/$(DEPDIR)/mpls_dump-mpls_dump.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/mpls_dump.c' object='examples/mpls_dump-mpls_dump.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-mpls_dump.obj `if test -f 'examples/mpls_dump.c'; then $(CYGPATH_W) 'examples/mpls_dump.c'; else $(CYGPATH_W) '$(srcdir)/examples/mpls_dump.c'; fi` - -examples/mpls_dump-util.o: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.o -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/mpls_dump-util.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.o `test -f 'examples/util.c' || echo '$(srcdir)/'`examples/util.c - -examples/mpls_dump-util.obj: examples/util.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT examples/mpls_dump-util.obj -MD -MP -MF examples/$(DEPDIR)/mpls_dump-util.Tpo -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) examples/$(DEPDIR)/mpls_dump-util.Tpo examples/$(DEPDIR)/mpls_dump-util.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/util.c' object='examples/mpls_dump-util.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o examples/mpls_dump-util.obj `if test -f 'examples/util.c'; then $(CYGPATH_W) 'examples/util.c'; else $(CYGPATH_W) '$(srcdir)/examples/util.c'; fi` - -file/mpls_dump-file_posix.o: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-file_posix.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-file_posix.Tpo -c -o file/mpls_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-file_posix.Tpo file/$(DEPDIR)/mpls_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mpls_dump-file_posix.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-file_posix.o `test -f 'file/file_posix.c' || echo '$(srcdir)/'`file/file_posix.c - -file/mpls_dump-file_posix.obj: file/file_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-file_posix.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-file_posix.Tpo -c -o file/mpls_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-file_posix.Tpo file/$(DEPDIR)/mpls_dump-file_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/file_posix.c' object='file/mpls_dump-file_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-file_posix.obj `if test -f 'file/file_posix.c'; then $(CYGPATH_W) 'file/file_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/file_posix.c'; fi` - -libbluray/bdnav/mpls_dump-clpi_parse.o: libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-clpi_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo -c -o libbluray/bdnav/mpls_dump-clpi_parse.o `test -f 'libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/clpi_parse.c' object='libbluray/bdnav/mpls_dump-clpi_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-clpi_parse.o `test -f 'libbluray/bdnav/clpi_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/clpi_parse.c - -libbluray/bdnav/mpls_dump-clpi_parse.obj: libbluray/bdnav/clpi_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-clpi_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo -c -o libbluray/bdnav/mpls_dump-clpi_parse.obj `if test -f 'libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/clpi_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-clpi_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/clpi_parse.c' object='libbluray/bdnav/mpls_dump-clpi_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-clpi_parse.obj `if test -f 'libbluray/bdnav/clpi_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/clpi_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/clpi_parse.c'; fi` - -libbluray/bdnav/mpls_dump-extdata_parse.o: libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-extdata_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo -c -o libbluray/bdnav/mpls_dump-extdata_parse.o `test -f 'libbluray/bdnav/extdata_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/extdata_parse.c' object='libbluray/bdnav/mpls_dump-extdata_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-extdata_parse.o `test -f 'libbluray/bdnav/extdata_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/extdata_parse.c - -libbluray/bdnav/mpls_dump-extdata_parse.obj: libbluray/bdnav/extdata_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-extdata_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo -c -o libbluray/bdnav/mpls_dump-extdata_parse.obj `if test -f 'libbluray/bdnav/extdata_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/extdata_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/extdata_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-extdata_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/extdata_parse.c' object='libbluray/bdnav/mpls_dump-extdata_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-extdata_parse.obj `if test -f 'libbluray/bdnav/extdata_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/extdata_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/extdata_parse.c'; fi` - -libbluray/bdnav/mpls_dump-mpls_parse.o: libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-mpls_parse.o -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo -c -o libbluray/bdnav/mpls_dump-mpls_parse.o `test -f 'libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/mpls_parse.c' object='libbluray/bdnav/mpls_dump-mpls_parse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-mpls_parse.o `test -f 'libbluray/bdnav/mpls_parse.c' || echo '$(srcdir)/'`libbluray/bdnav/mpls_parse.c - -libbluray/bdnav/mpls_dump-mpls_parse.obj: libbluray/bdnav/mpls_parse.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT libbluray/bdnav/mpls_dump-mpls_parse.obj -MD -MP -MF libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo -c -o libbluray/bdnav/mpls_dump-mpls_parse.obj `if test -f 'libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/mpls_parse.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Tpo libbluray/bdnav/$(DEPDIR)/mpls_dump-mpls_parse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libbluray/bdnav/mpls_parse.c' object='libbluray/bdnav/mpls_dump-mpls_parse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o libbluray/bdnav/mpls_dump-mpls_parse.obj `if test -f 'libbluray/bdnav/mpls_parse.c'; then $(CYGPATH_W) 'libbluray/bdnav/mpls_parse.c'; else $(CYGPATH_W) '$(srcdir)/libbluray/bdnav/mpls_parse.c'; fi` - -util/mpls_dump-bits.o: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-bits.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-bits.Tpo -c -o util/mpls_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-bits.Tpo util/$(DEPDIR)/mpls_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mpls_dump-bits.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-bits.o `test -f 'util/bits.c' || echo '$(srcdir)/'`util/bits.c - -util/mpls_dump-bits.obj: util/bits.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-bits.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-bits.Tpo -c -o util/mpls_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-bits.Tpo util/$(DEPDIR)/mpls_dump-bits.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bits.c' object='util/mpls_dump-bits.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-bits.obj `if test -f 'util/bits.c'; then $(CYGPATH_W) 'util/bits.c'; else $(CYGPATH_W) '$(srcdir)/util/bits.c'; fi` - -util/mpls_dump-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-logging.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-logging.Tpo -c -o util/mpls_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-logging.Tpo util/$(DEPDIR)/mpls_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mpls_dump-logging.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c - -util/mpls_dump-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-logging.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-logging.Tpo -c -o util/mpls_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-logging.Tpo util/$(DEPDIR)/mpls_dump-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='util/mpls_dump-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` - -util/mpls_dump-strutl.o: util/strutl.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.o -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='util/mpls_dump-strutl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c - -util/mpls_dump-strutl.obj: util/strutl.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT util/mpls_dump-strutl.obj -MD -MP -MF util/$(DEPDIR)/mpls_dump-strutl.Tpo -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) util/$(DEPDIR)/mpls_dump-strutl.Tpo util/$(DEPDIR)/mpls_dump-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='util/mpls_dump-strutl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o util/mpls_dump-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` - -file/mpls_dump-dir_win32.o: file/dir_win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_win32.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_win32.Tpo -c -o file/mpls_dump-dir_win32.o `test -f 'file/dir_win32.c' || echo '$(srcdir)/'`file/dir_win32.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_win32.Tpo file/$(DEPDIR)/mpls_dump-dir_win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_win32.c' object='file/mpls_dump-dir_win32.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_win32.o `test -f 'file/dir_win32.c' || echo '$(srcdir)/'`file/dir_win32.c - -file/mpls_dump-dir_win32.obj: file/dir_win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_win32.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_win32.Tpo -c -o file/mpls_dump-dir_win32.obj `if test -f 'file/dir_win32.c'; then $(CYGPATH_W) 'file/dir_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_win32.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_win32.Tpo file/$(DEPDIR)/mpls_dump-dir_win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_win32.c' object='file/mpls_dump-dir_win32.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_win32.obj `if test -f 'file/dir_win32.c'; then $(CYGPATH_W) 'file/dir_win32.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_win32.c'; fi` - -file/mpls_dump-dir_posix.o: file/dir_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_posix.o -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_posix.Tpo -c -o file/mpls_dump-dir_posix.o `test -f 'file/dir_posix.c' || echo '$(srcdir)/'`file/dir_posix.c -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_posix.Tpo file/$(DEPDIR)/mpls_dump-dir_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_posix.c' object='file/mpls_dump-dir_posix.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_posix.o `test -f 'file/dir_posix.c' || echo '$(srcdir)/'`file/dir_posix.c - -file/mpls_dump-dir_posix.obj: file/dir_posix.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -MT file/mpls_dump-dir_posix.obj -MD -MP -MF file/$(DEPDIR)/mpls_dump-dir_posix.Tpo -c -o file/mpls_dump-dir_posix.obj `if test -f 'file/dir_posix.c'; then $(CYGPATH_W) 'file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_posix.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) file/$(DEPDIR)/mpls_dump-dir_posix.Tpo file/$(DEPDIR)/mpls_dump-dir_posix.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dir_posix.c' object='file/mpls_dump-dir_posix.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mpls_dump_CFLAGS) $(CFLAGS) -c -o file/mpls_dump-dir_posix.obj `if test -f 'file/dir_posix.c'; then $(CYGPATH_W) 'file/dir_posix.c'; else $(CYGPATH_W) '$(srcdir)/file/dir_posix.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -rm -rf file/.libs file/_libs - -rm -rf libbluray/.libs libbluray/_libs - -rm -rf libbluray/bdj/.libs libbluray/bdj/_libs - -rm -rf libbluray/bdj/native/.libs libbluray/bdj/native/_libs - -rm -rf libbluray/bdnav/.libs libbluray/bdnav/_libs - -rm -rf libbluray/decoders/.libs libbluray/decoders/_libs - -rm -rf libbluray/hdmv/.libs libbluray/hdmv/_libs - -rm -rf util/.libs util/_libs -install-jarDATA: $(jar_DATA) - @$(NORMAL_INSTALL) - @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(jardir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(jardir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(jardir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(jardir)" || exit $$?; \ - done - -uninstall-jarDATA: - @$(NORMAL_UNINSTALL) - @list='$(jar_DATA)'; test -n "$(jardir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(jardir)'; $(am__uninstall_files_from_dir) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) -install-pkgincludeHEADERS: $(pkginclude_HEADERS) - @$(NORMAL_INSTALL) - @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ - done - -uninstall-pkgincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -@USING_BDJAVA_FALSE@all-local: -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \ - all-local -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f examples/$(DEPDIR)/$(am__dirstamp) - -rm -f examples/$(am__dirstamp) - -rm -f file/$(DEPDIR)/$(am__dirstamp) - -rm -f file/$(am__dirstamp) - -rm -f libbluray/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/$(am__dirstamp) - -rm -f libbluray/bdj/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/bdj/$(am__dirstamp) - -rm -f libbluray/bdj/native/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/bdj/native/$(am__dirstamp) - -rm -f libbluray/bdnav/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/bdnav/$(am__dirstamp) - -rm -f libbluray/decoders/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/decoders/$(am__dirstamp) - -rm -f libbluray/hdmv/$(DEPDIR)/$(am__dirstamp) - -rm -f libbluray/hdmv/$(am__dirstamp) - -rm -f util/$(DEPDIR)/$(am__dirstamp) - -rm -f util/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -@USING_BDJAVA_FALSE@clean-local: -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local clean-noinstPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -rf examples/$(DEPDIR) file/$(DEPDIR) libbluray/$(DEPDIR) libbluray/bdj/$(DEPDIR) libbluray/bdj/native/$(DEPDIR) libbluray/bdnav/$(DEPDIR) libbluray/decoders/$(DEPDIR) libbluray/hdmv/$(DEPDIR) util/$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-jarDATA install-pkgconfigDATA \ - install-pkgincludeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf examples/$(DEPDIR) file/$(DEPDIR) libbluray/$(DEPDIR) libbluray/bdj/$(DEPDIR) libbluray/bdj/native/$(DEPDIR) libbluray/bdnav/$(DEPDIR) libbluray/decoders/$(DEPDIR) libbluray/hdmv/$(DEPDIR) util/$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-jarDATA \ - uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ - uninstall-pkgincludeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ - clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-jarDATA install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-pkgconfigDATA \ - install-pkgincludeHEADERS install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-jarDATA \ - uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ - uninstall-pkgincludeHEADERS - - -@USING_BDJAVA_TRUE@$(top_builddir)/src/.libs/libbluray.jar: all-local - -@USING_BDJAVA_TRUE@all-local: -@USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ -@USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ -@USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ -@USING_BDJAVA_TRUE@ -Dsrc_awt=:java-$(BDJ_TYPE) \ -@USING_BDJAVA_TRUE@ -Dbootclasspath="$(BDJ_BOOTCLASSPATH)" - -@USING_BDJAVA_TRUE@clean-local: -@USING_BDJAVA_TRUE@ ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \ -@USING_BDJAVA_TRUE@ -Dbuild='$(abs_builddir)/libbluray/bdj/build' \ -@USING_BDJAVA_TRUE@ -Ddist='$(abs_builddir)/.libs' \ -@USING_BDJAVA_TRUE@ clean - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru libbluray-0.5.0/src/util/array.c libbluray-0.8.1/src/util/array.c --- libbluray-0.5.0/src/util/array.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/util/array.c 2015-05-15 09:25:06.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "array.h" + +#include "macro.h" + +#include + + +void *array_alloc(size_t n, size_t sz) +{ + size_t size = sizeof(void *) + sz; + if (size < sz) { + return NULL; + } + + unsigned char *p = (unsigned char *)calloc(n, size); + if (!p) { + return NULL; + } + + void **array = (void **)p; + p += n * sizeof(void *); + size_t i; + for (i = 0; i < n; i++, p += sz) { + array[i] = p; + } + + return array; +} + +void array_free(void **p) +{ + if (p && *p) { + X_FREE(*p); + } +} diff -Nru libbluray-0.5.0/src/util/array.h libbluray-0.8.1/src/util/array.h --- libbluray-0.5.0/src/util/array.h 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/util/array.h 2015-01-26 08:01:57.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 Petri Hintukainen + * + * 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 + * . + */ + +#ifndef BD_ARRAY_H_ +#define BD_ARRAY_H_ + +#include "attributes.h" + +#include + +/* + * array_alloc() + * + * Allocate an array of objects. + * Each object is initialized with zeros. + * + * @param n number of objects + * @param sz size of single object + * @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; + +/* + * array_free() + * + * Free array allocated with array_alloc(). + * + * @param p pointer to pointer allocated with bd_array_alloc() + */ +BD_PRIVATE void array_free(void **p); + +#endif // BD_ARRAY_H_ diff -Nru libbluray-0.5.0/src/util/attributes.h libbluray-0.8.1/src/util/attributes.h --- libbluray-0.5.0/src/util/attributes.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/attributes.h 2015-01-26 08:01:57.000000000 +0000 @@ -21,7 +21,11 @@ #define LIBBLURAY_ATTRIBUTES_H_ #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 )) -# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__printf__,format,var))) +# if defined(_WIN32) +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__gnu_printf__,format,var))) +# else +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__printf__,format,var))) +# endif # define BD_ATTR_MALLOC __attribute__((__malloc__)) # define BD_ATTR_PACKED __attribute__((packed)) #else diff -Nru libbluray-0.5.0/src/util/bits.c libbluray-0.8.1/src/util/bits.c --- libbluray-0.5.0/src/util/bits.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/bits.c 2015-04-06 15:44:26.000000000 +0000 @@ -22,16 +22,17 @@ #include "bits.h" +#include "file/file.h" #include "util/logging.h" -#include +#include // SEEK_* /** * \file * This file defines functions, structures for handling streams of bits */ -void bb_init( BITBUFFER *bb, uint8_t *p_data, size_t i_data ) +void bb_init( BITBUFFER *bb, const uint8_t *p_data, size_t i_data ) { bb->p_start = p_data; bb->p = bb->p_start; @@ -54,9 +55,9 @@ bb_init(&bs->bb, bs->buf, bs->size); } -void bb_seek( BITBUFFER *bb, off_t off, int whence) +void bb_seek( BITBUFFER *bb, int64_t off, int whence) { - off_t b; + int64_t b; switch (whence) { case SEEK_CUR: @@ -72,7 +73,7 @@ b = off >> 3; bb->p = &bb->p_start[b]; - ssize_t i_tmp = bb->i_left - (off & 0x07); + int i_tmp = bb->i_left - (off & 0x07); if (i_tmp <= 0) { bb->i_left = 8 + i_tmp; bb->p++; @@ -81,9 +82,9 @@ } } -void bs_seek( BITSTREAM *bs, off_t off, int whence) +void bs_seek( BITSTREAM *bs, int64_t off, int whence) { - off_t b; + int64_t b; switch (whence) { case SEEK_CUR: @@ -121,6 +122,17 @@ } } +void bb_seek_byte( BITBUFFER *bb, int64_t off) +{ + bb_seek(bb, off << 3, SEEK_SET); +} + +void bs_seek_byte( BITSTREAM *s, int64_t off) +{ + bs_seek(s, off << 3, SEEK_SET); +} + + uint32_t bb_read( BITBUFFER *bb, int i_count ) { static const uint32_t i_mask[33] = { @@ -167,7 +179,7 @@ uint32_t bs_read( BITSTREAM *bs, int i_count ) { - ssize_t left; + int left; int bytes = (i_count + 7) >> 3; if (bs->bb.p + bytes >= bs->bb.p_end) { @@ -181,22 +193,21 @@ return bb_read(&bs->bb, i_count); } -void bb_skip( BITBUFFER *bb, ssize_t i_count ) +void bb_skip( BITBUFFER *bb, size_t i_count ) { - bb->i_left -= i_count; + bb->p += i_count >> 3; + bb->i_left -= i_count & 0x07; if( bb->i_left <= 0 ) { - const int i_bytes = ( -bb->i_left + 8 ) / 8; - - bb->p += i_bytes; - bb->i_left += 8 * i_bytes; + bb->p++; + bb->i_left += 8; } } -void bs_skip( BITSTREAM *bs, ssize_t i_count ) +void bs_skip( BITSTREAM *bs, size_t i_count ) { int left; - int bytes = i_count >> 3; + size_t bytes = (i_count + 7) >> 3; if (bs->bb.p + bytes >= bs->bb.p_end) { bs->pos = bs->pos + (bs->bb.p - bs->bb.p_start); diff -Nru libbluray-0.5.0/src/util/bits.h libbluray-0.8.1/src/util/bits.h --- libbluray-0.5.0/src/util/bits.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/bits.h 2015-04-06 15:44:26.000000000 +0000 @@ -23,10 +23,12 @@ #ifndef BD_BITS_H #define BD_BITS_H -#include "file/file.h" +#include "util/attributes.h" +#include "file/filesystem.h" // BD_FILE_H + +#include +#include // size_t -#include -#include /** * \file @@ -36,42 +38,44 @@ #define BF_BUF_SIZE (1024*32) typedef struct { - uint8_t *p_start; - uint8_t *p; - uint8_t *p_end; + const uint8_t *p_start; + const uint8_t *p; + const uint8_t *p_end; - ssize_t i_left; /* i_count number of available bits */ + int i_left; /* i_count number of available bits */ } BITBUFFER; typedef struct { BD_FILE_H *fp; uint8_t buf[BF_BUF_SIZE]; BITBUFFER bb; - off_t pos; - off_t end; + int64_t pos; + int64_t end; size_t size; } BITSTREAM; -BD_PRIVATE void bb_init( BITBUFFER *bb, uint8_t *p_data, size_t i_data ); +BD_PRIVATE void bb_init( BITBUFFER *bb, const uint8_t *p_data, size_t i_data ); BD_PRIVATE void bs_init( BITSTREAM *bs, BD_FILE_H *fp ); -BD_PRIVATE void bb_seek( BITBUFFER *bb, off_t off, int whence); -BD_PRIVATE void bs_seek( BITSTREAM *bs, off_t off, int whence); -BD_PRIVATE void bb_skip( BITBUFFER *bb, ssize_t i_count ); -BD_PRIVATE void bs_skip( BITSTREAM *bs, ssize_t i_count ); +BD_PRIVATE void bb_seek( BITBUFFER *bb, int64_t off, int whence); +BD_PRIVATE void bs_seek( BITSTREAM *bs, int64_t off, int whence); +BD_PRIVATE void bb_seek_byte( BITBUFFER *bb, int64_t off); +BD_PRIVATE void bs_seek_byte( BITSTREAM *s, int64_t off); +BD_PRIVATE void bb_skip( BITBUFFER *bb, size_t i_count ); +BD_PRIVATE void bs_skip( BITSTREAM *bs, size_t i_count ); /* note: i_count must be less than BF_BUF_SIZE */ BD_PRIVATE uint32_t bb_read( BITBUFFER *bb, int i_count ); BD_PRIVATE uint32_t bs_read( BITSTREAM *bs, int i_count ); -static inline off_t bb_pos( const BITBUFFER *bb ) +static inline int64_t bb_pos( const BITBUFFER *bb ) { return 8 * ( bb->p - bb->p_start ) + 8 - bb->i_left; } -static inline off_t bs_pos( const BITSTREAM *bs ) +static inline int64_t bs_pos( const BITSTREAM *bs ) { return bs->pos * 8 + bb_pos(&bs->bb); } -static inline off_t bs_end( const BITSTREAM *bs ) +static inline int64_t bs_end( const BITSTREAM *bs ) { return bs->end * 8; } @@ -80,20 +84,16 @@ { return bb->p >= bb->p_end ? 1: 0 ; } - +/* static inline int bs_eof( const BITSTREAM *bs ) { return file_eof(bs->fp) && bb_eof(&bs->bb); } +*/ -static inline void bb_seek_byte( BITBUFFER *bb, off_t off) +static inline int64_t bs_avail( const BITSTREAM *bs ) { - bb_seek(bb, off << 3, SEEK_SET); -} - -static inline void bs_seek_byte( BITSTREAM *s, off_t off) -{ - bs_seek(s, off << 3, SEEK_SET); + return bs_end(bs) - bs_pos(bs); } static inline void bb_read_bytes( BITBUFFER *bb, uint8_t *buf, int i_count ) @@ -113,6 +113,11 @@ buf[ii] = bs_read(s, 8); } } +static inline void bs_read_string( BITSTREAM *s, char *buf, int i_count ) +{ + bs_read_bytes(s, (uint8_t*)buf, i_count); + buf[i_count] = '\0'; +} static inline uint32_t bb_show( BITBUFFER *bb, int i_count ) { @@ -122,14 +127,14 @@ static inline int bb_is_align( BITBUFFER *bb, uint32_t mask ) { - off_t off = bb_pos(bb); + int64_t off = bb_pos(bb); return !(off & mask); } static inline int bs_is_align( BITSTREAM *s, uint32_t mask ) { - off_t off = bs_pos(s); + int64_t off = bs_pos(s); return !(off & mask); } diff -Nru libbluray-0.5.0/src/util/log_control.h libbluray-0.8.1/src/util/log_control.h --- libbluray-0.5.0/src/util/log_control.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/log_control.h 2015-02-18 09:44:59.000000000 +0000 @@ -63,7 +63,7 @@ uint32_t bd_get_debug_mask(void); #ifdef __cplusplus -}; +} #endif #endif /* BD_LOG_CONTROL_H_ */ diff -Nru libbluray-0.5.0/src/util/logging.c libbluray-0.8.1/src/util/logging.c --- libbluray-0.5.0/src/util/logging.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/logging.c 2015-05-15 09:25:06.000000000 +0000 @@ -18,8 +18,14 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "logging.h" +#include "file/file.h" + #include #include #include @@ -43,16 +49,6 @@ return debug_mask; } -char *print_hex(char *out, const uint8_t *buf, int count) -{ - int zz; - for(zz = 0; zz < count; zz++) { - sprintf(out + (zz * 2), "%02x", buf[zz]); - } - - return out; -} - void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) { static int debug_init = 0; @@ -84,10 +80,11 @@ } if (mask & debug_mask) { + const char *f = strrchr(file, DIR_SEP_CHAR); char buffer[4096], *pt = buffer; va_list args; - pt += sprintf(buffer, "%s:%d: ", file, line); + pt += sprintf(buffer, "%s:%d: ", f ? f + 1 : file, line); va_start(args, format); vsnprintf(pt, sizeof(buffer) - (size_t)(intptr_t)(pt - buffer) - 1, format, args); diff -Nru libbluray-0.5.0/src/util/logging.h libbluray-0.8.1/src/util/logging.h --- libbluray-0.5.0/src/util/logging.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/logging.h 2015-01-26 08:01:57.000000000 +0000 @@ -36,7 +36,6 @@ } \ } while (0) -BD_PRIVATE char *print_hex(char *out, const uint8_t *str, int count); BD_PRIVATE void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) BD_ATTR_FORMAT_PRINTF(4,5); diff -Nru libbluray-0.5.0/src/util/macro.h libbluray-0.8.1/src/util/macro.h --- libbluray-0.5.0/src/util/macro.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/macro.h 2015-03-20 10:50:38.000000000 +0000 @@ -21,10 +21,8 @@ #ifndef MACRO_H_ #define MACRO_H_ -#include /* fprintf() */ #include /* free() */ -#define HEX_PRINT(X,Y) { int zz; for(zz = 0; zz < Y; zz++) fprintf(stderr, "%02X", X[zz]); fprintf(stderr, "\n"); } #define MKINT_BE16(X) ( (X)[0] << 8 | (X)[1] ) #define MKINT_BE24(X) ( (X)[0] << 16 | (X)[1] << 8 | (X)[2] ) #define MKINT_BE32(X) ( (X)[0] << 24 | (X)[1] << 16 | (X)[2] << 8 | (X)[3] ) @@ -33,6 +31,7 @@ #define BD_MIN(a,b) ((a)<(b)?(a):(b)) #define BD_MAX(a,b) ((a)>(b)?(a):(b)) +#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1)) /* * automatic cast from void* (malloc/calloc/realloc) diff -Nru libbluray-0.5.0/src/util/mutex.c libbluray-0.8.1/src/util/mutex.c --- libbluray-0.5.0/src/util/mutex.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/util/mutex.c 2015-02-28 16:45:26.000000000 +0000 @@ -0,0 +1,196 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010-2014 Petri Hintukainen + * + * 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mutex.h" + +#include "logging.h" +#include "macro.h" + +#if defined(_WIN32) +# include +#elif defined(HAVE_PTHREAD_H) +# include +#else +# error no mutex support found +#endif + + +#if defined(_WIN32) + +typedef struct { + CRITICAL_SECTION cs; +} MUTEX_IMPL; + +static int _mutex_lock(MUTEX_IMPL *p) +{ + EnterCriticalSection(&p->cs); + return 0; +} + +static int _mutex_unlock(MUTEX_IMPL *p) +{ + LeaveCriticalSection(&p->cs); + return 0; +} + +static int _mutex_init(MUTEX_IMPL *p) +{ + InitializeCriticalSection(&p->cs); + return 0; +} + +static int _mutex_destroy(MUTEX_IMPL *p) +{ + DeleteCriticalSection(&p->cs); + return 0; +} + + +#elif defined(HAVE_PTHREAD_H) + +typedef struct { + int lock_count; + pthread_t owner; + pthread_mutex_t mutex; +} MUTEX_IMPL; + +static int _mutex_init(MUTEX_IMPL *p) +{ + p->owner = (pthread_t)-1; + p->lock_count = 0; + + if (pthread_mutex_init(&p->mutex, NULL)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_init() failed !\n"); + return -1; + } + + return 0; +} + +static int _mutex_lock(MUTEX_IMPL *p) +{ + if (pthread_equal(p->owner, pthread_self())) { + /* recursive lock */ + p->lock_count++; + return 0; + } + + if (pthread_mutex_lock(&p->mutex)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_lock() failed !\n"); + return -1; + } + + p->owner = pthread_self(); + p->lock_count = 1; + + return 0; +} + +static int _mutex_unlock(MUTEX_IMPL *p) +{ + if (!pthread_equal(p->owner, pthread_self())) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock(): not owner !\n"); + return -1; + } + + p->lock_count--; + if (p->lock_count > 0) { + return 0; + } + + /* unlock */ + + p->owner = (pthread_t)-1; + + if (pthread_mutex_unlock(&p->mutex)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_unlock() failed !\n"); + return -1; + } + + return 0; +} + +static int _mutex_destroy(MUTEX_IMPL *p) +{ + _mutex_lock(p); + _mutex_unlock(p); + + if (pthread_mutex_destroy(&p->mutex)) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_destroy() failed !\n"); + return -1; + } + + return 0; +} + +#endif /* HAVE_PTHREAD_H */ + +int bd_mutex_lock(BD_MUTEX *p) +{ + if (!p->impl) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_lock() failed !\n"); + return -1; + } + return _mutex_lock((MUTEX_IMPL*)p->impl); +} + +int bd_mutex_unlock(BD_MUTEX *p) +{ + if (!p->impl) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock() failed !\n"); + return -1; + } + return _mutex_unlock((MUTEX_IMPL*)p->impl); +} + +int bd_mutex_init(BD_MUTEX *p) +{ + p->impl = calloc(1, sizeof(MUTEX_IMPL)); + if (!p->impl) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_init() failed !\n"); + return -1; + } + + if (_mutex_init((MUTEX_IMPL*)p->impl) < 0) { + X_FREE(p->impl); + return -1; + } + + return 0; +} + +int bd_mutex_destroy(BD_MUTEX *p) +{ + if (!p->impl) { + BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_destroy() failed !\n"); + return -1; + } + + if (_mutex_destroy((MUTEX_IMPL*)p->impl) < 0) { + return -1; + } + + X_FREE(p->impl); + return 0; +} + diff -Nru libbluray-0.5.0/src/util/mutex.h libbluray-0.8.1/src/util/mutex.h --- libbluray-0.5.0/src/util/mutex.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/mutex.h 2015-02-28 16:45:26.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of libbluray - * Copyright (C) 2010 hpi1 + * Copyright (C) 2010-2014 Petri Hintukainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,42 +20,7 @@ #ifndef LIBBLURAY_MUTEX_H_ #define LIBBLURAY_MUTEX_H_ -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#if defined(_WIN32) -# include -#elif defined(HAVE_PTHREAD_H) -# include -#else -# error no mutex support found -#endif - - -#if defined(_WIN32) - -#include - -typedef CRITICAL_SECTION BD_MUTEX; - -#define bd_mutex_lock(m) \ - (EnterCriticalSection(m), 0) - -#define bd_mutex_unlock(m) \ - (LeaveCriticalSection(m), 0) - -#define bd_mutex_trylock(m) \ - (TryEnterCriticalSection(m) ? 0 : EBUSY) - -#define bd_mutex_init(m) \ - (InitializeCriticalSection(m), 0) - -#define bd_mutex_destroy(m) \ - (DeleteCriticalSection(m), 0) - - -#elif defined(HAVE_PTHREAD_H) +#include "attributes.h" /* * recursive mutex @@ -63,77 +28,13 @@ typedef struct bd_mutex_s BD_MUTEX; struct bd_mutex_s { - int lock_count; - pthread_t owner; - pthread_mutex_t mutex; + void *impl; }; -static inline int bd_mutex_init(BD_MUTEX *p) -{ - p->owner = (pthread_t)-1; - p->lock_count = 0; - - if (pthread_mutex_init(&p->mutex, NULL)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_init() failed !\n"); - return -1; - } - - return 0; -} - -static inline int bd_mutex_destroy(BD_MUTEX *p) -{ - if (pthread_mutex_destroy(&p->mutex)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_destroy() failed !\n"); - return -1; - } - return 0; -} - -static int bd_mutex_lock(BD_MUTEX *p) -{ - if (pthread_equal(p->owner, pthread_self())) { - /* recursive lock */ - p->lock_count++; - return 0; - } - - if (pthread_mutex_lock(&p->mutex)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_lock() failed !\n"); - return -1; - } - - p->owner = pthread_self(); - p->lock_count = 1; - - return 0; -} - -static int bd_mutex_unlock(BD_MUTEX *p) -{ - if (!pthread_equal(p->owner, pthread_self())) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock(): not owner !\n"); - return -1; - } - - p->lock_count--; - if (p->lock_count > 0) { - return 0; - } - - /* unlock */ - - p->owner = (pthread_t)-1; - - if (pthread_mutex_unlock(&p->mutex)) { - BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock() failed !\n"); - return -1; - } - - return 0; -} - -#endif // HAVE_PTHREAD_H +BD_PRIVATE int bd_mutex_init(BD_MUTEX *p); +BD_PRIVATE int bd_mutex_destroy(BD_MUTEX *p); +BD_PRIVATE int bd_mutex_lock(BD_MUTEX *p); +BD_PRIVATE int bd_mutex_unlock(BD_MUTEX *p); #endif // LIBBLURAY_MUTEX_H_ diff -Nru libbluray-0.5.0/src/util/refcnt.c libbluray-0.8.1/src/util/refcnt.c --- libbluray-0.5.0/src/util/refcnt.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/refcnt.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,12 +17,15 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "refcnt.h" #include "logging.h" #include "mutex.h" -#include #include #include @@ -99,8 +102,14 @@ if (obj) { obj = realloc(&((BD_REFCNT *)obj)[-1], sz); + if (!obj) { + return NULL; + } } else { obj = realloc(NULL, sz); + if (!obj) { + return NULL; + } memset(obj, 0, sizeof(BD_REFCNT)); } diff -Nru libbluray-0.5.0/src/util/refcnt.h libbluray-0.8.1/src/util/refcnt.h --- libbluray-0.5.0/src/util/refcnt.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/refcnt.h 2015-01-26 08:01:57.000000000 +0000 @@ -18,11 +18,11 @@ */ #ifndef BD_REFCNT_H_ -#define BD_FEFCNT_H_ +#define BD_REFCNT_H_ #include "attributes.h" -#include +#include #ifdef MACRO_H_ # error macro.h included before refcnt.h diff -Nru libbluray-0.5.0/src/util/strutl.c libbluray-0.8.1/src/util/strutl.c --- libbluray-0.5.0/src/util/strutl.c 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/strutl.c 2015-05-15 09:25:06.000000000 +0000 @@ -17,6 +17,10 @@ * . */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "strutl.h" #include "macro.h" @@ -27,22 +31,37 @@ #include #include -char * str_dup(const char *str) +char *str_dup(const char *str) { - return str ? strcpy (malloc(strlen(str) + 1), str) : NULL; + char *dup = NULL; + + if (str) { + size_t size = strlen(str) + 1; + dup = malloc(size); + if (dup) { + memcpy(dup, str, size); + } + } + return dup; } -char * str_printf(const char *fmt, ...) +char *str_printf(const char *fmt, ...) { /* Guess we need no more than 100 bytes. */ - int len; va_list ap; - int size = 100; - char *tmp, *str = NULL; + int len; + int size = 100; + char *tmp, *str = NULL; + + while (1) { + + tmp = realloc(str, size); + if (tmp == NULL) { + X_FREE(str); + return NULL; + } + str = tmp; - str = malloc(size); - while (1) - { /* Try to print in the allocated space. */ va_start(ap, fmt); len = vsnprintf(str, size, fmt, ap); @@ -58,12 +77,6 @@ size = len+1; /* precisely what is needed */ else /* glibc 2.0 */ size *= 2; /* twice the old size */ - - tmp = realloc(str, size); - if (tmp == NULL) { - return str; - } - str = tmp; } } @@ -95,3 +108,13 @@ s++; } } + +char *str_print_hex(char *out, const uint8_t *buf, int count) +{ + int zz; + for (zz = 0; zz < count; zz++) { + sprintf(out + (zz * 2), "%02x", buf[zz]); + } + + return out; +} diff -Nru libbluray-0.5.0/src/util/strutl.h libbluray-0.8.1/src/util/strutl.h --- libbluray-0.5.0/src/util/strutl.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/strutl.h 2015-01-26 08:01:57.000000000 +0000 @@ -30,4 +30,6 @@ BD_PRIVATE uint32_t str_to_uint32(const char *s, int n); BD_PRIVATE void str_tolower(char *s); +BD_PRIVATE char * str_print_hex(char *out, const uint8_t *str, int count); + #endif // STRUTL_H_ diff -Nru libbluray-0.5.0/src/util/time.c libbluray-0.8.1/src/util/time.c --- libbluray-0.5.0/src/util/time.c 1970-01-01 00:00:00.000000000 +0000 +++ libbluray-0.8.1/src/util/time.c 2015-02-28 16:45:26.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * This file is part of libbluray + * Copyright (C) 2010 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 + * . + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "time.h" + +#include + +#if defined(_WIN32) +# include +#elif defined(HAVE_SYS_TIME_H) +# include +#else +# error no time support found +#endif + +#if defined(_WIN32) + +static uint64_t _bd_get_scr_impl(void) +{ + HANDLE thread; + DWORD_PTR mask; + LARGE_INTEGER frequency, counter; + + thread = GetCurrentThread(); + mask = SetThreadAffinityMask(thread, 1); + QueryPerformanceFrequency(&frequency); + QueryPerformanceCounter(&counter); + SetThreadAffinityMask(thread, mask); + + return (uint64_t)(counter.QuadPart * 1000.0 / frequency.QuadPart) * 90; +} + +#elif defined(HAVE_SYS_TIME_H) + +static uint64_t _bd_get_scr_impl(void) +{ + struct timeval tv; + gettimeofday(&tv, 0); + return ((uint64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000) * 90; +} + +#endif + +uint64_t bd_get_scr(void) +{ + static uint64_t t0 = (uint64_t)-1; + + uint64_t now = _bd_get_scr_impl(); + + if (t0 > now) { + t0 = now; + } + + return now - t0; +} diff -Nru libbluray-0.5.0/src/util/time.h libbluray-0.8.1/src/util/time.h --- libbluray-0.5.0/src/util/time.h 2013-12-21 08:10:03.000000000 +0000 +++ libbluray-0.8.1/src/util/time.h 2015-02-28 16:45:26.000000000 +0000 @@ -20,58 +20,10 @@ #ifndef LIBBLURAY_TIME_H_ #define LIBBLURAY_TIME_H_ -#if HAVE_CONFIG_H -#include "config.h" -#endif +#include "attributes.h" -#if defined(_WIN32) -# include -#elif defined(HAVE_SYS_TIME_H) -# include -#else -# error no time support found -#endif - - -#if defined(_WIN32) -static uint64_t _bd_get_scr_impl(void) -{ - HANDLE thread; - DWORD_PTR mask; - LARGE_INTEGER frequency, counter; - - thread = GetCurrentThread(); - mask = SetThreadAffinityMask(thread, 1); - QueryPerformanceFrequency(&frequency); - QueryPerformanceCounter(&counter); - SetThreadAffinityMask(thread, mask); - - return (uint64_t)(counter.QuadPart * 1000.0 / frequency.QuadPart) * 90; -} - -#elif defined(HAVE_SYS_TIME_H) - -static uint64_t _bd_get_scr_impl(void) -{ - struct timeval tv; - gettimeofday(&tv, 0); - return ((uint64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000) * 90; -} - -#endif - -static uint64_t bd_get_scr(void) -{ - static uint64_t t0 = (uint64_t)-1; - - uint64_t now = _bd_get_scr_impl(); - - if (t0 > now) { - t0 = now; - } - - return now - t0; -} +#include +BD_PRIVATE uint64_t bd_get_scr(void); #endif // LIBBLURAY_TIME_H_